@heroku/skynet 1.4.2 → 1.4.3
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/commands/suspend/user.js +4 -2
- package/lib/skynet.js +4 -2
- package/package.json +1 -1
package/commands/suspend/user.js
CHANGED
|
@@ -34,6 +34,7 @@ function * run (context) {
|
|
|
34
34
|
let notes = context.flags.notes
|
|
35
35
|
let category = context.flags.category
|
|
36
36
|
let force = context.flags.bypass
|
|
37
|
+
let notify = !context.flags['no-notify']
|
|
37
38
|
|
|
38
39
|
if (user && file) {
|
|
39
40
|
throw new Error('Either --user USER or --infile must be passed, but not both')
|
|
@@ -47,7 +48,7 @@ function * run (context) {
|
|
|
47
48
|
throw new Error('Required flag: --user USER or --infile FILE')
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
let response = yield cli.action(`suspending ${cli.color.cyan(user)}`, skynet.suspendUser(user, notes, category, force))
|
|
51
|
+
let response = yield cli.action(`suspending ${cli.color.cyan(user)}`, skynet.suspendUser(user, notes, category, notify, force))
|
|
51
52
|
response = JSON.parse(response)
|
|
52
53
|
cli.log(`${response.status}. ${response.message}`)
|
|
53
54
|
}
|
|
@@ -64,7 +65,8 @@ module.exports = {
|
|
|
64
65
|
{name: 'infile', char: 'i', description: 'file of users to suspend', hasValue: true},
|
|
65
66
|
{name: 'category', char: 'c', description: 'suspension category', hasValue: true, required: true},
|
|
66
67
|
{name: 'notes', char: 'n', description: 'suspend notes', hasValue: true, required: true},
|
|
67
|
-
{name: 'bypass', description: 'bypass the whitelist', hasValue: false, required: false}
|
|
68
|
+
{name: 'bypass', description: 'bypass the whitelist', hasValue: false, required: false},
|
|
69
|
+
{name: 'no-notify', description: 'skip user suspension email notification', hasValue: false, required: false}
|
|
68
70
|
],
|
|
69
71
|
run: cli.command(co.wrap(run))
|
|
70
72
|
}
|
package/lib/skynet.js
CHANGED
|
@@ -88,13 +88,15 @@ module.exports = class SkynetAPI {
|
|
|
88
88
|
method: 'DELETE'
|
|
89
89
|
})
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
|
|
92
|
+
suspendUser (user, notes, category, notify, force = false) {
|
|
92
93
|
var body = {
|
|
93
94
|
value: user,
|
|
94
95
|
reason: notes,
|
|
95
96
|
method: 'skynet-cli',
|
|
96
97
|
category: category,
|
|
97
|
-
force: force
|
|
98
|
+
force: force,
|
|
99
|
+
notify: notify
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
return this.request(`/suspend/user`, {
|