netlify-cli 6.9.6 → 6.9.10

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 (46) hide show
  1. package/npm-shrinkwrap.json +446 -398
  2. package/oclif.manifest.json +1 -1
  3. package/package.json +5 -5
  4. package/scripts/postinstall.js +1 -1
  5. package/src/commands/addons/auth.js +2 -2
  6. package/src/commands/addons/config.js +2 -3
  7. package/src/commands/addons/create.js +5 -5
  8. package/src/commands/addons/delete.js +4 -4
  9. package/src/commands/api.js +6 -6
  10. package/src/commands/build/index.js +13 -13
  11. package/src/commands/deploy.js +30 -41
  12. package/src/commands/dev/exec.js +2 -2
  13. package/src/commands/dev/index.js +7 -7
  14. package/src/commands/env/import.js +2 -2
  15. package/src/commands/functions/build.js +3 -3
  16. package/src/commands/functions/create.js +12 -17
  17. package/src/commands/functions/invoke.js +7 -6
  18. package/src/commands/functions/list.js +12 -12
  19. package/src/commands/functions/serve.js +2 -4
  20. package/src/commands/link.js +15 -15
  21. package/src/commands/lm/info.js +1 -1
  22. package/src/commands/lm/setup.js +5 -4
  23. package/src/commands/open/admin.js +10 -10
  24. package/src/commands/open/site.js +8 -8
  25. package/src/commands/sites/create.js +5 -5
  26. package/src/commands/sites/delete.js +11 -11
  27. package/src/commands/status/hooks.js +10 -10
  28. package/src/commands/status/index.js +14 -14
  29. package/src/commands/unlink.js +2 -2
  30. package/src/functions-templates/js/stripe-charge/package-lock.json +13 -13
  31. package/src/functions-templates/js/stripe-subscription/package-lock.json +13 -13
  32. package/src/functions-templates/js/token-hider/package-lock.json +6 -6
  33. package/src/functions-templates/ts/hello-world/package-lock.json +7 -7
  34. package/src/lib/api.js +3 -1
  35. package/src/lib/fs.js +1 -1
  36. package/src/lib/functions/runtimes/go/index.js +1 -1
  37. package/src/lib/functions/server.js +3 -4
  38. package/src/utils/addons/prepare.js +7 -7
  39. package/src/utils/command.js +1 -1
  40. package/src/utils/deploy/deploy-site.js +1 -1
  41. package/src/utils/dev.js +6 -6
  42. package/src/utils/dot-env.js +5 -1
  43. package/src/utils/edge-handlers.js +7 -5
  44. package/src/utils/get-global-config.js +1 -1
  45. package/src/utils/init/config-github.js +1 -1
  46. package/src/utils/lm/install.js +1 -1
@@ -3,6 +3,7 @@ const execa = require('execa')
3
3
  const Listr = require('listr')
4
4
 
5
5
  const Command = require('../../utils/command')
6
+ const { error } = require('../../utils/command-helpers')
6
7
  const { installPlatform } = require('../../utils/lm/install')
7
8
  const { checkHelperVersion } = require('../../utils/lm/requirements')
8
9
  const { printBanner } = require('../../utils/lm/ui')
@@ -14,7 +15,7 @@ const installHelperIfMissing = async function ({ force }) {
14
15
  if (!version) {
15
16
  installHelper = true
16
17
  }
17
- } catch (error) {
18
+ } catch {
18
19
  installHelper = true
19
20
  }
20
21
 
@@ -37,9 +38,9 @@ const provisionService = async function (siteId, api) {
37
38
  addon: addonName,
38
39
  body: {},
39
40
  })
40
- } catch (error) {
41
+ } catch (error_) {
41
42
  // error is JSONHTTPError
42
- throw new Error(error.json.error)
43
+ throw new Error(error_.json.error)
43
44
  }
44
45
  }
45
46
 
@@ -62,7 +63,7 @@ class LmSetupCommand extends Command {
62
63
  try {
63
64
  helperInstalled = await installHelperIfMissing({ force: flags['force-install'] })
64
65
  } catch (error_) {
65
- this.error(error_)
66
+ error(error_)
66
67
  }
67
68
  }
68
69
 
@@ -1,5 +1,5 @@
1
1
  const Command = require('../../utils/command')
2
- const { log } = require('../../utils/command-helpers')
2
+ const { log, warn, error, exit } = require('../../utils/command-helpers')
3
3
  const openBrowser = require('../../utils/open-browser')
4
4
 
5
5
  class OpenAdminCommand extends Command {
@@ -11,7 +11,7 @@ class OpenAdminCommand extends Command {
11
11
  const siteId = site.id
12
12
 
13
13
  if (!siteId) {
14
- this.warn(`No Site ID found in current directory.
14
+ warn(`No Site ID found in current directory.
15
15
  Run \`netlify link\` to connect to this folder to a site`)
16
16
  return false
17
17
  }
@@ -21,26 +21,26 @@ Run \`netlify link\` to connect to this folder to a site`)
21
21
  siteData = await api.getSite({ siteId })
22
22
  log(`Opening "${siteData.name}" site admin UI:`)
23
23
  log(`> ${siteData.admin_url}`)
24
- } catch (error) {
24
+ } catch (error_) {
25
25
  // unauthorized
26
- if (error.status === 401) {
27
- this.warn(`Log in with a different account or re-link to a site you have permission for`)
28
- this.error(`Not authorized to view the currently linked site (${siteId})`)
26
+ if (error_.status === 401) {
27
+ warn(`Log in with a different account or re-link to a site you have permission for`)
28
+ error(`Not authorized to view the currently linked site (${siteId})`)
29
29
  }
30
30
  // site not found
31
- if (error.status === 404) {
31
+ if (error_.status === 404) {
32
32
  log()
33
33
  log('Please double check this ID and verify you are logged in with the correct account')
34
34
  log()
35
35
  log('To fix this, run `netlify unlink` then `netlify link` to reconnect to the correct site ID')
36
36
  log()
37
- this.error(`Site "${siteId}" not found in account`)
37
+ error(`Site "${siteId}" not found in account`)
38
38
  }
39
- this.error(error)
39
+ error(error_)
40
40
  }
41
41
 
42
42
  await openBrowser({ url: siteData.admin_url })
43
- this.exit()
43
+ exit()
44
44
  }
45
45
  }
46
46
 
@@ -1,5 +1,5 @@
1
1
  const Command = require('../../utils/command')
2
- const { log } = require('../../utils/command-helpers')
2
+ const { log, warn, error, exit } = require('../../utils/command-helpers')
3
3
  const openBrowser = require('../../utils/open-browser')
4
4
 
5
5
  class OpenAdminCommand extends Command {
@@ -10,7 +10,7 @@ class OpenAdminCommand extends Command {
10
10
  const siteId = site.id
11
11
 
12
12
  if (!siteId) {
13
- this.warn(`No Site ID found in current directory.
13
+ warn(`No Site ID found in current directory.
14
14
  Run \`netlify link\` to connect to this folder to a site`)
15
15
  return false
16
16
  }
@@ -22,17 +22,17 @@ Run \`netlify link\` to connect to this folder to a site`)
22
22
  url = siteData.ssl_url || siteData.url
23
23
  log(`Opening "${siteData.name}" site url:`)
24
24
  log(`> ${url}`)
25
- } catch (error) {
25
+ } catch (error_) {
26
26
  // unauthorized
27
- if (error.status === 401) {
28
- this.warn(`Log in with a different account or re-link to a site you have permission for`)
29
- this.error(`Not authorized to view the currently linked site (${siteId})`)
27
+ if (error_.status === 401) {
28
+ warn(`Log in with a different account or re-link to a site you have permission for`)
29
+ error(`Not authorized to view the currently linked site (${siteId})`)
30
30
  }
31
- this.error(error)
31
+ error(error_)
32
32
  }
33
33
 
34
34
  await openBrowser({ url })
35
- this.exit()
35
+ exit()
36
36
  }
37
37
  }
38
38
 
@@ -8,7 +8,7 @@ const prettyjson = require('prettyjson')
8
8
  const { v4: uuidv4 } = require('uuid')
9
9
 
10
10
  const Command = require('../../utils/command')
11
- const { log, logJson } = require('../../utils/command-helpers')
11
+ const { log, logJson, warn, error } = require('../../utils/command-helpers')
12
12
  const { getRepoData } = require('../../utils/get-repo-data')
13
13
  const { configureRepo } = require('../../utils/init/config')
14
14
  const { track } = require('../../utils/telemetry')
@@ -93,12 +93,12 @@ class SitesCreateCommand extends Command {
93
93
  accountSlug,
94
94
  body,
95
95
  })
96
- } catch (error) {
97
- if (error.status === 422) {
98
- this.warn(`${name}.netlify.app already exists. Please try a different slug.`)
96
+ } catch (error_) {
97
+ if (error_.status === 422) {
98
+ warn(`${name}.netlify.app already exists. Please try a different slug.`)
99
99
  await inputSiteName()
100
100
  } else {
101
- this.error(`createSiteInTeam error: ${error.status}: ${error.message}`)
101
+ error(`createSiteInTeam error: ${error_.status}: ${error_.message}`)
102
102
  }
103
103
  }
104
104
  }
@@ -3,7 +3,7 @@ const chalk = require('chalk')
3
3
  const inquirer = require('inquirer')
4
4
 
5
5
  const Command = require('../../utils/command')
6
- const { log } = require('../../utils/command-helpers')
6
+ const { log, error, exit } = require('../../utils/command-helpers')
7
7
  const { parseRawFlags } = require('../../utils/parse-raw-flags')
8
8
 
9
9
  class SitesDeleteCommand extends Command {
@@ -22,14 +22,14 @@ class SitesDeleteCommand extends Command {
22
22
  let siteData
23
23
  try {
24
24
  siteData = await api.getSite({ siteId })
25
- } catch (error) {
26
- if (error.status === 404) {
27
- this.error(`No site with id ${siteId} found. Please verify the siteId & try again.`)
25
+ } catch (error_) {
26
+ if (error_.status === 404) {
27
+ error(`No site with id ${siteId} found. Please verify the siteId & try again.`)
28
28
  }
29
29
  }
30
30
 
31
31
  if (!siteData) {
32
- this.error(`Unable to process site`)
32
+ error(`Unable to process site`)
33
33
  }
34
34
 
35
35
  const rawFlags = parseRawFlags(raw)
@@ -51,7 +51,7 @@ class SitesDeleteCommand extends Command {
51
51
  })
52
52
  log()
53
53
  if (!wantsToDelete) {
54
- this.exit()
54
+ exit()
55
55
  }
56
56
  }
57
57
 
@@ -71,7 +71,7 @@ class SitesDeleteCommand extends Command {
71
71
  default: false,
72
72
  })
73
73
  if (!wantsToDelete) {
74
- this.exit()
74
+ exit()
75
75
  }
76
76
  }
77
77
 
@@ -79,11 +79,11 @@ class SitesDeleteCommand extends Command {
79
79
 
80
80
  try {
81
81
  await api.deleteSite({ site_id: siteId })
82
- } catch (error) {
83
- if (error.status === 404) {
84
- this.error(`No site with id ${siteId} found. Please verify the siteId & try again.`)
82
+ } catch (error_) {
83
+ if (error_.status === 404) {
84
+ error(`No site with id ${siteId} found. Please verify the siteId & try again.`)
85
85
  } else {
86
- this.error(`Delete Site error: ${error.status}: ${error.message}`)
86
+ error(`Delete Site error: ${error_.status}: ${error_.message}`)
87
87
  }
88
88
  }
89
89
  log(`Site "${siteId}" successfully deleted!`)
@@ -2,7 +2,7 @@ const { get } = require('dot-prop')
2
2
  const prettyjson = require('prettyjson')
3
3
 
4
4
  const Command = require('../../utils/command')
5
- const { log } = require('../../utils/command-helpers')
5
+ const { log, warn, error } = require('../../utils/command-helpers')
6
6
 
7
7
  class StatusHooksCommand extends Command {
8
8
  async run() {
@@ -12,24 +12,24 @@ class StatusHooksCommand extends Command {
12
12
 
13
13
  const siteId = site.id
14
14
  if (!siteId) {
15
- this.warn('Did you run `netlify link` yet?')
16
- this.error(`You don't appear to be in a folder that is linked to a site`)
15
+ warn('Did you run `netlify link` yet?')
16
+ error(`You don't appear to be in a folder that is linked to a site`)
17
17
  }
18
18
 
19
19
  let siteData
20
20
  try {
21
21
  siteData = await api.getSite({ siteId })
22
- } catch (error) {
22
+ } catch (error_) {
23
23
  // unauthorized
24
- if (error.status === 401) {
25
- this.warn(`Log in with a different account or re-link to a site you have permission for`)
26
- this.error(`Not authorized to view the currently linked site (${siteId})`)
24
+ if (error_.status === 401) {
25
+ warn(`Log in with a different account or re-link to a site you have permission for`)
26
+ error(`Not authorized to view the currently linked site (${siteId})`)
27
27
  }
28
28
  // missing
29
- if (error.status === 404) {
30
- this.error(`The site this folder is linked to can't be found`)
29
+ if (error_.status === 404) {
30
+ error(`The site this folder is linked to can't be found`)
31
31
  }
32
- this.error(error)
32
+ error(error_)
33
33
  }
34
34
 
35
35
  const ntlHooks = await api.listHooksBySiteId({ siteId: siteData.id })
@@ -4,7 +4,7 @@ const clean = require('clean-deep')
4
4
  const prettyjson = require('prettyjson')
5
5
 
6
6
  const Command = require('../../utils/command')
7
- const { log, logJson, getToken } = require('../../utils/command-helpers')
7
+ const { log, logJson, warn, error, exit, getToken } = require('../../utils/command-helpers')
8
8
 
9
9
  class StatusCommand extends Command {
10
10
  async run() {
@@ -18,7 +18,7 @@ class StatusCommand extends Command {
18
18
  log(`Not logged in. Please log in to see site status.`)
19
19
  log()
20
20
  log('Login with "netlify login" command')
21
- this.exit()
21
+ exit()
22
22
  }
23
23
 
24
24
  const siteId = site.id
@@ -32,9 +32,9 @@ class StatusCommand extends Command {
32
32
 
33
33
  try {
34
34
  ;[accounts, user] = await Promise.all([api.listAccountsForUser(), api.getCurrentUser()])
35
- } catch (error) {
36
- if (error.status === 401) {
37
- this.error(
35
+ } catch (error_) {
36
+ if (error_.status === 401) {
37
+ error(
38
38
  'Your session has expired. Please try to re-authenticate by running `netlify logout` and `netlify login`.',
39
39
  )
40
40
  }
@@ -59,23 +59,23 @@ class StatusCommand extends Command {
59
59
  log(prettyjson.render(cleanAccountData))
60
60
 
61
61
  if (!siteId) {
62
- this.warn('Did you run `netlify link` yet?')
63
- this.error(`You don't appear to be in a folder that is linked to a site`)
62
+ warn('Did you run `netlify link` yet?')
63
+ error(`You don't appear to be in a folder that is linked to a site`)
64
64
  }
65
65
  let siteData
66
66
  try {
67
67
  siteData = await api.getSite({ siteId })
68
- } catch (error) {
68
+ } catch (error_) {
69
69
  // unauthorized
70
- if (error.status === 401) {
71
- this.warn(`Log in with a different account or re-link to a site you have permission for`)
72
- this.error(`Not authorized to view the currently linked site (${siteId})`)
70
+ if (error_.status === 401) {
71
+ warn(`Log in with a different account or re-link to a site you have permission for`)
72
+ error(`Not authorized to view the currently linked site (${siteId})`)
73
73
  }
74
74
  // missing
75
- if (error.status === 404) {
76
- this.error(`The site this folder is linked to can't be found`)
75
+ if (error_.status === 404) {
76
+ error(`The site this folder is linked to can't be found`)
77
77
  }
78
- this.error(error)
78
+ error(error_)
79
79
  }
80
80
 
81
81
  // Json only logs out if --json flag is passed
@@ -1,5 +1,5 @@
1
1
  const Command = require('../utils/command')
2
- const { log } = require('../utils/command-helpers')
2
+ const { log, exit } = require('../utils/command-helpers')
3
3
  const { track } = require('../utils/telemetry')
4
4
 
5
5
  class UnlinkCommand extends Command {
@@ -9,7 +9,7 @@ class UnlinkCommand extends Command {
9
9
 
10
10
  if (!siteId) {
11
11
  log(`Folder is not linked to a Netlify site. Run 'netlify link' to link it`)
12
- return this.exit()
12
+ return exit()
13
13
  }
14
14
 
15
15
  let siteData = {}
@@ -9,13 +9,13 @@
9
9
  "version": "1.0.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "stripe": "^8.119.0"
12
+ "stripe": "^8.176.0"
13
13
  }
14
14
  },
15
15
  "node_modules/@types/node": {
16
- "version": "16.9.1",
17
- "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz",
18
- "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="
16
+ "version": "16.9.4",
17
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.4.tgz",
18
+ "integrity": "sha512-KDazLNYAGIuJugdbULwFZULF9qQ13yNWEBFnfVpqlpgAAo6H/qnM9RjBgh0A0kmHf3XxAKLdN5mTIng9iUvVLA=="
19
19
  },
20
20
  "node_modules/call-bind": {
21
21
  "version": "1.0.2",
@@ -105,9 +105,9 @@
105
105
  }
106
106
  },
107
107
  "node_modules/stripe": {
108
- "version": "8.174.0",
109
- "resolved": "https://registry.npmjs.org/stripe/-/stripe-8.174.0.tgz",
110
- "integrity": "sha512-UFU5TuYH7XwUmSllUIcIKhhsvvhhjw9D6ZwVdfB74wU4VOOaWBiQqszkw6chaEFpdulUmbcAH5eZltV3HwOi7g==",
108
+ "version": "8.176.0",
109
+ "resolved": "https://registry.npmjs.org/stripe/-/stripe-8.176.0.tgz",
110
+ "integrity": "sha512-0KCDo8TWFgeNWU7cPaqdjO2u2OSth0cmWYZmA7xsuxRCk7/lgWbJ/UbeSphx74cCIjFCmGuzDoNuNxqon9lEbg==",
111
111
  "dependencies": {
112
112
  "@types/node": ">=8.1.0",
113
113
  "qs": "^6.6.0"
@@ -119,9 +119,9 @@
119
119
  },
120
120
  "dependencies": {
121
121
  "@types/node": {
122
- "version": "16.9.1",
123
- "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz",
124
- "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="
122
+ "version": "16.9.4",
123
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.4.tgz",
124
+ "integrity": "sha512-KDazLNYAGIuJugdbULwFZULF9qQ13yNWEBFnfVpqlpgAAo6H/qnM9RjBgh0A0kmHf3XxAKLdN5mTIng9iUvVLA=="
125
125
  },
126
126
  "call-bind": {
127
127
  "version": "1.0.2",
@@ -184,9 +184,9 @@
184
184
  }
185
185
  },
186
186
  "stripe": {
187
- "version": "8.174.0",
188
- "resolved": "https://registry.npmjs.org/stripe/-/stripe-8.174.0.tgz",
189
- "integrity": "sha512-UFU5TuYH7XwUmSllUIcIKhhsvvhhjw9D6ZwVdfB74wU4VOOaWBiQqszkw6chaEFpdulUmbcAH5eZltV3HwOi7g==",
187
+ "version": "8.176.0",
188
+ "resolved": "https://registry.npmjs.org/stripe/-/stripe-8.176.0.tgz",
189
+ "integrity": "sha512-0KCDo8TWFgeNWU7cPaqdjO2u2OSth0cmWYZmA7xsuxRCk7/lgWbJ/UbeSphx74cCIjFCmGuzDoNuNxqon9lEbg==",
190
190
  "requires": {
191
191
  "@types/node": ">=8.1.0",
192
192
  "qs": "^6.6.0"
@@ -9,13 +9,13 @@
9
9
  "version": "1.0.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "stripe": "^8.119.0"
12
+ "stripe": "^8.176.0"
13
13
  }
14
14
  },
15
15
  "node_modules/@types/node": {
16
- "version": "16.9.1",
17
- "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz",
18
- "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="
16
+ "version": "16.9.4",
17
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.4.tgz",
18
+ "integrity": "sha512-KDazLNYAGIuJugdbULwFZULF9qQ13yNWEBFnfVpqlpgAAo6H/qnM9RjBgh0A0kmHf3XxAKLdN5mTIng9iUvVLA=="
19
19
  },
20
20
  "node_modules/call-bind": {
21
21
  "version": "1.0.2",
@@ -105,9 +105,9 @@
105
105
  }
106
106
  },
107
107
  "node_modules/stripe": {
108
- "version": "8.174.0",
109
- "resolved": "https://registry.npmjs.org/stripe/-/stripe-8.174.0.tgz",
110
- "integrity": "sha512-UFU5TuYH7XwUmSllUIcIKhhsvvhhjw9D6ZwVdfB74wU4VOOaWBiQqszkw6chaEFpdulUmbcAH5eZltV3HwOi7g==",
108
+ "version": "8.176.0",
109
+ "resolved": "https://registry.npmjs.org/stripe/-/stripe-8.176.0.tgz",
110
+ "integrity": "sha512-0KCDo8TWFgeNWU7cPaqdjO2u2OSth0cmWYZmA7xsuxRCk7/lgWbJ/UbeSphx74cCIjFCmGuzDoNuNxqon9lEbg==",
111
111
  "dependencies": {
112
112
  "@types/node": ">=8.1.0",
113
113
  "qs": "^6.6.0"
@@ -119,9 +119,9 @@
119
119
  },
120
120
  "dependencies": {
121
121
  "@types/node": {
122
- "version": "16.9.1",
123
- "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz",
124
- "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="
122
+ "version": "16.9.4",
123
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.4.tgz",
124
+ "integrity": "sha512-KDazLNYAGIuJugdbULwFZULF9qQ13yNWEBFnfVpqlpgAAo6H/qnM9RjBgh0A0kmHf3XxAKLdN5mTIng9iUvVLA=="
125
125
  },
126
126
  "call-bind": {
127
127
  "version": "1.0.2",
@@ -184,9 +184,9 @@
184
184
  }
185
185
  },
186
186
  "stripe": {
187
- "version": "8.174.0",
188
- "resolved": "https://registry.npmjs.org/stripe/-/stripe-8.174.0.tgz",
189
- "integrity": "sha512-UFU5TuYH7XwUmSllUIcIKhhsvvhhjw9D6ZwVdfB74wU4VOOaWBiQqszkw6chaEFpdulUmbcAH5eZltV3HwOi7g==",
187
+ "version": "8.176.0",
188
+ "resolved": "https://registry.npmjs.org/stripe/-/stripe-8.176.0.tgz",
189
+ "integrity": "sha512-0KCDo8TWFgeNWU7cPaqdjO2u2OSth0cmWYZmA7xsuxRCk7/lgWbJ/UbeSphx74cCIjFCmGuzDoNuNxqon9lEbg==",
190
190
  "requires": {
191
191
  "@types/node": ">=8.1.0",
192
192
  "qs": "^6.6.0"
@@ -34,9 +34,9 @@
34
34
  }
35
35
  },
36
36
  "node_modules/follow-redirects": {
37
- "version": "1.14.3",
38
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz",
39
- "integrity": "sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==",
37
+ "version": "1.14.4",
38
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz",
39
+ "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==",
40
40
  "funding": [
41
41
  {
42
42
  "type": "individual",
@@ -147,9 +147,9 @@
147
147
  }
148
148
  },
149
149
  "follow-redirects": {
150
- "version": "1.14.3",
151
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz",
152
- "integrity": "sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw=="
150
+ "version": "1.14.4",
151
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz",
152
+ "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g=="
153
153
  },
154
154
  "function-bind": {
155
155
  "version": "1.1.1",
@@ -10,7 +10,7 @@
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@netlify/functions": "^0.7.2",
13
- "@types/node": "^14.0.0",
13
+ "@types/node": "^14.17.17",
14
14
  "typescript": "^4.0.0"
15
15
  }
16
16
  },
@@ -26,9 +26,9 @@
26
26
  }
27
27
  },
28
28
  "node_modules/@types/node": {
29
- "version": "14.17.15",
30
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.15.tgz",
31
- "integrity": "sha512-D1sdW0EcSCmNdLKBGMYb38YsHUS6JcM7yQ6sLQ9KuZ35ck7LYCKE7kYFHOO59ayFOY3zobWVZxf4KXhYHcHYFA=="
29
+ "version": "14.17.17",
30
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.17.tgz",
31
+ "integrity": "sha512-niAjcewgEYvSPCZm3OaM9y6YQrL2SEPH9PymtE6fuZAvFiP6ereCcvApGl2jKTq7copTIguX3PBvfP08LN4LvQ=="
32
32
  },
33
33
  "node_modules/is-promise": {
34
34
  "version": "4.0.0",
@@ -58,9 +58,9 @@
58
58
  }
59
59
  },
60
60
  "@types/node": {
61
- "version": "14.17.15",
62
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.15.tgz",
63
- "integrity": "sha512-D1sdW0EcSCmNdLKBGMYb38YsHUS6JcM7yQ6sLQ9KuZ35ck7LYCKE7kYFHOO59ayFOY3zobWVZxf4KXhYHcHYFA=="
61
+ "version": "14.17.17",
62
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.17.tgz",
63
+ "integrity": "sha512-niAjcewgEYvSPCZm3OaM9y6YQrL2SEPH9PymtE6fuZAvFiP6ereCcvApGl2jKTq7copTIguX3PBvfP08LN4LvQ=="
64
64
  },
65
65
  "is-promise": {
66
66
  "version": "4.0.0",
package/src/lib/api.js CHANGED
@@ -1,5 +1,7 @@
1
1
  const fetch = require('node-fetch')
2
2
 
3
+ const { warn } = require('../utils/command-helpers')
4
+
3
5
  const getHeaders = ({ token }) => ({
4
6
  'Content-Type': 'application/json',
5
7
  Authorization: `Bearer ${token}`,
@@ -69,7 +71,7 @@ const uploadEdgeHandlers = async ({ api, deployId, bundleBuffer, manifest }) =>
69
71
  return true
70
72
  }
71
73
 
72
- const cancelDeploy = async ({ api, deployId, warn }) => {
74
+ const cancelDeploy = async ({ api, deployId }) => {
73
75
  try {
74
76
  await api.cancelSiteDeploy({ deploy_id: deployId })
75
77
  } catch (error) {
package/src/lib/fs.js CHANGED
@@ -26,7 +26,7 @@ const fileExistsAsync = async (filePath) => {
26
26
  try {
27
27
  await accessAsync(filePath, fs.F_OK)
28
28
  return true
29
- } catch (_) {
29
+ } catch {
30
30
  return false
31
31
  }
32
32
  }
@@ -31,7 +31,7 @@ const checkGoInstallation = async ({ cwd }) => {
31
31
  await execa('go', ['version'], { cwd })
32
32
 
33
33
  return true
34
- } catch (_) {
34
+ } catch {
35
35
  return false
36
36
  }
37
37
  }
@@ -1,7 +1,7 @@
1
1
  const bodyParser = require('body-parser')
2
2
  const jwtDecode = require('jwt-decode')
3
3
 
4
- const { log } = require('../../utils/command-helpers')
4
+ const { log, warn } = require('../../utils/command-helpers')
5
5
  const { getInternalFunctionsDir } = require('../../utils/functions')
6
6
  const { NETLIFYDEVERR, NETLIFYDEVLOG } = require('../../utils/logo')
7
7
 
@@ -33,7 +33,7 @@ const buildClientContext = function (headers) {
33
33
  },
34
34
  user: jwtDecode(parts[1]),
35
35
  }
36
- } catch (_) {
36
+ } catch {
37
37
  // Ignore errors - bearer token is not a JWT, probably not intended for us
38
38
  }
39
39
  }
@@ -108,7 +108,7 @@ const createHandler = function ({ functionsRegistry }) {
108
108
  }
109
109
  }
110
110
 
111
- const getFunctionsServer = async function ({ functionsRegistry, siteUrl, warn, prefix }) {
111
+ const getFunctionsServer = async function ({ functionsRegistry, siteUrl, prefix }) {
112
112
  // performance optimization, load express on demand
113
113
  // eslint-disable-next-line node/global-require
114
114
  const express = require('express')
@@ -144,7 +144,6 @@ const startFunctionsServer = async ({
144
144
  config,
145
145
  settings,
146
146
  site,
147
- warn,
148
147
  errorExit,
149
148
  siteUrl,
150
149
  capabilities,
@@ -1,6 +1,6 @@
1
1
  const chalk = require('chalk')
2
2
 
3
- const { log } = require('../command-helpers')
3
+ const { log, error } = require('../command-helpers')
4
4
 
5
5
  const ADDON_VALIDATION = {
6
6
  EXISTS: 'EXISTS',
@@ -47,7 +47,7 @@ const validateCurrentAddon = ({ addon, validation, addonName, siteData, warn, ex
47
47
  }
48
48
  }
49
49
 
50
- const getAddonManifest = async ({ api, addonName, error }) => {
50
+ const getAddonManifest = async ({ api, addonName }) => {
51
51
  let manifest
52
52
  try {
53
53
  manifest = await api.showServiceManifest({ addonName })
@@ -61,7 +61,7 @@ const getAddonManifest = async ({ api, addonName, error }) => {
61
61
  return manifest
62
62
  }
63
63
 
64
- const getSiteData = async ({ api, siteId, error }) => {
64
+ const getSiteData = async ({ api, siteId }) => {
65
65
  let siteData
66
66
  try {
67
67
  siteData = await api.getSite({ siteId })
@@ -71,7 +71,7 @@ const getSiteData = async ({ api, siteId, error }) => {
71
71
  return siteData
72
72
  }
73
73
 
74
- const getAddons = async ({ api, siteId, error }) => {
74
+ const getAddons = async ({ api, siteId }) => {
75
75
  let addons
76
76
  try {
77
77
  addons = await api.listServiceInstancesForSite({ siteId })
@@ -82,7 +82,7 @@ const getAddons = async ({ api, siteId, error }) => {
82
82
  }
83
83
 
84
84
  const prepareAddonCommand = async ({ context, addonName, validation }) => {
85
- const { netlify, warn, error, exit } = context
85
+ const { netlify, warn, exit } = context
86
86
  const { api, site } = netlify
87
87
  const siteId = site.id
88
88
  if (!siteId) {
@@ -93,8 +93,8 @@ const prepareAddonCommand = async ({ context, addonName, validation }) => {
93
93
 
94
94
  const [manifest, siteData, addons] = await Promise.all([
95
95
  addonName ? getAddonManifest({ api, addonName, error }) : Promise.resolve(),
96
- getSiteData({ api, siteId, error }),
97
- getAddons({ api, siteId, error }),
96
+ getSiteData({ api, siteId }),
97
+ getAddons({ api, siteId }),
98
98
  ])
99
99
 
100
100
  let addon
@@ -123,7 +123,7 @@ class BaseCommand extends TrackedCommand {
123
123
  try {
124
124
  await this.netlify.api.getCurrentUser()
125
125
  return true
126
- } catch (_) {
126
+ } catch {
127
127
  return false
128
128
  }
129
129
  }