@heroku/skynet 1.6.4 → 1.6.6
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/userpass/remove.js +1 -1
- package/commands/whitelist/add.js +1 -1
- package/lib/command.js +2 -3
- package/lib/skynet.js +13 -18
- package/package.json +3 -2
|
@@ -4,7 +4,7 @@ let SkynetAPI = require('../../lib/skynet')
|
|
|
4
4
|
|
|
5
5
|
async function run (context) {
|
|
6
6
|
const skynet = new SkynetAPI(context.auth.password)
|
|
7
|
-
await cli.action(`removing ${cli.color.cyan(context.flags.
|
|
7
|
+
await cli.action(`removing ${cli.color.cyan(context.flags.flag)} from ${cli.color.cyan(context.flags.user)}`, skynet.removeUserpass(context.flags.user, context.flags.flag))
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
package/lib/command.js
CHANGED
|
@@ -4,10 +4,9 @@ module.exports = fn =>
|
|
|
4
4
|
cli.command((context, client) =>
|
|
5
5
|
fn(context, client).catch(err => {
|
|
6
6
|
if (err.body) {
|
|
7
|
-
|
|
7
|
+
throw JSON.stringify(err.body)
|
|
8
8
|
} else {
|
|
9
|
-
|
|
9
|
+
throw err
|
|
10
10
|
}
|
|
11
|
-
throw err
|
|
12
11
|
})
|
|
13
12
|
)
|
package/lib/skynet.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
const qs = require('querystring')
|
|
1
|
+
const got = require('got')
|
|
3
2
|
let skynetHost = 'https://skynet.herokai.com'
|
|
4
3
|
|
|
5
4
|
if (process.env.SKYNET_HOST) {
|
|
@@ -21,11 +20,7 @@ module.exports = class SkynetAPI {
|
|
|
21
20
|
'User-Agent': this.version
|
|
22
21
|
})
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
options.headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return cli.got(SKYNET_BASE_URL + url, options).then(res => res.body)
|
|
23
|
+
return got(SKYNET_BASE_URL + url, options).then(res => res.body)
|
|
29
24
|
}
|
|
30
25
|
|
|
31
26
|
categories () {
|
|
@@ -42,7 +37,7 @@ module.exports = class SkynetAPI {
|
|
|
42
37
|
|
|
43
38
|
return this.request(`/whitelist`, {
|
|
44
39
|
method: 'POST',
|
|
45
|
-
body:
|
|
40
|
+
body: body,
|
|
46
41
|
form: true
|
|
47
42
|
})
|
|
48
43
|
}
|
|
@@ -61,7 +56,7 @@ module.exports = class SkynetAPI {
|
|
|
61
56
|
|
|
62
57
|
return this.request(`/userpass/remove`, {
|
|
63
58
|
method: 'POST',
|
|
64
|
-
body:
|
|
59
|
+
body: body,
|
|
65
60
|
form: true
|
|
66
61
|
})
|
|
67
62
|
}
|
|
@@ -74,7 +69,7 @@ module.exports = class SkynetAPI {
|
|
|
74
69
|
|
|
75
70
|
return this.request(`/userpass/add`, {
|
|
76
71
|
method: 'POST',
|
|
77
|
-
body:
|
|
72
|
+
body: body,
|
|
78
73
|
form: true
|
|
79
74
|
})
|
|
80
75
|
}
|
|
@@ -90,7 +85,7 @@ module.exports = class SkynetAPI {
|
|
|
90
85
|
|
|
91
86
|
return this.request('/suspend/app-owner', {
|
|
92
87
|
method: 'POST',
|
|
93
|
-
body:
|
|
88
|
+
body: body,
|
|
94
89
|
form: true
|
|
95
90
|
})
|
|
96
91
|
}
|
|
@@ -106,7 +101,7 @@ module.exports = class SkynetAPI {
|
|
|
106
101
|
|
|
107
102
|
return this.request('/suspend/app', {
|
|
108
103
|
method: 'POST',
|
|
109
|
-
body:
|
|
104
|
+
body: body,
|
|
110
105
|
form: true
|
|
111
106
|
})
|
|
112
107
|
}
|
|
@@ -129,7 +124,7 @@ module.exports = class SkynetAPI {
|
|
|
129
124
|
|
|
130
125
|
return this.request(`/suspend/user`, {
|
|
131
126
|
method: 'POST',
|
|
132
|
-
body:
|
|
127
|
+
body: body,
|
|
133
128
|
form: true
|
|
134
129
|
})
|
|
135
130
|
}
|
|
@@ -151,7 +146,7 @@ module.exports = class SkynetAPI {
|
|
|
151
146
|
|
|
152
147
|
return this.request(`/suspend/user`, {
|
|
153
148
|
method: 'POST',
|
|
154
|
-
body:
|
|
149
|
+
body: body,
|
|
155
150
|
form: true
|
|
156
151
|
})
|
|
157
152
|
}
|
|
@@ -167,7 +162,7 @@ module.exports = class SkynetAPI {
|
|
|
167
162
|
|
|
168
163
|
return this.request(`/suspend/app-owner`, {
|
|
169
164
|
method: 'POST',
|
|
170
|
-
body:
|
|
165
|
+
body: body,
|
|
171
166
|
form: true
|
|
172
167
|
})
|
|
173
168
|
}
|
|
@@ -183,7 +178,7 @@ module.exports = class SkynetAPI {
|
|
|
183
178
|
|
|
184
179
|
return this.request(`/deprovision`, {
|
|
185
180
|
method: 'POST',
|
|
186
|
-
body:
|
|
181
|
+
body: body,
|
|
187
182
|
form: true
|
|
188
183
|
})
|
|
189
184
|
}
|
|
@@ -199,7 +194,7 @@ module.exports = class SkynetAPI {
|
|
|
199
194
|
|
|
200
195
|
return this.request(`/deprovision`, {
|
|
201
196
|
method: 'POST',
|
|
202
|
-
body:
|
|
197
|
+
body: body,
|
|
203
198
|
form: true
|
|
204
199
|
})
|
|
205
200
|
}
|
|
@@ -212,7 +207,7 @@ module.exports = class SkynetAPI {
|
|
|
212
207
|
|
|
213
208
|
return this.request(`/categories`, {
|
|
214
209
|
method: 'POST',
|
|
215
|
-
body:
|
|
210
|
+
body: body,
|
|
216
211
|
json: true
|
|
217
212
|
})
|
|
218
213
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heroku/skynet",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "use Skynet from Heroku CLI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Bob Argenbright @byt3smith",
|
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
"/commands"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
+
"got": "^9.6.0",
|
|
20
21
|
"heroku-cli-util": "~6.2.12",
|
|
21
22
|
"split": "^1.0.0"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
|
-
"mocha": "^
|
|
25
|
+
"mocha": "^5.2.0",
|
|
25
26
|
"mockdate": "^2.0.1",
|
|
26
27
|
"nock": "~9.0.13",
|
|
27
28
|
"np": "^3.1.0",
|