@hubspot/cli 7.2.0-beta.0 → 7.2.0
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/account/info.d.ts +1 -1
- package/commands/account/info.js +8 -5
- package/commands/auth.d.ts +9 -0
- package/commands/auth.js +89 -83
- package/commands/init.d.ts +11 -0
- package/commands/init.js +114 -100
- package/commands/list.d.ts +9 -0
- package/commands/list.js +63 -57
- package/commands/mv.d.ts +10 -0
- package/commands/mv.js +32 -32
- package/commands/open.d.ts +10 -0
- package/commands/open.js +37 -34
- package/commands/remove.d.ts +9 -0
- package/commands/remove.js +25 -23
- package/lang/en.lyaml +9 -6
- package/lib/commonOpts.d.ts +1 -0
- package/lib/commonOpts.js +30 -0
- package/lib/prompts/accountNamePrompt.d.ts +2 -3
- package/lib/prompts/personalAccessKeyPrompt.d.ts +4 -4
- package/lib/ui/index.d.ts +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/supportHyperlinks.js +2 -2
- package/lib/ui/supportsColor.js +2 -2
- package/lib/usageTracking.d.ts +1 -1
- package/lib/yargsUtils.d.ts +9 -0
- package/lib/yargsUtils.js +40 -0
- package/package.json +1 -1
- package/lib/hasFlag.d.ts +0 -1
- package/lib/hasFlag.js +0 -15
package/lib/ui/supportsColor.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.supportsColor = void 0;
|
|
|
7
7
|
const process_1 = __importDefault(require("process"));
|
|
8
8
|
const os_1 = __importDefault(require("os"));
|
|
9
9
|
const tty_1 = __importDefault(require("tty"));
|
|
10
|
-
const
|
|
10
|
+
const yargsUtils_1 = require("../yargsUtils");
|
|
11
11
|
const { env } = process_1.default;
|
|
12
12
|
function translateLevel(level) {
|
|
13
13
|
if (level === 0) {
|
|
@@ -33,7 +33,7 @@ function _supportsColor(haveStream, { streamIsTTY } = {}) {
|
|
|
33
33
|
if (env.TERM === 'dumb') {
|
|
34
34
|
return min;
|
|
35
35
|
}
|
|
36
|
-
if ((0,
|
|
36
|
+
if ((0, yargsUtils_1.hasFlag)('noColor')) {
|
|
37
37
|
return 0;
|
|
38
38
|
}
|
|
39
39
|
if (process_1.default.platform === 'win32') {
|
package/lib/usageTracking.d.ts
CHANGED
|
@@ -16,6 +16,6 @@ type Meta = {
|
|
|
16
16
|
export declare function trackCommandUsage(command: string, meta?: Meta, accountId?: number): Promise<void>;
|
|
17
17
|
export declare function trackHelpUsage(command: string): Promise<void>;
|
|
18
18
|
export declare function trackConvertFieldsUsage(command: string): Promise<void>;
|
|
19
|
-
export declare function trackAuthAction(command: string, authType: string, step: string, accountId
|
|
19
|
+
export declare function trackAuthAction(command: string, authType: string, step: string, accountId?: number): Promise<void>;
|
|
20
20
|
export declare function trackCommandMetadataUsage(command: string, meta?: Meta, accountId?: number): Promise<void>;
|
|
21
21
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
export declare function hasFlag(flag: string, argv?: string[]): boolean;
|
|
3
|
+
export declare function makeYargsBuilder<T>(callback: (yargs: Argv) => Argv<T>, command: string, describe: string, options: {
|
|
4
|
+
useGlobalOptions?: boolean;
|
|
5
|
+
useAccountOptions?: boolean;
|
|
6
|
+
useConfigOptions?: boolean;
|
|
7
|
+
useUseEnvironmentOptions?: boolean;
|
|
8
|
+
useTestingOptions?: boolean;
|
|
9
|
+
}): (yargs: Argv) => Promise<Argv<T>>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.hasFlag = hasFlag;
|
|
7
|
+
exports.makeYargsBuilder = makeYargsBuilder;
|
|
8
|
+
const process_1 = __importDefault(require("process"));
|
|
9
|
+
const commonOpts_1 = require("./commonOpts");
|
|
10
|
+
// See https://github.com/sindresorhus/has-flag/blob/main/index.js (License: https://github.com/sindresorhus/has-flag/blob/main/license)
|
|
11
|
+
function hasFlag(flag, argv = process_1.default.argv) {
|
|
12
|
+
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
|
|
13
|
+
const position = argv.indexOf(prefix + flag);
|
|
14
|
+
const terminatorPosition = argv.indexOf('--');
|
|
15
|
+
return (position !== -1 &&
|
|
16
|
+
(terminatorPosition === -1 || position < terminatorPosition));
|
|
17
|
+
}
|
|
18
|
+
function makeYargsBuilder(callback, command, describe, options) {
|
|
19
|
+
return async function (yargs) {
|
|
20
|
+
if (options.useGlobalOptions) {
|
|
21
|
+
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
22
|
+
}
|
|
23
|
+
if (options.useAccountOptions) {
|
|
24
|
+
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
25
|
+
}
|
|
26
|
+
if (options.useConfigOptions) {
|
|
27
|
+
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
28
|
+
}
|
|
29
|
+
if (options.useUseEnvironmentOptions) {
|
|
30
|
+
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
31
|
+
}
|
|
32
|
+
if (options.useTestingOptions) {
|
|
33
|
+
(0, commonOpts_1.addTestingOptions)(yargs);
|
|
34
|
+
}
|
|
35
|
+
const result = callback(yargs);
|
|
36
|
+
// Must go last to pick up available options
|
|
37
|
+
await (0, commonOpts_1.addCustomHelpOutput)(result, command, describe);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
}
|
package/package.json
CHANGED
package/lib/hasFlag.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function hasFlag(flag: string, argv?: string[]): boolean;
|
package/lib/hasFlag.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.hasFlag = hasFlag;
|
|
7
|
-
const process_1 = __importDefault(require("process"));
|
|
8
|
-
// See https://github.com/sindresorhus/has-flag/blob/main/index.js (License: https://github.com/sindresorhus/has-flag/blob/main/license)
|
|
9
|
-
function hasFlag(flag, argv = process_1.default.argv) {
|
|
10
|
-
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
|
|
11
|
-
const position = argv.indexOf(prefix + flag);
|
|
12
|
-
const terminatorPosition = argv.indexOf('--');
|
|
13
|
-
return (position !== -1 &&
|
|
14
|
-
(terminatorPosition === -1 || position < terminatorPosition));
|
|
15
|
-
}
|