heroku 8.3.1-beta.1 → 8.3.1-beta.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.
@@ -6,6 +6,7 @@ const Rollbar = require("rollbar");
6
6
  const command_1 = require("@heroku-cli/command");
7
7
  const core_1 = require("@oclif/core");
8
8
  const api_1 = require("@opentelemetry/api");
9
+ const packageParser_1 = require("./lib/utils/packageParser");
9
10
  const { Resource } = require('@opentelemetry/resources');
10
11
  const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
11
12
  const { registerInstrumentations } = require('@opentelemetry/instrumentation');
@@ -53,43 +54,29 @@ exports.initializeInstrumentation = initializeInstrumentation;
53
54
  function setupTelemetry(config, opts) {
54
55
  const now = new Date();
55
56
  const cmdStartTime = now.getTime();
56
- const isHelpOrVersionCmd = (opts.id === 'version' || opts.id === '--help');
57
+ const isHelpOrVersionCmd = ((0, packageParser_1.getAllVersionFlags)().includes(opts.id) || (0, packageParser_1.getAllHelpFlags)().includes(opts.id));
57
58
  const isRegularCmd = Boolean(opts.Command);
59
+ const baseTelemetryObject = {
60
+ command: opts.id,
61
+ os: config.platform,
62
+ version: config.version,
63
+ exitCode: 0,
64
+ exitState: 'successful',
65
+ cliRunDuration: 0,
66
+ commandRunDuration: cmdStartTime,
67
+ lifecycleHookCompletion: {
68
+ init: true,
69
+ prerun: false,
70
+ postrun: false,
71
+ command_not_found: false,
72
+ },
73
+ isVersionOrHelp: true,
74
+ };
58
75
  if (isHelpOrVersionCmd) {
59
- return {
60
- command: opts.id,
61
- os: config.platform,
62
- version: config.version,
63
- exitCode: 0,
64
- exitState: 'successful',
65
- cliRunDuration: 0,
66
- commandRunDuration: cmdStartTime,
67
- lifecycleHookCompletion: {
68
- init: true,
69
- prerun: false,
70
- postrun: false,
71
- command_not_found: false,
72
- },
73
- isVersionOrHelp: true,
74
- };
76
+ return baseTelemetryObject;
75
77
  }
76
78
  if (isRegularCmd) {
77
- return {
78
- command: opts.Command.id,
79
- os: config.platform,
80
- version: config.version,
81
- exitCode: 0,
82
- exitState: 'successful',
83
- cliRunDuration: 0,
84
- commandRunDuration: cmdStartTime,
85
- lifecycleHookCompletion: {
86
- init: true,
87
- prerun: true,
88
- postrun: false,
89
- command_not_found: false,
90
- },
91
- isVersionOrHelp: false,
92
- };
79
+ return Object.assign(Object.assign({}, baseTelemetryObject), { command: opts.Command.id, lifecycleHookCompletion: Object.assign(Object.assign({}, baseTelemetryObject.lifecycleHookCompletion), { prerun: true }), isVersionOrHelp: false });
93
80
  }
94
81
  }
95
82
  exports.setupTelemetry = setupTelemetry;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const packageParser_1 = require("../../lib/utils/packageParser");
3
4
  const allowlist = [
4
5
  'HEROKU_API_KEY',
5
6
  'HEROKU_APP',
@@ -11,7 +12,7 @@ const allowlist = [
11
12
  'SSL_KEY_FILE',
12
13
  ];
13
14
  const version = async function () {
14
- if (['-v', '--version', 'version'].includes(process.argv[2])) {
15
+ if ((0, packageParser_1.getAllVersionFlags)().includes(process.argv[2])) {
15
16
  for (const env of allowlist) {
16
17
  if (process.env[env]) {
17
18
  const value = env === 'HEROKU_API_KEY' ? 'to [REDACTED]' : `to ${process.env[env]}`;
@@ -0,0 +1,2 @@
1
+ export declare function getAllVersionFlags(): any[];
2
+ export declare function getAllHelpFlags(): any[];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAllHelpFlags = exports.getAllVersionFlags = void 0;
4
+ const { oclif } = require('../../../package.json');
5
+ function getAllVersionFlags() {
6
+ return [...oclif.additionalVersionFlags, '--version'];
7
+ }
8
+ exports.getAllVersionFlags = getAllVersionFlags;
9
+ function getAllHelpFlags() {
10
+ return [...oclif.additionalHelpFlags, '--help', 'help'];
11
+ }
12
+ exports.getAllHelpFlags = getAllHelpFlags;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "8.3.1-beta.1",
2
+ "version": "8.3.1-beta.3",
3
3
  "commands": {
4
4
  "console": {
5
5
  "id": "console",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "heroku",
3
3
  "description": "CLI to interact with Heroku",
4
- "version": "8.3.1-beta.1",
4
+ "version": "8.3.1-beta.3",
5
5
  "author": "Jeff Dickey @jdxcode",
6
6
  "bin": "./bin/run",
7
7
  "bugs": "https://github.com/heroku/cli/issues",
@@ -9,8 +9,8 @@
9
9
  "@heroku-cli/color": "1.1.14",
10
10
  "@heroku-cli/command": "^10.0.0",
11
11
  "@heroku-cli/notifications": "^1.2.2",
12
- "@heroku-cli/plugin-addons-v5": "^8.2.0",
13
- "@heroku-cli/plugin-apps-v5": "^8.2.0",
12
+ "@heroku-cli/plugin-addons-v5": "^8.3.1-beta.3",
13
+ "@heroku-cli/plugin-apps-v5": "^8.3.1-beta.3",
14
14
  "@heroku-cli/plugin-certs-v5": "^8.2.0",
15
15
  "@heroku-cli/plugin-ci-v5": "^8.2.0",
16
16
  "@heroku-cli/plugin-container-registry-v5": "^8.2.0",
@@ -19,7 +19,7 @@
19
19
  "@heroku-cli/plugin-ps": "^8.1.7",
20
20
  "@heroku-cli/plugin-ps-exec": "^2.4.0",
21
21
  "@heroku-cli/plugin-redis-v5": "^8.2.0",
22
- "@heroku-cli/plugin-spaces": "^8.2.0",
22
+ "@heroku-cli/plugin-spaces": "^8.3.1-beta.3",
23
23
  "@heroku-cli/schema": "^1.0.25",
24
24
  "@heroku/buildpack-registry": "^1.0.1",
25
25
  "@heroku/eventsource": "^1.0.7",
@@ -332,5 +332,5 @@
332
332
  "version": "oclif readme --multi && git add README.md ../../docs"
333
333
  },
334
334
  "types": "lib/index.d.ts",
335
- "gitHead": "4343cc17b5657499283a547da2e118741f4099ce"
335
+ "gitHead": "64393461430887ace7546c02f020bf94d3dc15df"
336
336
  }