@heroku/skynet 1.12.0 → 1.13.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.
@@ -13,6 +13,7 @@ async function run (context) {
13
13
  const notes = context.flags.notes
14
14
  const category = context.flags.category
15
15
  const force = context.flags.bypass || process.env.HEROKU_FORCE === '1'
16
+ const deprovision = context.flags.deprovision
16
17
 
17
18
  if (app && file) {
18
19
  throw new Error('Either --app or --infile must be passed, but not both')
@@ -23,7 +24,7 @@ async function run (context) {
23
24
  const chunks = utils.arrayChunks(apps, chunkSize)
24
25
  for (const chunk of chunks) {
25
26
  cli.log('Suspending app owners: ' + chunk.join())
26
- const response = await skynet.bulkSuspendAppOwner(apps.join(), notes, category)
27
+ const response = await skynet.bulkSuspendAppOwner(apps.join(), notes, category, deprovision)
27
28
  cli.log(`${cli.color.cyan(response.status)}. ${response.message}`)
28
29
  cli.log()
29
30
  }
@@ -32,8 +33,8 @@ async function run (context) {
32
33
  throw new Error('Required flag: --owner OWNER or --infile FILE')
33
34
  }
34
35
 
35
- let response = await cli.action(`Deprovisioning app owner of ${cli.color.cyan(app)}`,
36
- skynet.suspendAppOwner(app, notes, category, force))
36
+ let response = await cli.action(`Suspending app owner of ${cli.color.cyan(app)}`,
37
+ skynet.suspendAppOwner(app, notes, category, force, deprovision))
37
38
  response = JSON.parse(response)
38
39
  cli.log(`${cli.color.cyan(response.status)}. ${response.message}`)
39
40
  }
@@ -50,7 +51,8 @@ module.exports = {
50
51
  { name: 'infile', char: 'i', description: 'file of apps that require owner suspension', hasValue: true },
51
52
  { name: 'category', char: 'c', description: 'suspension category', hasValue: true, required: true },
52
53
  { name: 'notes', char: 'n', description: 'suspend notes', hasValue: true, required: true },
53
- { name: 'bypass', description: 'force suspension, bypassing skynet safety checks', hasValue: false, required: false }
54
+ { name: 'bypass', description: 'force suspension, bypassing skynet safety checks', hasValue: false, required: false },
55
+ { name: 'deprovision', char: 'd', description: 'put user into the fast resource deletion flow', hasValue: false, required: false }
54
56
  ],
55
57
  run: command(run)
56
58
  }
@@ -22,6 +22,7 @@ async function run (context) {
22
22
  const category = context.flags.category
23
23
  const force = context.flags.bypass || process.env.HEROKU_FORCE === '1'
24
24
  const unverify = context.flags.unverify
25
+ const deprovision = context.flags.deprovision
25
26
 
26
27
  const notify = notifyOption.set(context.flags.notify, context.flags['no-notify'])
27
28
  const notificationStatus = (notify) ? 'enabled' : 'disabled'
@@ -35,7 +36,7 @@ async function run (context) {
35
36
  const chunks = utils.arrayChunks(users, chunkSize)
36
37
  for (const chunk of chunks) {
37
38
  cli.log('Suspending users: ' + chunk.join())
38
- const response = await skynet.bulkSuspendUsers(chunk.join(), notes, category, notify, force)
39
+ const response = await skynet.bulkSuspendUsers(chunk.join(), notes, category, notify, force, deprovision)
39
40
  cli.log(`${response}. Notification ${notificationStatus}`)
40
41
  cli.log()
41
42
  }
@@ -48,7 +49,7 @@ async function run (context) {
48
49
  throw new Error('Required flag: --user USER or --infile FILE')
49
50
  }
50
51
 
51
- let response = await skynet.suspendUser(user, notes, category, notify, force)
52
+ let response = await skynet.suspendUser(user, notes, category, notify, force, deprovision)
52
53
  response = JSON.parse(response)
53
54
  cli.log(`Suspending user ${user}...\n${response.status}. ${response.message}. Notification ${notificationStatus}`)
54
55
 
@@ -72,7 +73,8 @@ module.exports = {
72
73
  { name: 'bypass', description: 'force suspension, bypassing skynet safety checks', hasValue: false, required: false },
73
74
  { name: 'no-notify', description: 'skip user suspension email notification', hasValue: false, required: false },
74
75
  { name: 'notify', description: 'send user suspension email notification', hasValue: false, required: false },
75
- { name: 'unverify', description: 'unverifies a user account, removes all billing info', hasValue: false, required: false }
76
+ { name: 'unverify', description: 'unverifies a user account, removes all billing info', hasValue: false, required: false },
77
+ { name: 'deprovision', char: 'd', description: 'put user into the fast resource deletion flow', hasValue: false, required: false }
76
78
  ],
77
79
  run: command(run)
78
80
  }
package/lib/skynet.js CHANGED
@@ -98,13 +98,14 @@ module.exports = class SkynetAPI {
98
98
  })
99
99
  }
100
100
 
101
- suspendAppOwner (app, notes, category, force = false) {
101
+ suspendAppOwner (app, notes, category, force = false, deprovision = false) {
102
102
  const body = {
103
103
  value: app,
104
104
  reason: notes,
105
105
  method: 'skynet-cli',
106
106
  category: category,
107
- force: force
107
+ force: force,
108
+ deprovision: deprovision
108
109
  }
109
110
 
110
111
  return this.request('/suspend/app-owner', {
@@ -135,14 +136,15 @@ module.exports = class SkynetAPI {
135
136
  })
136
137
  }
137
138
 
138
- suspendUser (user, notes, category, notify, force = false) {
139
+ suspendUser (user, notes, category, notify, force = false, deprovision = false) {
139
140
  const body = {
140
141
  value: user,
141
142
  reason: notes,
142
143
  method: 'skynet-cli',
143
144
  category: category,
144
145
  force: force,
145
- notify: notify
146
+ notify: notify,
147
+ deprovision: deprovision
146
148
  }
147
149
 
148
150
  return this.request('/suspend/user', {
@@ -158,7 +160,7 @@ module.exports = class SkynetAPI {
158
160
  })
159
161
  }
160
162
 
161
- bulkSuspendUsers (users, notes, category, notify, force = false) {
163
+ bulkSuspendUsers (users, notes, category, notify, force = false, deprovision = false) {
162
164
  const body = {
163
165
  value: users,
164
166
  reason: notes,
@@ -166,7 +168,8 @@ module.exports = class SkynetAPI {
166
168
  category: category,
167
169
  bulk: 'true',
168
170
  force: force,
169
- notify: notify
171
+ notify: notify,
172
+ deprovision: deprovision
170
173
  }
171
174
 
172
175
  return this.request('/suspend/user', {
@@ -175,13 +178,14 @@ module.exports = class SkynetAPI {
175
178
  })
176
179
  }
177
180
 
178
- bulkSuspendAppOwner (apps, notes, category) {
181
+ bulkSuspendAppOwner (apps, notes, category, deprovision = false) {
179
182
  const body = {
180
183
  value: apps,
181
184
  reason: notes,
182
185
  method: 'skynet-cli',
183
186
  category: category,
184
- bulk: 'true'
187
+ bulk: 'true',
188
+ deprovision: deprovision
185
189
  }
186
190
 
187
191
  return this.request('/suspend/app-owner', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heroku/skynet",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "use Skynet from Heroku CLI",
5
5
  "main": "index.js",
6
6
  "author": "Bob Argenbright @byt3smith",