@heroku/skynet 1.6.12 → 1.6.14

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/README.md CHANGED
@@ -105,7 +105,8 @@ $ npm test
105
105
  $ npm run release
106
106
  ```
107
107
 
108
- * Verify that new package version is created on [npm website](https://www.npmjs.com/package/@heroku/skynet).
108
+ * Command 'npm run release' will change the version number in package.json file and commit. but the pull request will fail due to the enabled git pull process. A follow-up manual pull request is needed to check in the new version number in Git repository.
109
+ * Verify that new package version is created on [npm website](https://www.npmjs.com/package/@heroku/skynet), or directly run command "npm view @heroku/skynet"
109
110
  * Note: You will get an error at the end of `npm run release`. Np attempts to commit to master branch the updated package version in the package.json. But the commit will fail because our master branch is protected. You can ignore the error message.
110
111
  * Submit a new PR to update the version in `package.json` and `package-lock.json`. Here is one [PR example](https://github.com/heroku/heroku-skynet-cli/pull/74).
111
112
  * Test the newly released @heroku/skynet package
@@ -1,6 +1,6 @@
1
- let cli = require('heroku-cli-util')
2
- let command = require('../../lib/command')
3
- let SkynetAPI = require('../../lib/skynet')
1
+ const cli = require('heroku-cli-util')
2
+ const command = require('../../lib/command')
3
+ const SkynetAPI = require('../../lib/skynet')
4
4
 
5
5
  async function run (context) {
6
6
  const skynet = new SkynetAPI(context.auth.password)
@@ -1,6 +1,6 @@
1
- let cli = require('heroku-cli-util')
2
- let command = require('../../lib/command')
3
- let SkynetAPI = require('../../lib/skynet')
1
+ const cli = require('heroku-cli-util')
2
+ const command = require('../../lib/command')
3
+ const SkynetAPI = require('../../lib/skynet')
4
4
 
5
5
  async function run (context) {
6
6
  const skynet = new SkynetAPI(context.auth.password)
@@ -1,7 +1,7 @@
1
- let cli = require('heroku-cli-util')
2
- let command = require('../lib/command')
3
- let sudo = require('../lib/sudo')
4
- let SkynetAPI = require('../lib/skynet')
1
+ const cli = require('heroku-cli-util')
2
+ const command = require('../lib/command')
3
+ const sudo = require('../lib/sudo')
4
+ const SkynetAPI = require('../lib/skynet')
5
5
 
6
6
  async function run (context) {
7
7
  sudo()
@@ -1,16 +1,16 @@
1
- let cli = require('heroku-cli-util')
2
- let command = require('../lib/command')
3
- let sudo = require('../lib/sudo')
4
- let SkynetAPI = require('../lib/skynet')
1
+ const cli = require('heroku-cli-util')
2
+ const command = require('../lib/command')
3
+ const sudo = require('../lib/sudo')
4
+ const SkynetAPI = require('../lib/skynet')
5
5
 
6
6
  async function run (context) {
7
7
  sudo()
8
8
  const skynet = new SkynetAPI(context.auth.password)
9
- let user = context.flags.user || process.env.HEROKU_USER
10
- let notes = context.flags.notes
11
- let category = context.flags.category
12
- let force = context.flags.bypass
13
- let notify = !context.flags['no-notify']
9
+ const user = context.flags.user || process.env.HEROKU_USER
10
+ const notes = context.flags.notes
11
+ const category = context.flags.category
12
+ const force = context.flags.bypass
13
+ const notify = !context.flags['no-notify']
14
14
 
15
15
  if (!user) {
16
16
  throw new Error('Required flag: --user USER')
@@ -1,14 +1,14 @@
1
- let cli = require('heroku-cli-util')
2
- let command = require('../../lib/command')
3
- let sudo = require('../../lib/sudo')
4
- let SkynetAPI = require('../../lib/skynet')
1
+ const cli = require('heroku-cli-util')
2
+ const command = require('../../lib/command')
3
+ const sudo = require('../../lib/sudo')
4
+ const SkynetAPI = require('../../lib/skynet')
5
5
 
6
6
  function readlines (file) {
7
7
  return new Promise(function (resolve, reject) {
8
- let split = require('split')
9
- let fs = require('fs')
8
+ const split = require('split')
9
+ const fs = require('fs')
10
10
 
11
- let users = []
11
+ const users = []
12
12
 
13
13
  fs.createReadStream(file).pipe(split())
14
14
  .on('data', function (line) {
@@ -29,19 +29,19 @@ function readlines (file) {
29
29
  async function run (context) {
30
30
  sudo()
31
31
  const skynet = new SkynetAPI(context.auth.password)
32
- let app = context.flags.app
33
- let file = context.flags.infile
34
- let notes = context.flags.notes
35
- let category = context.flags.category
36
- let force = context.flags.bypass
32
+ const app = context.flags.app
33
+ const file = context.flags.infile
34
+ const notes = context.flags.notes
35
+ const category = context.flags.category
36
+ const force = context.flags.bypass
37
37
 
38
38
  if (app && file) {
39
39
  throw new Error('Either --app or --infile must be passed, but not both')
40
40
  }
41
41
 
42
42
  if (file) {
43
- let apps = await readlines(file)
44
- let response = await skynet.bulkSuspendAppOwner(apps.join(), notes, category)
43
+ const apps = await readlines(file)
44
+ const response = await skynet.bulkSuspendAppOwner(apps.join(), notes, category)
45
45
  cli.log(response)
46
46
  } else {
47
47
  if (!app) {
@@ -1,7 +1,7 @@
1
- let cli = require('heroku-cli-util')
2
- let command = require('../../lib/command')
3
- let sudo = require('../../lib/sudo')
4
- let SkynetAPI = require('../../lib/skynet')
1
+ const cli = require('heroku-cli-util')
2
+ const command = require('../../lib/command')
3
+ const sudo = require('../../lib/sudo')
4
+ const SkynetAPI = require('../../lib/skynet')
5
5
 
6
6
  async function run (context) {
7
7
  sudo()
@@ -1,14 +1,14 @@
1
- let cli = require('heroku-cli-util')
2
- let command = require('../../lib/command')
3
- let sudo = require('../../lib/sudo')
4
- let SkynetAPI = require('../../lib/skynet')
1
+ const cli = require('heroku-cli-util')
2
+ const command = require('../../lib/command')
3
+ const sudo = require('../../lib/sudo')
4
+ const SkynetAPI = require('../../lib/skynet')
5
5
 
6
6
  function readlines (file) {
7
7
  return new Promise(function (resolve, reject) {
8
- let split = require('split')
9
- let fs = require('fs')
8
+ const split = require('split')
9
+ const fs = require('fs')
10
10
 
11
- let users = []
11
+ const users = []
12
12
 
13
13
  fs.createReadStream(file).pipe(split())
14
14
  .on('data', function (line) {
@@ -29,20 +29,20 @@ function readlines (file) {
29
29
  async function run (context) {
30
30
  sudo()
31
31
  const skynet = new SkynetAPI(context.auth.password)
32
- let user = context.flags.user || process.env.HEROKU_USER
33
- let file = context.flags.infile
34
- let notes = context.flags.notes
35
- let category = context.flags.category
36
- let force = context.flags.bypass
37
- let notify = !context.flags['no-notify']
32
+ const user = context.flags.user || process.env.HEROKU_USER
33
+ const file = context.flags.infile
34
+ const notes = context.flags.notes
35
+ const category = context.flags.category
36
+ const force = context.flags.bypass
37
+ const notify = !context.flags['no-notify']
38
38
 
39
39
  if (user && file) {
40
40
  throw new Error('Either --user USER or --infile must be passed, but not both')
41
41
  }
42
42
 
43
43
  if (file) {
44
- let users = await readlines(file)
45
- let response = await skynet.bulkSuspendUsers(users.join(), notes, category, notify, force)
44
+ const users = await readlines(file)
45
+ const response = await skynet.bulkSuspendUsers(users.join(), notes, category, notify, force)
46
46
  cli.log(response)
47
47
  } else {
48
48
  if (!user) {
@@ -1,14 +1,14 @@
1
- let cli = require('heroku-cli-util')
2
- let command = require('../../lib/command')
3
- let sudo = require('../../lib/sudo')
4
- let SkynetAPI = require('../../lib/skynet')
1
+ const cli = require('heroku-cli-util')
2
+ const command = require('../../lib/command')
3
+ const sudo = require('../../lib/sudo')
4
+ const SkynetAPI = require('../../lib/skynet')
5
5
 
6
6
  async function run (context) {
7
7
  sudo()
8
8
  const skynet = new SkynetAPI(context.auth.password)
9
- let app = context.flags.app
10
- let category = context.flags.category
11
- let notes = context.flags.notes
9
+ const app = context.flags.app
10
+ const category = context.flags.category
11
+ const notes = context.flags.notes
12
12
 
13
13
  if (!app) {
14
14
  throw new Error('Required flag: --app APP')
@@ -26,8 +26,8 @@ module.exports = {
26
26
  $ heroku skynet:unsuspend:app -a test-app -n "helpful unsuspend message" -c "ddos"`,
27
27
  flags: [
28
28
  { name: 'app', char: 'a', description: 'app to unsuspend', hasValue: true, required: true },
29
- { name: 'category', char: 'c', description: 'unsuspension category', hasValue: true, required: false },
30
- { name: 'notes', char: 'n', description: 'unsuspend notes', hasValue: true, required: false }
29
+ { name: 'category', char: 'c', description: 'unsuspension category', hasValue: true, required: true },
30
+ { name: 'notes', char: 'n', description: 'unsuspend notes', hasValue: true, required: true }
31
31
  ],
32
32
  run: command(run)
33
33
  }
@@ -1,14 +1,14 @@
1
- let cli = require('heroku-cli-util')
2
- let command = require('../../lib/command')
3
- let sudo = require('../../lib/sudo')
4
- let SkynetAPI = require('../../lib/skynet')
1
+ const cli = require('heroku-cli-util')
2
+ const command = require('../../lib/command')
3
+ const sudo = require('../../lib/sudo')
4
+ const SkynetAPI = require('../../lib/skynet')
5
5
 
6
6
  async function run (context) {
7
7
  sudo()
8
8
  const skynet = new SkynetAPI(context.auth.password)
9
- let user = context.flags.user || process.env.HEROKU_USER
10
- let category = context.flags.category
11
- let notes = context.flags.notes
9
+ const user = context.flags.user || process.env.HEROKU_USER
10
+ const category = context.flags.category
11
+ const notes = context.flags.notes
12
12
 
13
13
  if (!user) {
14
14
  throw new Error('Required flag: --user USER')
@@ -26,8 +26,8 @@ module.exports = {
26
26
  $ heroku skynet:unsuspend:user -u foo@bar.com -n "helpful unsuspend message" -c "ddos"`,
27
27
  flags: [
28
28
  { name: 'user', char: 'u', description: 'user to unsuspend', hasValue: true },
29
- { name: 'category', char: 'c', description: 'unsuspension category', hasValue: true, required: false },
30
- { name: 'notes', char: 'n', description: 'unsuspend notes', hasValue: true, required: false }
29
+ { name: 'category', char: 'c', description: 'unsuspension category', hasValue: true, required: true },
30
+ { name: 'notes', char: 'n', description: 'unsuspend notes', hasValue: true, required: true }
31
31
  ],
32
32
  run: command(run)
33
33
  }
@@ -1,6 +1,6 @@
1
- let cli = require('heroku-cli-util')
2
- let command = require('../../lib/command')
3
- let SkynetAPI = require('../../lib/skynet')
1
+ const cli = require('heroku-cli-util')
2
+ const command = require('../../lib/command')
3
+ const SkynetAPI = require('../../lib/skynet')
4
4
 
5
5
  async function run (context) {
6
6
  const skynet = new SkynetAPI(context.auth.password)
@@ -1,6 +1,6 @@
1
- let cli = require('heroku-cli-util')
2
- let command = require('../../lib/command')
3
- let SkynetAPI = require('../../lib/skynet')
1
+ const cli = require('heroku-cli-util')
2
+ const command = require('../../lib/command')
3
+ const SkynetAPI = require('../../lib/skynet')
4
4
 
5
5
  async function run (context) {
6
6
  const skynet = new SkynetAPI(context.auth.password)
@@ -1,6 +1,6 @@
1
- let cli = require('heroku-cli-util')
2
- let command = require('../../lib/command')
3
- let SkynetAPI = require('../../lib/skynet')
1
+ const cli = require('heroku-cli-util')
2
+ const command = require('../../lib/command')
3
+ const SkynetAPI = require('../../lib/skynet')
4
4
 
5
5
  async function run (context) {
6
6
  const skynet = new SkynetAPI(context.auth.password)
@@ -1,6 +1,6 @@
1
- let cli = require('heroku-cli-util')
2
- let command = require('../../lib/command')
3
- let SkynetAPI = require('../../lib/skynet')
1
+ const cli = require('heroku-cli-util')
2
+ const command = require('../../lib/command')
3
+ const SkynetAPI = require('../../lib/skynet')
4
4
 
5
5
  async function run (context) {
6
6
  const skynet = new SkynetAPI(context.auth.password)
package/lib/command.js CHANGED
@@ -1,4 +1,4 @@
1
- let cli = require('heroku-cli-util')
1
+ const cli = require('heroku-cli-util')
2
2
 
3
3
  module.exports = fn =>
4
4
  cli.command((context, client) =>
package/lib/skynet.js CHANGED
@@ -24,7 +24,7 @@ module.exports = class SkynetAPI {
24
24
  }
25
25
 
26
26
  categories () {
27
- return this.request(`/categories`, {
27
+ return this.request('/categories', {
28
28
  method: 'GET'
29
29
  })
30
30
  }
@@ -35,7 +35,7 @@ module.exports = class SkynetAPI {
35
35
  notes: notes
36
36
  }
37
37
 
38
- return this.request(`/whitelist`, {
38
+ return this.request('/whitelist', {
39
39
  method: 'POST',
40
40
  body: body,
41
41
  form: true
@@ -56,7 +56,7 @@ module.exports = class SkynetAPI {
56
56
  flag: flag
57
57
  }
58
58
 
59
- return this.request(`/userpass/remove`, {
59
+ return this.request('/userpass/remove', {
60
60
  method: 'POST',
61
61
  body: body,
62
62
  form: true
@@ -69,7 +69,7 @@ module.exports = class SkynetAPI {
69
69
  flag: flag
70
70
  }
71
71
 
72
- return this.request(`/userpass/add`, {
72
+ return this.request('/userpass/add', {
73
73
  method: 'POST',
74
74
  body: body,
75
75
  form: true
@@ -126,7 +126,7 @@ module.exports = class SkynetAPI {
126
126
  notify: notify
127
127
  }
128
128
 
129
- return this.request(`/suspend/user`, {
129
+ return this.request('/suspend/user', {
130
130
  method: 'POST',
131
131
  body: body,
132
132
  form: true
@@ -152,7 +152,7 @@ module.exports = class SkynetAPI {
152
152
  notify: notify
153
153
  }
154
154
 
155
- return this.request(`/suspend/user`, {
155
+ return this.request('/suspend/user', {
156
156
  method: 'POST',
157
157
  body: body,
158
158
  form: true
@@ -168,7 +168,7 @@ module.exports = class SkynetAPI {
168
168
  bulk: 'true'
169
169
  }
170
170
 
171
- return this.request(`/suspend/app-owner`, {
171
+ return this.request('/suspend/app-owner', {
172
172
  method: 'POST',
173
173
  body: body,
174
174
  form: true
@@ -185,7 +185,7 @@ module.exports = class SkynetAPI {
185
185
  notify: notify
186
186
  }
187
187
 
188
- return this.request(`/deprovision`, {
188
+ return this.request('/deprovision', {
189
189
  method: 'POST',
190
190
  body: body,
191
191
  form: true
@@ -198,7 +198,7 @@ module.exports = class SkynetAPI {
198
198
  description: description
199
199
  }
200
200
 
201
- return this.request(`/categories`, {
201
+ return this.request('/categories', {
202
202
  method: 'POST',
203
203
  body: body,
204
204
  json: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heroku/skynet",
3
- "version": "1.6.12",
3
+ "version": "1.6.14",
4
4
  "description": "use Skynet from Heroku CLI",
5
5
  "main": "index.js",
6
6
  "author": "Bob Argenbright @byt3smith",
@@ -22,11 +22,13 @@
22
22
  "split": "^1.0.0"
23
23
  },
24
24
  "devDependencies": {
25
+ "acorn": ">=6.4.1",
26
+ "minimist": ">=1.2.2",
25
27
  "mocha": "^5.2.0",
26
28
  "mockdate": "^2.0.1",
27
- "nock": "~9.0.13",
29
+ "nock": "^12.0.3",
28
30
  "np": "^3.1.0",
29
- "standard": "^12.0.1",
31
+ "standard": "^14.3.3",
30
32
  "unexpected": "^10.29.0"
31
33
  },
32
34
  "scripts": {