@heroku/skynet 1.5.0 → 1.6.1

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/README.md CHANGED
@@ -14,63 +14,15 @@ heroku plugins:install heroku-skynet-cli
14
14
  - Link the plugin with `heroku plugins:link .`
15
15
 
16
16
  ### Publishing to `npm`
17
- 1. Contact `heroku-cli@salesforce.com` to get credentials to Heroku's private NPM registry
17
+ 1. Send an email to `heroku-help@salesforce.com` requesting access to @heroku on npm. Include your npm username (https://www.npmjs.com/)
18
18
 
19
- 2. Make sure you have `np` installed. Install by running `npm install np`
19
+ 1. Install by running `npm install np`
20
20
 
21
- 3. When you are ready to publish what you have locally, run `np` and you will see an output like this:
22
- ```
23
- λ bargenbright[heroku-skynet-cli/] (git:master)~$ np
24
-
25
- Publish a new version of heroku-skynet-cli (current: 1.3.5)
26
-
27
- ? Select semver increment or specify new version minor 1.4.0
28
-
29
- Commits:
30
- - Merge pull request #28 from heroku/refactor+appowner f2c5655
31
- - add app-owner command b07940b
32
- - adds app-owner command and refactors e914b09
21
+ 1. Publish the package:
33
22
 
34
- ? Will bump from 1.3.5 to 1.4.0. Continue? Yes
35
- Prerequisite check
36
- Git
37
- Cleanup
38
- Installing dependencies using Yarn
39
- Running tests
40
- ✔ Bumping version using Yarn
41
- ✖ Publishing package using Yarn
42
- → info Visit https://yarnpkg.com/en/docs/cli/publish for documentation about this command.
43
- Pushing tags
44
-
45
- ✖ Error: Command failed: yarn publish --new-version 1.4.0
46
- warning package.json: No license field
47
- warning package.json: No license field
48
- error An unexpected error occurred: "No token found and can't prompt for login when running with --non-interactive.".
49
- ```
50
-
51
- 4. After you get the `np` error, run `npm publish` to finish pushing the new release.
52
- ```
53
- λ bargenbright[heroku-skynet-cli/] (git:master)~$ npm publish
54
- + heroku-skynet-cli@1.4.0
55
- ```
56
-
57
- 5. Then, push the tags to the git repository
58
- ```
59
- λ bargenbright[heroku-skynet-cli/] (git:master)~$ git push origin --tags
60
- Counting objects: 4, done.
61
- Delta compression using up to 8 threads.
62
- Compressing objects: 100% (4/4), done.
63
- Writing objects: 100% (4/4), 416 bytes | 416.00 KiB/s, done.
64
- Total 4 (delta 2), reused 0 (delta 0)
65
- remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
66
- To github.com:heroku/heroku-skynet-cli.git
67
- * [new tag] v1.4.0 -> v1.4.0
68
- ```
69
-
70
- 6. Finally, push the version change commit done by the `np` tool
71
- ```
72
- λ bargenbright[heroku-skynet-cli/] (git:master)~$ git push origin master
73
- Total 0 (delta 0), reused 0 (delta 0)
74
- To github.com:heroku/heroku-skynet-cli.git
75
- f2c5655..e8ad793 master -> master
76
- ```
23
+ 1. cd into the root of the plugin
24
+ 1. Run `np`
25
+ Note: You will get an error because np attempts to commit to master the
26
+ updated version in the package.json
27
+ Open a pr manually on a separate branch to resolve
28
+ 1. Merge the pr once approved
@@ -6,9 +6,16 @@ let SkynetAPI = require('../../lib/skynet')
6
6
  function * run (context) {
7
7
  sudo()
8
8
  const skynet = new SkynetAPI(context.auth.password)
9
- let response = yield skynet.suspendApp(context.flags.app, context.flags.notes)
9
+ let response = yield skynet.suspendApp(
10
+ context.flags.app,
11
+ context.flags.notes,
12
+ context.flags.category,
13
+ context.flags.bypass
14
+ )
10
15
  response = JSON.parse(response)
11
- cli.log(`suspending...${cli.color.cyan(response.status)}.\n${response.message}`)
16
+ cli.log(
17
+ `suspending...${cli.color.cyan(response.status)}.\n${response.message}`
18
+ )
12
19
  }
13
20
 
14
21
  module.exports = {
@@ -16,10 +23,35 @@ module.exports = {
16
23
  command: 'suspend:app',
17
24
  description: '(requires sudo) suspends an app',
18
25
  help: `Examples:
19
- $ heroku skynet:suspend:app -a test-app -n "helpful suspend message"`,
26
+ $ heroku skynet:suspend:app -a test-app -c "category" -n "helpful suspend message"`,
20
27
  flags: [
21
- { name: 'app', char: 'a', description: 'app to suspend', hasValue: true, required: true },
22
- { name: 'notes', char: 'n', description: 'suspend notes', hasValue: true, required: true }
28
+ {
29
+ name: 'app',
30
+ char: 'a',
31
+ description: 'app to suspend',
32
+ hasValue: true,
33
+ required: true
34
+ },
35
+ {
36
+ name: 'notes',
37
+ char: 'n',
38
+ description: 'suspend notes',
39
+ hasValue: true,
40
+ required: true
41
+ },
42
+ {
43
+ name: 'category',
44
+ char: 'c',
45
+ description: 'suspension category',
46
+ hasValue: true,
47
+ required: true
48
+ },
49
+ {
50
+ name: 'bypass',
51
+ description: 'force suspension',
52
+ hasValue: false,
53
+ required: false
54
+ }
23
55
  ],
24
56
  run: cli.command(co.wrap(run))
25
57
  }
package/lib/skynet.js CHANGED
@@ -1,6 +1,12 @@
1
1
  const cli = require('heroku-cli-util')
2
2
  const qs = require('querystring')
3
- const SKYNET_BASE_URL = 'https://skynet.herokai.com/api-h'
3
+ let skynetHost = 'https://skynet.herokai.com'
4
+
5
+ if (process.env.SKYNET_HOST) {
6
+ skynetHost = process.env.SKYNET_HOST
7
+ }
8
+
9
+ const SKYNET_BASE_URL = `${skynetHost}/api-h`
4
10
 
5
11
  module.exports = class SkynetAPI {
6
12
  constructor (token) {
@@ -87,12 +93,13 @@ module.exports = class SkynetAPI {
87
93
  })
88
94
  }
89
95
 
90
- suspendApp (app, notes, category) {
96
+ suspendApp (app, notes, category, force = false) {
91
97
  var body = {
92
98
  value: app,
93
99
  reason: notes,
94
- method: 'skynet-cli',
95
- category: category
100
+ category: category,
101
+ force: force,
102
+ method: 'skynet-cli'
96
103
  }
97
104
 
98
105
  return this.request('/suspend/app', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heroku/skynet",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
4
4
  "description": "use Skynet from Heroku CLI",
5
5
  "main": "index.js",
6
6
  "author": "Bob Argenbright @byt3smith",