@heroku/skynet 1.9.3 → 1.9.4
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/deprovision.js +2 -2
- package/commands/suspend/app-owner.js +5 -4
- package/commands/suspend/apps.js +1 -1
- package/commands/suspend/user.js +3 -3
- package/commands/unsuspend/apps.js +1 -1
- package/commands/unsuspend/user.js +2 -2
- package/lib/skynet.js +9 -9
- package/lib/utils.js +2 -2
- package/package.json +6 -6
package/commands/deprovision.js
CHANGED
|
@@ -19,9 +19,9 @@ async function run (context) {
|
|
|
19
19
|
throw new Error('Required flag: --user USER')
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
let response = await cli.action(`
|
|
22
|
+
let response = await cli.action(`Deprovisioning ${cli.color.cyan(user)}`, skynet.deprovision(user, notes, category, notify, force))
|
|
23
23
|
response = JSON.parse(response)
|
|
24
|
-
cli.log(`${response.status}. ${response.message}. Notification ${notificationStatus}`)
|
|
24
|
+
cli.log(`${cli.color.cyan(response.status)}. ${response.message}. Notification ${notificationStatus}`)
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
module.exports = {
|
|
@@ -22,9 +22,9 @@ async function run (context) {
|
|
|
22
22
|
const apps = await utils.readlines(file)
|
|
23
23
|
const chunks = utils.arrayChunks(apps, chunkSize)
|
|
24
24
|
for (const chunk of chunks) {
|
|
25
|
-
cli.log('
|
|
25
|
+
cli.log('Suspending app owners: ' + chunk.join())
|
|
26
26
|
const response = await skynet.bulkSuspendAppOwner(apps.join(), notes, category)
|
|
27
|
-
cli.log(response)
|
|
27
|
+
cli.log(`${cli.color.cyan(response.status)}. ${response.message}`)
|
|
28
28
|
cli.log()
|
|
29
29
|
}
|
|
30
30
|
} else {
|
|
@@ -32,9 +32,10 @@ async function run (context) {
|
|
|
32
32
|
throw new Error('Required flag: --owner OWNER or --infile FILE')
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
let response = await
|
|
35
|
+
let response = await cli.action(`Deprovisioning app owner of ${cli.color.cyan(app)}`,
|
|
36
|
+
skynet.suspendAppOwner(app, notes, category, force))
|
|
36
37
|
response = JSON.parse(response)
|
|
37
|
-
cli.log(`${response.status}. ${response.message}`)
|
|
38
|
+
cli.log(`${cli.color.cyan(response.status)}. ${response.message}`)
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
|
package/commands/suspend/apps.js
CHANGED
|
@@ -14,7 +14,7 @@ async function run (context) {
|
|
|
14
14
|
)
|
|
15
15
|
response = JSON.parse(response)
|
|
16
16
|
cli.log(
|
|
17
|
-
`
|
|
17
|
+
`Suspending app ${context.flags.app}...\n${cli.color.cyan(response.status)}. ${response.message}`
|
|
18
18
|
)
|
|
19
19
|
}
|
|
20
20
|
|
package/commands/suspend/user.js
CHANGED
|
@@ -34,9 +34,9 @@ async function run (context) {
|
|
|
34
34
|
const users = await utils.readlines(file)
|
|
35
35
|
const chunks = utils.arrayChunks(users, chunkSize)
|
|
36
36
|
for (const chunk of chunks) {
|
|
37
|
-
cli.log('
|
|
37
|
+
cli.log('Suspending users: ' + chunk.join())
|
|
38
38
|
const response = await skynet.bulkSuspendUsers(chunk.join(), notes, category, notify, force)
|
|
39
|
-
cli.log(`${response}. Notification ${notificationStatus}`)
|
|
39
|
+
cli.log(`${cli.color.cyan(response.status)}. ${response.message}. Notification ${notificationStatus}`)
|
|
40
40
|
cli.log()
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -50,7 +50,7 @@ async function run (context) {
|
|
|
50
50
|
|
|
51
51
|
let response = await skynet.suspendUser(user, notes, category, notify, force)
|
|
52
52
|
response = JSON.parse(response)
|
|
53
|
-
cli.log(
|
|
53
|
+
cli.log(`Suspending user ${user}...\n${response.status}. ${response.message}. Notification ${notificationStatus}`)
|
|
54
54
|
|
|
55
55
|
if (unverify) {
|
|
56
56
|
unverifyUser(api, user)
|
|
@@ -15,7 +15,7 @@ async function run (context) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const response = await skynet.unsuspendApp(app, category, notes)
|
|
18
|
-
cli.log(`
|
|
18
|
+
cli.log(`Unsuspending app ${app}...\n${cli.color.cyan(response.status)}. ${response.message}`)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
module.exports = {
|
|
@@ -14,8 +14,8 @@ async function run (context) {
|
|
|
14
14
|
throw new Error('Required flag: --user USER')
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const response = await cli.action(`
|
|
18
|
-
cli.log(`${response.status}. ${response.message}`)
|
|
17
|
+
const response = await cli.action(`Unsuspending ${cli.color.cyan(user)}`, skynet.unsuspendUser(user, category, notes))
|
|
18
|
+
cli.log(`${cli.color.cyan(response.status)}. ${response.message}`)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
module.exports = {
|
package/lib/skynet.js
CHANGED
|
@@ -39,7 +39,7 @@ module.exports = class SkynetAPI {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
addWhitelist (appOrUserEmail, notes) {
|
|
42
|
-
|
|
42
|
+
const body = {
|
|
43
43
|
value: appOrUserEmail,
|
|
44
44
|
notes: notes
|
|
45
45
|
}
|
|
@@ -60,7 +60,7 @@ module.exports = class SkynetAPI {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
removeUserpass (user, flag) {
|
|
63
|
-
|
|
63
|
+
const body = {
|
|
64
64
|
user: user,
|
|
65
65
|
flag: flag
|
|
66
66
|
}
|
|
@@ -73,7 +73,7 @@ module.exports = class SkynetAPI {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
addUserpass (user, flag) {
|
|
76
|
-
|
|
76
|
+
const body = {
|
|
77
77
|
user: user,
|
|
78
78
|
flag: flag
|
|
79
79
|
}
|
|
@@ -86,7 +86,7 @@ module.exports = class SkynetAPI {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
suspendAppOwner (app, notes, category, force = false) {
|
|
89
|
-
|
|
89
|
+
const body = {
|
|
90
90
|
value: app,
|
|
91
91
|
reason: notes,
|
|
92
92
|
method: 'skynet-cli',
|
|
@@ -102,7 +102,7 @@ module.exports = class SkynetAPI {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
suspendApp (app, notes, category, force = false) {
|
|
105
|
-
|
|
105
|
+
const body = {
|
|
106
106
|
value: app,
|
|
107
107
|
reason: notes,
|
|
108
108
|
category: category,
|
|
@@ -126,7 +126,7 @@ module.exports = class SkynetAPI {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
suspendUser (user, notes, category, notify, force = false) {
|
|
129
|
-
|
|
129
|
+
const body = {
|
|
130
130
|
value: user,
|
|
131
131
|
reason: notes,
|
|
132
132
|
method: 'skynet-cli',
|
|
@@ -151,7 +151,7 @@ module.exports = class SkynetAPI {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
bulkSuspendUsers (users, notes, category, notify, force = false) {
|
|
154
|
-
|
|
154
|
+
const body = {
|
|
155
155
|
value: users,
|
|
156
156
|
reason: notes,
|
|
157
157
|
method: 'skynet-cli',
|
|
@@ -169,7 +169,7 @@ module.exports = class SkynetAPI {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
bulkSuspendAppOwner (apps, notes, category) {
|
|
172
|
-
|
|
172
|
+
const body = {
|
|
173
173
|
value: apps,
|
|
174
174
|
reason: notes,
|
|
175
175
|
method: 'skynet-cli',
|
|
@@ -185,7 +185,7 @@ module.exports = class SkynetAPI {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
deprovision (user, notes, category, notify = true, force = false) {
|
|
188
|
-
|
|
188
|
+
const body = {
|
|
189
189
|
value: user,
|
|
190
190
|
reason: notes,
|
|
191
191
|
method: 'skynet-cli',
|
package/lib/utils.js
CHANGED
|
@@ -22,11 +22,11 @@ exports.readlines = function (file) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
exports.arrayChunks = function (array, chunkSize) {
|
|
25
|
-
|
|
25
|
+
const chunks = []
|
|
26
26
|
if (array.length <= chunkSize) {
|
|
27
27
|
chunks.push(array)
|
|
28
28
|
} else {
|
|
29
|
-
for (
|
|
29
|
+
for (let i = 0; i < array.length; i += chunkSize) {
|
|
30
30
|
chunks.push(array.slice(i, i + chunkSize))
|
|
31
31
|
}
|
|
32
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heroku/skynet",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.4",
|
|
4
4
|
"description": "use Skynet from Heroku CLI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Bob Argenbright @byt3smith",
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"got": "^9.6.0",
|
|
21
|
-
"heroku-cli-util": "
|
|
21
|
+
"heroku-cli-util": "^6.2.8",
|
|
22
22
|
"split": "^1.0.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"acorn": "^6.4.1",
|
|
26
26
|
"minimist": ">=1.2.2",
|
|
27
|
-
"mocha": "^
|
|
27
|
+
"mocha": "^9.1.2",
|
|
28
28
|
"mockdate": "^2.0.1",
|
|
29
29
|
"nock": "^12.0.3",
|
|
30
|
-
"np": "^
|
|
31
|
-
"standard": "^
|
|
32
|
-
"unexpected": "^
|
|
30
|
+
"np": "^7.5.0",
|
|
31
|
+
"standard": "^16.0.4",
|
|
32
|
+
"unexpected": "^12.0.3"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"test": "mocha && standard",
|