heroku 11.0.0-alpha.12 → 11.0.0-alpha.13

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.
Files changed (48) hide show
  1. package/lib/commands/addons/index.d.ts +1 -1
  2. package/lib/commands/addons/index.js +4 -4
  3. package/lib/commands/pg/copy.d.ts +6 -6
  4. package/lib/commands/pg/copy.js +16 -16
  5. package/lib/commands/pg/credentials/url.js +3 -5
  6. package/lib/commands/pg/credentials.d.ts +7 -7
  7. package/lib/commands/pg/credentials.js +10 -10
  8. package/lib/commands/webhooks/add.d.ts +16 -0
  9. package/lib/commands/webhooks/add.js +43 -0
  10. package/lib/commands/webhooks/deliveries/index.d.ts +12 -0
  11. package/lib/commands/webhooks/deliveries/index.js +75 -0
  12. package/lib/commands/webhooks/deliveries/info.d.ts +14 -0
  13. package/lib/commands/webhooks/deliveries/info.js +40 -0
  14. package/lib/commands/webhooks/index.d.ts +11 -0
  15. package/lib/commands/webhooks/index.js +42 -0
  16. package/lib/commands/webhooks/info.d.ts +14 -0
  17. package/lib/commands/webhooks/info.js +29 -0
  18. package/lib/commands/webhooks/remove.d.ts +14 -0
  19. package/lib/commands/webhooks/remove.js +24 -0
  20. package/lib/commands/webhooks/update.d.ts +19 -0
  21. package/lib/commands/webhooks/update.js +36 -0
  22. package/lib/lib/addons/util.js +1 -2
  23. package/lib/lib/data/credentialUtils.js +1 -1
  24. package/lib/lib/data/types.d.ts +10 -6
  25. package/lib/lib/pg/types.d.ts +0 -18
  26. package/lib/lib/pg/util.d.ts +2 -2
  27. package/lib/lib/pg/util.js +5 -0
  28. package/lib/lib/run/dyno.d.ts +3 -11
  29. package/lib/lib/run/dyno.js +15 -18
  30. package/lib/lib/utils/multisort.d.ts +4 -7
  31. package/lib/lib/utils/multisort.js +8 -32
  32. package/npm-shrinkwrap.json +1 -1
  33. package/oclif.manifest.json +1468 -1005
  34. package/package.json +2 -2
  35. package/lib/oldCommands/webhooks/add.d.ts +0 -1
  36. package/lib/oldCommands/webhooks/add.js +0 -56
  37. package/lib/oldCommands/webhooks/deliveries/index.d.ts +0 -1
  38. package/lib/oldCommands/webhooks/deliveries/index.js +0 -90
  39. package/lib/oldCommands/webhooks/deliveries/info.d.ts +0 -1
  40. package/lib/oldCommands/webhooks/deliveries/info.js +0 -54
  41. package/lib/oldCommands/webhooks/index.d.ts +0 -1
  42. package/lib/oldCommands/webhooks/index.js +0 -55
  43. package/lib/oldCommands/webhooks/info.d.ts +0 -1
  44. package/lib/oldCommands/webhooks/info.js +0 -41
  45. package/lib/oldCommands/webhooks/remove.d.ts +0 -1
  46. package/lib/oldCommands/webhooks/remove.js +0 -37
  47. package/lib/oldCommands/webhooks/update.d.ts +0 -1
  48. package/lib/oldCommands/webhooks/update.js +0 -50
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "heroku",
3
3
  "description": "CLI to interact with Heroku",
4
- "version": "11.0.0-alpha.12",
4
+ "version": "11.0.0-alpha.13",
5
5
  "author": "Heroku",
6
6
  "bin": "./bin/run",
7
7
  "bugs": "https://github.com/heroku/cli/issues",
@@ -176,5 +176,5 @@
176
176
  },
177
177
  "type": "module",
178
178
  "types": "lib/index.d.ts",
179
- "gitHead": "6f614d9ad1ea697838cf50c2f69530aad21bc2f2"
179
+ "gitHead": "3b90af5356f2d491baf3c8e4b51c6b8eeb5a222c"
180
180
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1,56 +0,0 @@
1
- export {};
2
- /*
3
- import {flags} from '@heroku-cli/command'
4
- import {ux} from '@oclif/core'
5
- import {hux} from '@heroku/heroku-cli-util'
6
- import Spinner from '@oclif/core/lib/cli-ux/action/spinner'
7
-
8
- import BaseCommand from '../../lib/webhooks/base'
9
-
10
- export default class WebhooksAdd extends BaseCommand {
11
- static description = 'add a webhook to an app'
12
-
13
- static examples = [
14
- '$ heroku webhooks:add -i api:dyno -l notify -u https://example.com/hooks',
15
- ]
16
-
17
- static flags = {
18
- app: flags.app(),
19
- remote: flags.remote(),
20
- pipeline: flags.pipeline({char: 'p', description: 'pipeline on which to list', hidden: true}),
21
- include: flags.string({char: 'i', description: 'comma delimited event types your server will receive ', required: true}),
22
- level: flags.string({char: 'l', description: 'notify does not retry, sync will retry until successful or timeout', required: true}),
23
- secret: flags.string({char: 's', description: 'value to sign delivery with in Heroku-Webhook-Hmac-SHA256 header'}),
24
- authorization: flags.string({char: 't', description: 'authorization header to send with webhooks'}),
25
- url: flags.string({char: 'u', description: 'URL for receiver', required: true}),
26
- }
27
-
28
- async run() {
29
- const {flags} = await this.parse(WebhooksAdd)
30
- const {path, display} = this.webhookType(flags)
31
- const action = new Spinner()
32
-
33
- action.start(`Adding webhook to ${display}`)
34
-
35
- const response = await this.webhooksClient.post(`${path}/webhooks`, {
36
- body: {
37
- include: flags.include.split(',').map(s => s.trim()),
38
- level: flags.level,
39
- secret: flags.secret,
40
- url: flags.url,
41
- authorization: flags.authorization,
42
- },
43
- })
44
-
45
- const secret = response.headers && response.headers['heroku-webhook-secret'] as string
46
- if (secret) {
47
- hux.styledHeader('Webhooks Signing Secret')
48
- this.log(secret)
49
- } else {
50
- ux.warn('no secret found')
51
- }
52
-
53
- action.stop()
54
- }
55
- }
56
- */
@@ -1 +0,0 @@
1
- export {};
@@ -1,90 +0,0 @@
1
- export {};
2
- /*
3
- import {flags} from '@heroku-cli/command'
4
- import {hux} from '@heroku/heroku-cli-util'
5
-
6
- import BaseCommand from '../../../lib/webhooks/base'
7
-
8
- export default class Deliveries extends BaseCommand {
9
- static description = 'list webhook deliveries on an app'
10
-
11
- static examples = [
12
- '$ heroku webhooks:deliveries',
13
- ]
14
-
15
- static flags = {
16
- app: flags.app(),
17
- remote: flags.remote(),
18
- status: flags.string({char: 's', description: 'filter deliveries by status'}),
19
- pipeline: flags.pipeline({char: 'p', description: 'pipeline on which to list', hidden: true}),
20
- }
21
-
22
- async run() {
23
- const {flags} = await this.parse(Deliveries)
24
- const webhookType = this.webhookType(flags)
25
- let {path} = webhookType
26
- const {display} = webhookType
27
- const max = 1000
28
-
29
- path = `${path}/webhook-deliveries`
30
- if (flags.status) {
31
- path += `?eq[status]=${encodeURIComponent(flags.status)}`
32
- }
33
-
34
- const {body: deliveries}: { body: any[]} = await this.webhooksClient.get(path, {
35
- headers: {
36
- Range: `seq ..; order=desc,max=${max}`,
37
- },
38
- partial: true,
39
- })
40
-
41
- if (deliveries.length === 0) {
42
- this.log(`${display} has no deliveries`)
43
- } else {
44
- const code = (w: any) => {
45
- return (w.last_attempt && w.last_attempt.code && String(w.last_attempt.code)) || ''
46
- }
47
-
48
- deliveries.reverse()
49
-
50
- if (deliveries.length === max) {
51
- this.warn(`Only showing the ${max} most recent deliveries`)
52
- this.warn('It is possible to filter deliveries by using the --status flag')
53
- }
54
-
55
- const printLine: typeof this.log = (...args) => this.log(...args)
56
- hux.table(deliveries, {
57
- id: {
58
- header: 'Delivery ID',
59
- },
60
- created_at: {
61
- header: 'Created', get: (w: any) => w.created_at,
62
- },
63
- status: {
64
- get: (w: any) => w.status,
65
- },
66
- include: {
67
- get: (w: any) => w.event.include,
68
- },
69
- level: {
70
- get: (w: any) => w.webhook.level,
71
- },
72
- num_attempts: {
73
- header: 'Attempts', get: (w: any) => String(w.num_attempts),
74
- },
75
- last_code: {
76
- header: 'Code', get: code,
77
- },
78
- last_error: {
79
- header: 'Error', get: (w: any) => (w.last_attempt && w.last_attempt.error_class) || '',
80
- },
81
- next_attempt_at: {
82
- header: 'Next Attempt', get: (w: any) => w.next_attempt_at || '',
83
- },
84
- }, {
85
- 'no-header': false, printLine,
86
- })
87
- }
88
- }
89
- }
90
- */
@@ -1 +0,0 @@
1
- export {};
@@ -1,54 +0,0 @@
1
- export {};
2
- /*
3
- import {flags} from '@heroku-cli/command'
4
- import {Args} from '@oclif/core'
5
- import {hux} from '@heroku/heroku-cli-util'
6
-
7
- import BaseCommand from '../../../lib/webhooks/base'
8
-
9
- export default class DeliveriesInfo extends BaseCommand {
10
- static description = 'info for a webhook event on an app'
11
-
12
- static examples = [
13
- '$ heroku webhooks:deliveries:info 99999999-9999-9999-9999-999999999999',
14
- ]
15
-
16
- static flags = {
17
- app: flags.app(),
18
- remote: flags.remote(),
19
- pipeline: flags.pipeline({char: 'p', description: 'pipeline on which to list', hidden: true}),
20
- }
21
-
22
- static args = {
23
- id: Args.string({required: true, description: 'ID of the webhook event'}),
24
- }
25
-
26
- async run() {
27
- const {flags, args} = await this.parse(DeliveriesInfo)
28
- const {path} = this.webhookType(flags)
29
-
30
- const {body: delivery}: {body: any} = await this.webhooksClient.get(`${path}/webhook-deliveries/${args.id}`)
31
-
32
- const {body: event}: {body: any} = await this.webhooksClient.get(`${path}/webhook-events/${delivery.event.id}`)
33
-
34
- const obj = {
35
- Created: delivery.created_at,
36
- Event: delivery.event.id,
37
- Webhook: delivery.webhook.id,
38
- Status: delivery.status,
39
- Include: delivery.event.include,
40
- Level: delivery.webhook.level,
41
- Attempts: delivery.num_attempts,
42
- Code: delivery.last_attempt && delivery.last_attempt.code,
43
- Error: delivery.last_attempt && delivery.last_attempt.error_class,
44
- 'Next Attempt': delivery.next_attempt_at,
45
- }
46
-
47
- hux.styledHeader(delivery.id)
48
- hux.styledObject(obj)
49
-
50
- hux.styledHeader('Event Payload')
51
- hux.styledJSON(event.payload)
52
- }
53
- }
54
- */
@@ -1 +0,0 @@
1
- export {};
@@ -1,55 +0,0 @@
1
- export {};
2
- /*
3
- import color from '@heroku-cli/color'
4
- import {flags} from '@heroku-cli/command'
5
- import {hux} from '@heroku/heroku-cli-util'
6
-
7
- import BaseCommand from '../../lib/webhooks/base'
8
-
9
- export default class Webhooks extends BaseCommand {
10
- static description = 'list webhooks on an app'
11
-
12
- static examples = ['$ heroku webhooks']
13
-
14
- static flags = {
15
- app: flags.app(),
16
- remote: flags.remote(),
17
- pipeline: flags.pipeline({
18
- char: 'p',
19
- description:
20
- 'pipeline on which to list',
21
- hidden: true,
22
- }),
23
- }
24
-
25
- async run() {
26
- const {flags} = await this.parse(Webhooks)
27
- const {path, display} = this.webhookType(flags)
28
-
29
- const {body: webhooks}: {body: any} = await this.webhooksClient.get(`${path}/webhooks`)
30
-
31
- if (webhooks.length === 0) {
32
- this.log(`${display} has no webhooks\nUse ${color.cmd('heroku webhooks:add')} to add one.`)
33
- return
34
- }
35
-
36
- webhooks.sort((a: any, b: any) => Date.parse(a.created_at) - Date.parse(b.created_at))
37
-
38
- const printLine: typeof this.log = (...args) => this.log(...args)
39
- hux.table(webhooks, {
40
- id: {
41
- header: 'Webhook ID',
42
- },
43
- url: {
44
- header: 'URL',
45
- },
46
- include: {
47
- get: (row: any) => row.include.join(','),
48
- },
49
- level: {},
50
- }, {
51
- 'no-header': false, printLine,
52
- })
53
- }
54
- }
55
- */
@@ -1 +0,0 @@
1
- export {};
@@ -1,41 +0,0 @@
1
- export {};
2
- /*
3
- import {flags} from '@heroku-cli/command'
4
- import {Args} from '@oclif/core'
5
- import {hux} from '@heroku/heroku-cli-util'
6
-
7
- import BaseCommand from '../../lib/webhooks/base'
8
-
9
- export default class WebhooksInfo extends BaseCommand {
10
- static description = 'info for a webhook on an app'
11
-
12
- static example = ['$ heroku webhooks:info 99999999-9999-9999-9999-999999999999']
13
-
14
- static flags = {
15
- app: flags.app(),
16
- remote: flags.remote(),
17
- pipeline: flags.pipeline({char: 'p', description: 'pipeline on which to list', hidden: true}),
18
- }
19
-
20
- static args = {
21
- id: Args.string({required: true, description: 'ID of the webhook'}),
22
- }
23
-
24
- async run() {
25
- const {flags, args} = await this.parse(WebhooksInfo)
26
- const {path} = this.webhookType(flags)
27
-
28
- const {body: webhook}: {body: any} = await this.webhooksClient.get(`${path}/webhooks/${args.id}`)
29
-
30
- const obj = {
31
- 'Webhook ID': webhook.id,
32
- URL: webhook.url,
33
- Include: webhook.include.join(','),
34
- Level: webhook.level,
35
- }
36
-
37
- hux.styledHeader(webhook.id)
38
- hux.styledObject(obj)
39
- }
40
- }
41
- */
@@ -1 +0,0 @@
1
- export {};
@@ -1,37 +0,0 @@
1
- export {};
2
- /*
3
- import {flags} from '@heroku-cli/command'
4
- import {Args} from '@oclif/core'
5
- import Spinner from '@oclif/core/lib/cli-ux/action/spinner'
6
-
7
- import BaseCommand from '../../lib/webhooks/base'
8
- export default class WebhooksRemove extends BaseCommand {
9
- static description = 'removes a webhook from an app'
10
-
11
- static examples = [
12
- '$ heroku webhooks:remove 99999999-9999-9999-9999-999999999999',
13
- ]
14
-
15
- static flags = {
16
- app: flags.app(),
17
- remote: flags.remote(),
18
- pipeline: flags.pipeline({char: 'p', description: 'pipeline on which to list', hidden: true}),
19
- }
20
-
21
- static args = {
22
- id: Args.string({description: 'id of webhook to remove', required: true}),
23
- }
24
-
25
- async run() {
26
- const {flags, args} = await this.parse(WebhooksRemove)
27
- const {path, display} = this.webhookType(flags)
28
- const action = new Spinner()
29
-
30
- action.start(`Removing webhook ${args.id} from ${display}`)
31
-
32
- await this.webhooksClient.delete(`${path}/webhooks/${args.id}`)
33
-
34
- action.stop()
35
- }
36
- }
37
- */
@@ -1 +0,0 @@
1
- export {};
@@ -1,50 +0,0 @@
1
- export {};
2
- /*
3
- import {flags} from '@heroku-cli/command'
4
- import {Args} from '@oclif/core'
5
- import Spinner from '@oclif/core/lib/cli-ux/action/spinner'
6
-
7
- import BaseCommand from '../../lib/webhooks/base'
8
-
9
- export default class WebhooksUpdate extends BaseCommand {
10
- static description = 'updates a webhook in an app'
11
-
12
- static examples = [
13
- '$ heroku webhooks:update 99999999-9999-9999-9999-999999999999 -i dyno -l notify -s 09928c40bf1b191b645174a19f7053d16a180da37332e719ef0998f4c0a2 -u https://example.com/hooks',
14
- ]
15
-
16
- static flags = {
17
- app: flags.app(),
18
- remote: flags.remote(),
19
- pipeline: flags.pipeline({char: 'p', description: 'pipeline on which to list', hidden: true}),
20
- include: flags.string({char: 'i', description: 'comma delimited event types your server will receive ', required: true}),
21
- level: flags.string({char: 'l', description: 'notify does not retry, sync will retry until successful or timeout', required: true}),
22
- secret: flags.string({char: 's', description: 'value to sign delivery with in Heroku-Webhook-Hmac-SHA256 header'}),
23
- authorization: flags.string({char: 't', description: 'authorization header to send with webhooks'}),
24
- url: flags.string({char: 'u', description: 'URL for receiver', required: true}),
25
- }
26
-
27
- static args = {
28
- id: Args.string({required: true, description: 'ID of the webhook'}),
29
- }
30
-
31
- async run() {
32
- const {flags, args} = await this.parse(WebhooksUpdate)
33
- const {path, display} = this.webhookType(flags)
34
- const action = new Spinner()
35
-
36
- action.start(`Updating webhook ${args.id} for ${display}`)
37
-
38
- await this.webhooksClient.patch(`${path}/webhooks/${args.id}`, {
39
- body: {
40
- include: flags.include && flags.include.split(',').map(s => s.trim()),
41
- level: flags.level,
42
- secret: flags.secret,
43
- url: flags.url,
44
- },
45
- })
46
-
47
- action.stop()
48
- }
49
- }
50
- */