@heroku/skynet 1.6.9 → 1.6.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.
@@ -6,8 +6,16 @@ let SkynetAPI = require('../../lib/skynet')
6
6
  async function run (context) {
7
7
  sudo()
8
8
  const skynet = new SkynetAPI(context.auth.password)
9
- const response = await cli.action(`unsuspending ${cli.color.cyan(context.flags.app)}`, skynet.unsuspendApp(context.flags.app))
10
- cli.log(`unsuspending...${cli.color.cyan(response.status)}.\n${response.message}`)
9
+ let app = context.flags.app
10
+ let category = context.flags.category
11
+ let notes = context.flags.notes
12
+
13
+ if (!app) {
14
+ throw new Error('Required flag: --app APP')
15
+ }
16
+
17
+ const response = await skynet.unsuspendApp(app, category, notes)
18
+ cli.log(`suspending...${cli.color.cyan(response.status)}.\n${response.message}`)
11
19
  }
12
20
 
13
21
  module.exports = {
@@ -15,9 +23,11 @@ module.exports = {
15
23
  command: 'unsuspend:app',
16
24
  description: '(requires sudo) unsuspends an app',
17
25
  help: `Examples:
18
- $ heroku skynet:unsuspend:app -a test-app`,
26
+ $ heroku skynet:unsuspend:app -a test-app -n "helpful unsuspend message" -c "ddos"`,
19
27
  flags: [
20
- { name: 'app', char: 'a', description: 'app to unsuspend', hasValue: true, required: true }
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 }
21
31
  ],
22
32
  run: command(run)
23
33
  }
@@ -7,7 +7,14 @@ async function run (context) {
7
7
  sudo()
8
8
  const skynet = new SkynetAPI(context.auth.password)
9
9
  let user = context.flags.user || process.env.HEROKU_USER
10
- const response = await cli.action(`unsuspending ${cli.color.cyan(user)}`, skynet.unsuspendUser(user))
10
+ let category = context.flags.category
11
+ let notes = context.flags.notes
12
+
13
+ if (!user) {
14
+ throw new Error('Required flag: --user USER')
15
+ }
16
+
17
+ const response = await cli.action(`unsuspending ${cli.color.cyan(user)}`, skynet.unsuspendUser(user, category, notes))
11
18
  cli.log(`${response.status}. ${response.message}`)
12
19
  }
13
20
 
@@ -16,9 +23,11 @@ module.exports = {
16
23
  command: 'unsuspend:user',
17
24
  description: '(requires sudo) unsuspends a user',
18
25
  help: `Examples:
19
- $ heroku skynet:unsuspend:user -u foo@bar.com`,
26
+ $ heroku skynet:unsuspend:user -u foo@bar.com -n "helpful unsuspend message" -c "ddos"`,
20
27
  flags: [
21
- { name: 'user', char: 'u', description: 'user to unsuspend', hasValue: true }
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 }
22
31
  ],
23
32
  run: command(run)
24
33
  }
package/lib/skynet.js CHANGED
@@ -108,8 +108,8 @@ module.exports = class SkynetAPI {
108
108
  })
109
109
  }
110
110
 
111
- unsuspendApp (app) {
112
- return this.request(`/suspensions/app/${app}`, {
111
+ unsuspendApp (app, category, notes) {
112
+ return this.request(`/suspensions/app/${app}?category=${category}&reason=${notes}`, {
113
113
  method: 'DELETE',
114
114
  body: {},
115
115
  json: true
@@ -133,8 +133,8 @@ module.exports = class SkynetAPI {
133
133
  })
134
134
  }
135
135
 
136
- unsuspendUser (user) {
137
- return this.request(`/suspensions/user/${user}`, {
136
+ unsuspendUser (user, category, notes) {
137
+ return this.request(`/suspensions/user/${user}?category=${category}&reason=${notes}`, {
138
138
  method: 'DELETE',
139
139
  body: {},
140
140
  json: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heroku/skynet",
3
- "version": "1.6.9",
3
+ "version": "1.6.10",
4
4
  "description": "use Skynet from Heroku CLI",
5
5
  "main": "index.js",
6
6
  "author": "Bob Argenbright @byt3smith",