@hubspot/cli 7.5.11-experimental.0 → 7.7.0-experimental.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/bin/cli.js +5 -6
- package/bin/hsmcp.d.ts +2 -0
- package/bin/hsmcp.js +13 -0
- package/commands/account/auth.d.ts +3 -7
- package/commands/account/auth.js +19 -9
- package/commands/account/clean.d.ts +3 -7
- package/commands/account/clean.js +16 -9
- package/commands/account/createOverride.d.ts +3 -7
- package/commands/account/createOverride.js +23 -6
- package/commands/account/info.d.ts +3 -7
- package/commands/account/info.js +13 -5
- package/commands/account/list.d.ts +3 -7
- package/commands/account/list.js +15 -8
- package/commands/account/remove.d.ts +3 -7
- package/commands/account/remove.js +21 -9
- package/commands/account/removeOverride.d.ts +3 -7
- package/commands/account/removeOverride.js +23 -6
- package/commands/account/rename.d.ts +3 -7
- package/commands/account/rename.js +16 -9
- package/commands/account/use.d.ts +5 -9
- package/commands/account/use.js +14 -6
- package/commands/account.d.ts +3 -4
- package/commands/account.js +35 -58
- package/commands/app/migrate.d.ts +1 -2
- package/commands/app/migrate.js +7 -8
- package/commands/app/secret/add.d.ts +7 -0
- package/commands/app/secret/add.js +64 -0
- package/commands/app/secret/delete.d.ts +8 -0
- package/commands/app/secret/delete.js +87 -0
- package/commands/app/secret/list.d.ts +6 -0
- package/commands/app/secret/list.js +64 -0
- package/commands/app/secret/update.d.ts +7 -0
- package/commands/app/secret/update.js +77 -0
- package/commands/app/secret.d.ts +3 -0
- package/commands/app/secret.js +30 -0
- package/commands/app.d.ts +2 -5
- package/commands/app.js +12 -8
- package/commands/auth.d.ts +3 -7
- package/commands/auth.js +12 -5
- package/commands/cms/convertFields.d.ts +7 -1
- package/commands/cms/convertFields.js +57 -41
- package/commands/cms/getReactModule.d.ts +7 -1
- package/commands/cms/getReactModule.js +52 -34
- package/commands/cms/lighthouseScore.d.ts +8 -1
- package/commands/cms/lighthouseScore.js +129 -100
- package/commands/cms.d.ts +3 -1
- package/commands/cms.js +24 -15
- package/commands/completion.d.ts +3 -1
- package/commands/completion.js +25 -12
- package/commands/config/migrate.d.ts +3 -7
- package/commands/config/migrate.js +25 -15
- package/commands/config/set.d.ts +5 -6
- package/commands/config/set.js +38 -14
- package/commands/config.d.ts +3 -4
- package/commands/config.js +20 -44
- package/commands/create/api-sample.d.ts +3 -1
- package/commands/create/api-sample.js +34 -38
- package/commands/create/app.d.ts +3 -1
- package/commands/create/app.js +9 -7
- package/commands/create/function.d.ts +3 -1
- package/commands/create/function.js +11 -10
- package/commands/create/index.d.ts +5 -1
- package/commands/create/index.js +23 -11
- package/commands/create/module.d.ts +3 -1
- package/commands/create/module.js +14 -13
- package/commands/create/react-app.d.ts +3 -1
- package/commands/create/react-app.js +10 -7
- package/commands/create/template.d.ts +3 -1
- package/commands/create/template.js +14 -14
- package/commands/create/vue-app.d.ts +3 -1
- package/commands/create/vue-app.js +10 -7
- package/commands/create/webpack-serverless.d.ts +3 -1
- package/commands/create/webpack-serverless.js +10 -7
- package/commands/create/website-theme.d.ts +3 -1
- package/commands/create/website-theme.js +10 -9
- package/commands/create.d.ts +4 -24
- package/commands/create.js +64 -74
- package/commands/customObject/create.d.ts +4 -9
- package/commands/customObject/create.js +17 -10
- package/commands/customObject/schema/create.d.ts +4 -9
- package/commands/customObject/schema/create.js +18 -11
- package/commands/customObject/schema/delete.d.ts +4 -9
- package/commands/customObject/schema/delete.js +17 -10
- package/commands/customObject/schema/fetch-all.d.ts +4 -9
- package/commands/customObject/schema/fetch-all.js +17 -10
- package/commands/customObject/schema/fetch.d.ts +4 -9
- package/commands/customObject/schema/fetch.js +17 -10
- package/commands/customObject/schema/list.d.ts +4 -8
- package/commands/customObject/schema/list.js +17 -10
- package/commands/customObject/schema/update.d.ts +4 -9
- package/commands/customObject/schema/update.js +18 -11
- package/commands/customObject/schema.d.ts +3 -5
- package/commands/customObject/schema.js +27 -54
- package/commands/customObject.d.ts +3 -4
- package/commands/customObject.js +20 -45
- package/commands/doctor.d.ts +6 -8
- package/commands/doctor.js +32 -21
- package/commands/feedback.d.ts +4 -1
- package/commands/feedback.js +40 -47
- package/commands/fetch.d.ts +12 -1
- package/commands/fetch.js +49 -33
- package/commands/filemanager/fetch.d.ts +4 -9
- package/commands/filemanager/fetch.js +18 -11
- package/commands/filemanager/upload.d.ts +4 -9
- package/commands/filemanager/upload.js +17 -11
- package/commands/filemanager.d.ts +3 -4
- package/commands/filemanager.js +20 -41
- package/commands/function/deploy.d.ts +6 -1
- package/commands/function/deploy.js +70 -50
- package/commands/function/list.d.ts +6 -1
- package/commands/function/list.js +44 -32
- package/commands/function/server.d.ts +10 -1
- package/commands/function/server.js +49 -38
- package/commands/function.d.ts +5 -1
- package/commands/function.js +24 -10
- package/commands/hubdb/clear.d.ts +4 -9
- package/commands/hubdb/clear.js +17 -10
- package/commands/hubdb/create.d.ts +4 -9
- package/commands/hubdb/create.js +17 -10
- package/commands/hubdb/delete.d.ts +4 -9
- package/commands/hubdb/delete.js +17 -10
- package/commands/hubdb/fetch.d.ts +4 -9
- package/commands/hubdb/fetch.js +17 -10
- package/commands/hubdb.d.ts +3 -2
- package/commands/hubdb.js +23 -45
- package/commands/init.d.ts +3 -7
- package/commands/init.js +12 -5
- package/commands/lint.d.ts +6 -4
- package/commands/lint.js +44 -43
- package/commands/list.d.ts +3 -7
- package/commands/list.js +19 -11
- package/commands/logs.d.ts +10 -1
- package/commands/logs.js +53 -44
- package/commands/module/marketplace-validate.d.ts +6 -1
- package/commands/module/marketplace-validate.js +39 -27
- package/commands/module.d.ts +3 -1
- package/commands/module.js +22 -10
- package/commands/mv.d.ts +3 -7
- package/commands/mv.js +19 -11
- package/commands/open.d.ts +3 -7
- package/commands/open.js +19 -11
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/cloneApp.js +2 -2
- package/commands/project/create.js +3 -3
- package/commands/project/deploy.d.ts +1 -0
- package/commands/project/deploy.js +40 -12
- package/commands/project/dev/index.d.ts +1 -4
- package/commands/project/dev/index.js +48 -16
- package/commands/project/dev/unifiedFlow.d.ts +2 -1
- package/commands/project/dev/unifiedFlow.js +85 -30
- package/commands/project/migrate.d.ts +1 -0
- package/commands/project/profile/add.d.ts +7 -0
- package/commands/project/profile/add.js +209 -0
- package/commands/project/profile/delete.d.ts +6 -0
- package/commands/project/profile/delete.js +123 -0
- package/commands/project/profile.d.ts +3 -0
- package/commands/project/profile.js +25 -0
- package/commands/project/upload.d.ts +1 -0
- package/commands/project/upload.js +38 -8
- package/commands/project/validate.d.ts +4 -0
- package/commands/project/validate.js +53 -0
- package/commands/project.js +4 -0
- package/commands/remove.d.ts +3 -7
- package/commands/remove.js +19 -11
- package/commands/sandbox/create.d.ts +4 -9
- package/commands/sandbox/create.js +18 -11
- package/commands/sandbox/delete.d.ts +4 -9
- package/commands/sandbox/delete.js +18 -11
- package/commands/sandbox.d.ts +3 -4
- package/commands/sandbox.js +20 -43
- package/commands/secret/addSecret.d.ts +4 -9
- package/commands/secret/addSecret.js +17 -10
- package/commands/secret/deleteSecret.d.ts +4 -9
- package/commands/secret/deleteSecret.js +17 -10
- package/commands/secret/listSecret.d.ts +4 -9
- package/commands/secret/listSecret.js +17 -10
- package/commands/secret/updateSecret.d.ts +4 -9
- package/commands/secret/updateSecret.js +17 -10
- package/commands/secret.d.ts +3 -4
- package/commands/secret.js +25 -48
- package/commands/setupMcp.d.ts +8 -0
- package/commands/setupMcp.js +229 -0
- package/commands/theme/generate-selectors.d.ts +3 -7
- package/commands/theme/generate-selectors.js +14 -6
- package/commands/theme/marketplace-validate.d.ts +4 -9
- package/commands/theme/marketplace-validate.js +17 -10
- package/commands/theme/preview.d.ts +4 -9
- package/commands/theme/preview.js +16 -9
- package/commands/theme.d.ts +3 -4
- package/commands/theme.js +23 -46
- package/commands/upload.d.ts +12 -1
- package/commands/upload.js +118 -97
- package/commands/watch.d.ts +14 -1
- package/commands/watch.js +76 -65
- package/lang/en.d.ts +838 -574
- package/lang/en.js +630 -373
- package/lang/en.lyaml +30 -23
- package/lib/accountTypes.js +2 -1
- package/lib/app/migrate.d.ts +23 -0
- package/lib/app/migrate.js +14 -3
- package/lib/app/migrate_legacy.js +7 -7
- package/lib/app/urls.d.ts +16 -0
- package/lib/app/urls.js +16 -0
- package/lib/configMigrate.js +24 -10
- package/lib/configOptions.d.ts +4 -0
- package/lib/configOptions.js +41 -46
- package/lib/constants.d.ts +6 -0
- package/lib/constants.js +7 -1
- package/lib/dependencyManagement.d.ts +0 -5
- package/lib/dependencyManagement.js +13 -39
- package/lib/doctor/Doctor.js +2 -1
- package/lib/filesystem.d.ts +1 -1
- package/lib/interpolation.d.ts +2 -3
- package/lib/lang.d.ts +2 -3
- package/lib/middleware/autoUpdateMiddleware.d.ts +1 -0
- package/lib/middleware/autoUpdateMiddleware.js +89 -0
- package/lib/middleware/configMiddleware.js +8 -0
- package/lib/npm.d.ts +9 -0
- package/lib/npm.js +36 -0
- package/lib/projectProfiles.d.ts +6 -0
- package/lib/projectProfiles.js +65 -0
- package/lib/projects/buildAndDeploy.js +17 -2
- package/lib/projects/localDev/AppDevModeInterface.d.ts +26 -0
- package/lib/projects/localDev/AppDevModeInterface.js +156 -0
- package/lib/projects/localDev/DevServerManagerV2.d.ts +11 -22
- package/lib/projects/localDev/DevServerManagerV2.js +19 -15
- package/lib/projects/localDev/LocalDevLogger.d.ts +30 -0
- package/lib/projects/localDev/LocalDevLogger.js +158 -0
- package/lib/projects/localDev/LocalDevManager.js +12 -5
- package/lib/projects/localDev/LocalDevProcess.d.ts +27 -0
- package/lib/projects/localDev/LocalDevProcess.js +171 -0
- package/lib/projects/localDev/LocalDevState.d.ts +37 -0
- package/lib/projects/localDev/LocalDevState.js +78 -0
- package/lib/projects/localDev/LocalDevWatcher.d.ts +10 -0
- package/lib/projects/localDev/LocalDevWatcher.js +56 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +17 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +92 -0
- package/lib/projects/localDev/helpers.d.ts +3 -2
- package/lib/projects/localDev/helpers.js +32 -2
- package/lib/projects/upload.d.ts +2 -1
- package/lib/projects/upload.js +2 -2
- package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
- package/lib/prompts/createTemplatePrompt.d.ts +22 -4
- package/lib/prompts/installAppPrompt.d.ts +1 -0
- package/lib/prompts/installAppPrompt.js +35 -0
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +6 -6
- package/lib/prompts/promptUtils.d.ts +2 -1
- package/lib/prompts/promptUtils.js +2 -1
- package/lib/prompts/selectAppPrompt.d.ts +2 -0
- package/lib/prompts/selectAppPrompt.js +40 -0
- package/lib/prompts/{selectPublicAppPrompt.d.ts → selectPublicAppForMigrationPrompt.d.ts} +1 -1
- package/lib/prompts/{selectPublicAppPrompt.js → selectPublicAppForMigrationPrompt.js} +8 -8
- package/lib/testUtils.d.ts +3 -3
- package/lib/testUtils.js +8 -9
- package/lib/ui/index.js +4 -1
- package/lib/upload.d.ts +1 -1
- package/lib/validation.js +4 -5
- package/lib/yargsUtils.d.ts +4 -0
- package/lib/yargsUtils.js +6 -0
- package/mcp-server/index.d.ts +1 -0
- package/mcp-server/index.js +17 -0
- package/mcp-server/mcpLoader.d.ts +5 -0
- package/mcp-server/mcpLoader.js +24 -0
- package/mcp-server/tools/ExplainProjectStructureTool.d.ts +33 -0
- package/mcp-server/tools/ExplainProjectStructureTool.js +266 -0
- package/mcp-server/tools/GenerateAppComponentTool.d.ts +99 -0
- package/mcp-server/tools/GenerateAppComponentTool.js +193 -0
- package/mcp-server/tools/GenerateCardComponentTool.d.ts +74 -0
- package/mcp-server/tools/GenerateCardComponentTool.js +146 -0
- package/mcp-server/tools/GenerateProjectConfigTool.d.ts +32 -0
- package/mcp-server/tools/GenerateProjectConfigTool.js +40 -0
- package/mcp-server/tools/HubSpotCLIHelper.d.ts +16 -0
- package/mcp-server/tools/HubSpotCLIHelper.js +74 -0
- package/mcp-server/tools/UploadProjectTool.d.ts +44 -0
- package/mcp-server/tools/UploadProjectTool.js +149 -0
- package/mcp-server/tools/ValidateProjectTool.d.ts +62 -0
- package/mcp-server/tools/ValidateProjectTool.js +315 -0
- package/package.json +13 -6
- package/types/Cms.d.ts +30 -0
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +24 -0
- package/types/LocalDev.js +2 -0
- package/types/Prompts.d.ts +0 -7
- package/types/Yargs.d.ts +8 -1
- package/lib/projects/localDev/LocalDevManagerV2.d.ts +0 -64
- package/lib/projects/localDev/LocalDevManagerV2.js +0 -345
- package/lib/prompts/installPublicAppPrompt.d.ts +0 -1
- package/lib/prompts/installPublicAppPrompt.js +0 -41
package/bin/cli.js
CHANGED
|
@@ -7,7 +7,7 @@ const { setLogLevel, getCommandName } = require('../lib/commonOpts');
|
|
|
7
7
|
const { trackHelpUsage, trackConvertFieldsUsage, } = require('../lib/usageTracking');
|
|
8
8
|
const { EXIT_CODES } = require('../lib/enums/exitCodes');
|
|
9
9
|
const { loadConfigMiddleware, injectAccountIdMiddleware, validateAccountOptions, handleDeprecatedEnvVariables, } = require('../lib/middleware/configMiddleware');
|
|
10
|
-
const {
|
|
10
|
+
const { autoUpdateCLI } = require('../lib/middleware/autoUpdateMiddleware');
|
|
11
11
|
const { checkAndWarnGitInclusionMiddleware, } = require('../lib/middleware/gitMiddleware');
|
|
12
12
|
const { performChecks } = require('../lib/middleware/yargsChecksMiddleware');
|
|
13
13
|
const { setRequestHeaders } = require('../lib/middleware/requestMiddleware');
|
|
@@ -40,7 +40,7 @@ const feedbackCommand = require('../commands/feedback');
|
|
|
40
40
|
const doctorCommand = require('../commands/doctor');
|
|
41
41
|
const completionCommand = require('../commands/completion');
|
|
42
42
|
const appCommand = require('../commands/app');
|
|
43
|
-
|
|
43
|
+
const setupMcpCommand = require('../commands/setupMcp');
|
|
44
44
|
const getTerminalWidth = () => {
|
|
45
45
|
const width = yargs.terminalWidth();
|
|
46
46
|
if (width >= 100)
|
|
@@ -71,6 +71,7 @@ const argv = yargs
|
|
|
71
71
|
handleDeprecatedEnvVariables,
|
|
72
72
|
loadConfigMiddleware,
|
|
73
73
|
injectAccountIdMiddleware,
|
|
74
|
+
autoUpdateCLI,
|
|
74
75
|
checkAndWarnGitInclusionMiddleware,
|
|
75
76
|
validateAccountOptions,
|
|
76
77
|
checkFireAlarms,
|
|
@@ -105,10 +106,7 @@ const argv = yargs
|
|
|
105
106
|
.command(secretCommands)
|
|
106
107
|
.command(customObjectCommand)
|
|
107
108
|
.command(functionCommands)
|
|
108
|
-
.command(
|
|
109
|
-
...listCommand,
|
|
110
|
-
aliases: 'ls',
|
|
111
|
-
})
|
|
109
|
+
.command(listCommand)
|
|
112
110
|
.command(openCommand)
|
|
113
111
|
.command(mvCommand)
|
|
114
112
|
.command(projectCommands)
|
|
@@ -121,6 +119,7 @@ const argv = yargs
|
|
|
121
119
|
.command(doctorCommand)
|
|
122
120
|
.command(completionCommand)
|
|
123
121
|
.command(appCommand)
|
|
122
|
+
.command(setupMcpCommand)
|
|
124
123
|
.help()
|
|
125
124
|
.alias('h', 'help')
|
|
126
125
|
.recommendCommands()
|
package/bin/hsmcp.d.ts
ADDED
package/bin/hsmcp.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
console.log('Starting MCP server...');
|
|
4
|
+
try {
|
|
5
|
+
require('../mcp-server/index');
|
|
6
|
+
}
|
|
7
|
+
catch (error) {
|
|
8
|
+
console.error('Failed to start MCP server:');
|
|
9
|
+
console.error('Error name:', error.name || 'Unknown');
|
|
10
|
+
console.error('Error message:', error.message || 'No message');
|
|
11
|
+
console.error('Full error:', error);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs, ConfigArgs } from '../../types/Yargs';
|
|
3
|
-
export declare const describe: string;
|
|
4
|
-
export declare const command = "auth";
|
|
1
|
+
import { CommonArgs, ConfigArgs, YargsCommandModule } from '../../types/Yargs';
|
|
5
2
|
type AccountAuthArgs = CommonArgs & ConfigArgs & {
|
|
6
3
|
disableTracking?: boolean;
|
|
7
4
|
};
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export {};
|
|
5
|
+
declare const accountAuthCommand: YargsCommandModule<unknown, AccountAuthArgs>;
|
|
6
|
+
export default accountAuthCommand;
|
package/commands/account/auth.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.command = exports.describe = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
7
4
|
const migrate_1 = require("@hubspot/local-dev-lib/config/migrate");
|
|
8
5
|
const getAccountIdentifier_1 = require("@hubspot/local-dev-lib/config/getAccountIdentifier");
|
|
@@ -11,7 +8,7 @@ const personalAccessKey_1 = require("@hubspot/local-dev-lib/personalAccessKey");
|
|
|
11
8
|
const environments_1 = require("@hubspot/local-dev-lib/constants/environments");
|
|
12
9
|
const text_1 = require("@hubspot/local-dev-lib/text");
|
|
13
10
|
const auth_1 = require("@hubspot/local-dev-lib/constants/auth");
|
|
14
|
-
const
|
|
11
|
+
const config_2 = require("@hubspot/local-dev-lib/constants/config");
|
|
15
12
|
const configMigrate_1 = require("../../lib/configMigrate");
|
|
16
13
|
const process_1 = require("../../lib/process");
|
|
17
14
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
@@ -24,6 +21,7 @@ const index_2 = require("../../lib/errorHandlers/index");
|
|
|
24
21
|
const usageTracking_2 = require("../../lib/usageTracking");
|
|
25
22
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
26
23
|
const ui_1 = require("../../lib/ui");
|
|
24
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
27
25
|
const TRACKING_STATUS = {
|
|
28
26
|
STARTED: 'started',
|
|
29
27
|
ERROR: 'error',
|
|
@@ -155,8 +153,8 @@ async function handleConfigUpdate(env, configAlreadyExists, disableTracking, aut
|
|
|
155
153
|
}
|
|
156
154
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
157
155
|
}
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
const describe = (0, lang_1.i18n)('commands.account.subcommands.auth.describe');
|
|
157
|
+
const command = 'auth';
|
|
160
158
|
async function handler(args) {
|
|
161
159
|
const { providedAccountId, disableTracking } = args;
|
|
162
160
|
const authType = auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value;
|
|
@@ -169,7 +167,7 @@ async function handler(args) {
|
|
|
169
167
|
const configAlreadyExists = (0, migrate_1.configFileExists)(true);
|
|
170
168
|
await handleConfigUpdate(env, configAlreadyExists, disableTracking, authType, providedAccountId);
|
|
171
169
|
}
|
|
172
|
-
function
|
|
170
|
+
function accountAuthBuilder(yargs) {
|
|
173
171
|
yargs.options({
|
|
174
172
|
account: {
|
|
175
173
|
describe: (0, lang_1.i18n)('commands.account.subcommands.auth.options.account.describe'),
|
|
@@ -182,7 +180,19 @@ function builder(yargs) {
|
|
|
182
180
|
default: false,
|
|
183
181
|
},
|
|
184
182
|
});
|
|
185
|
-
(0, commonOpts_1.addTestingOptions)(yargs);
|
|
186
|
-
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
187
183
|
return yargs;
|
|
188
184
|
}
|
|
185
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(accountAuthBuilder, command, (0, lang_1.i18n)('commands.account.subcommands.auth.verboseDescribe', {
|
|
186
|
+
authMethod: auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value,
|
|
187
|
+
globalConfigPath: config_2.GLOBAL_CONFIG_PATH,
|
|
188
|
+
}), {
|
|
189
|
+
useGlobalOptions: true,
|
|
190
|
+
useTestingOptions: true,
|
|
191
|
+
});
|
|
192
|
+
const accountAuthCommand = {
|
|
193
|
+
command,
|
|
194
|
+
describe,
|
|
195
|
+
handler,
|
|
196
|
+
builder,
|
|
197
|
+
};
|
|
198
|
+
exports.default = accountAuthCommand;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs, ConfigArgs } from '../../types/Yargs';
|
|
3
|
-
export declare const command = "clean";
|
|
4
|
-
export declare const describe: string;
|
|
1
|
+
import { CommonArgs, ConfigArgs, YargsCommandModule } from '../../types/Yargs';
|
|
5
2
|
type AccountCleanArgs = CommonArgs & ConfigArgs & {
|
|
6
3
|
qa?: boolean;
|
|
7
4
|
};
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export {};
|
|
5
|
+
declare const accountCleanCommand: YargsCommandModule<unknown, AccountCleanArgs>;
|
|
6
|
+
export default accountCleanCommand;
|
|
@@ -3,9 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.describe = exports.command = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
|
-
exports.builder = builder;
|
|
9
6
|
const fs_1 = __importDefault(require("fs"));
|
|
10
7
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
11
8
|
const personalAccessKey_1 = require("@hubspot/local-dev-lib/personalAccessKey");
|
|
@@ -16,15 +13,15 @@ const config_2 = require("@hubspot/local-dev-lib/config");
|
|
|
16
13
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
17
14
|
const lang_1 = require("../../lib/lang");
|
|
18
15
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
19
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
20
16
|
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
21
17
|
const accountsPrompt_1 = require("../../lib/prompts/accountsPrompt");
|
|
22
18
|
const table_1 = require("../../lib/ui/table");
|
|
23
19
|
const SpinniesManager_1 = __importDefault(require("../../lib/ui/SpinniesManager"));
|
|
24
20
|
const ui_1 = require("../../lib/ui");
|
|
25
21
|
const errorHandlers_1 = require("../../lib/errorHandlers");
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
23
|
+
const command = 'clean';
|
|
24
|
+
const describe = (0, lang_1.i18n)(`commands.account.subcommands.clean.describe`);
|
|
28
25
|
async function handler(args) {
|
|
29
26
|
const { qa } = args;
|
|
30
27
|
(0, usageTracking_1.trackCommandUsage)('accounts-clean');
|
|
@@ -131,9 +128,19 @@ async function handler(args) {
|
|
|
131
128
|
logger_1.logger.log('');
|
|
132
129
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
133
130
|
}
|
|
134
|
-
function
|
|
135
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
136
|
-
(0, commonOpts_1.addTestingOptions)(yargs);
|
|
131
|
+
function accountCleanBuilder(yargs) {
|
|
137
132
|
yargs.example([['$0 accounts clean']]);
|
|
138
133
|
return yargs;
|
|
139
134
|
}
|
|
135
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(accountCleanBuilder, command, describe, {
|
|
136
|
+
useGlobalOptions: true,
|
|
137
|
+
useConfigOptions: true,
|
|
138
|
+
useTestingOptions: true,
|
|
139
|
+
});
|
|
140
|
+
const accountCleanCommand = {
|
|
141
|
+
command,
|
|
142
|
+
describe,
|
|
143
|
+
handler,
|
|
144
|
+
builder,
|
|
145
|
+
};
|
|
146
|
+
exports.default = accountCleanCommand;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs } from '../../types/Yargs';
|
|
3
|
-
export declare const describe: string;
|
|
4
|
-
export declare const command = "create-override [account]";
|
|
1
|
+
import { CommonArgs, YargsCommandModule } from '../../types/Yargs';
|
|
5
2
|
type AccountCreateOverrideArgs = CommonArgs & {
|
|
6
3
|
account: string | number;
|
|
7
4
|
};
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export {};
|
|
5
|
+
declare const accountCreateOverrideCommand: YargsCommandModule<unknown, AccountCreateOverrideArgs>;
|
|
6
|
+
export default accountCreateOverrideCommand;
|
|
@@ -3,27 +3,34 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.command = exports.describe = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
|
-
exports.builder = builder;
|
|
9
6
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
7
|
const path_1 = __importDefault(require("path"));
|
|
11
8
|
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
12
9
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
13
10
|
const config_1 = require("@hubspot/local-dev-lib/constants/config");
|
|
14
11
|
const config_2 = require("@hubspot/local-dev-lib/config");
|
|
12
|
+
const migrate_1 = require("@hubspot/local-dev-lib/config/migrate");
|
|
15
13
|
const lang_1 = require("../../lib/lang");
|
|
16
14
|
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
17
15
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
18
16
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
19
17
|
const accountsPrompt_1 = require("../../lib/prompts/accountsPrompt");
|
|
20
18
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
21
|
-
|
|
19
|
+
const ui_1 = require("../../lib/ui");
|
|
20
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
21
|
+
const command = 'create-override [account]';
|
|
22
|
+
const describe = (0, lang_1.i18n)('commands.account.subcommands.createOverride.describe', {
|
|
22
23
|
hsAccountFileName: config_1.DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME,
|
|
23
24
|
});
|
|
24
|
-
exports.command = 'create-override [account]';
|
|
25
25
|
async function handler(args) {
|
|
26
26
|
let overrideDefaultAccount = args.account;
|
|
27
|
+
const globalConfig = (0, migrate_1.getGlobalConfig)();
|
|
28
|
+
if (!globalConfig) {
|
|
29
|
+
logger_1.logger.error((0, lang_1.i18n)('commands.account.subcommands.createOverride.errors.globalConfigNotFound', {
|
|
30
|
+
authCommand: (0, ui_1.uiCommandReference)('hs account auth'),
|
|
31
|
+
}));
|
|
32
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
33
|
+
}
|
|
27
34
|
const accountOverride = (0, config_2.getCWDAccountOverride)();
|
|
28
35
|
const overrideFilePath = (0, config_2.getDefaultAccountOverrideFilePath)();
|
|
29
36
|
if (accountOverride && overrideFilePath) {
|
|
@@ -75,7 +82,7 @@ async function handler(args) {
|
|
|
75
82
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
76
83
|
}
|
|
77
84
|
}
|
|
78
|
-
function
|
|
85
|
+
function accountCreateOverrideBuilder(yargs) {
|
|
79
86
|
yargs.positional('account', {
|
|
80
87
|
describe: (0, lang_1.i18n)('commands.account.subcommands.createOverride.options.account.describe'),
|
|
81
88
|
type: 'string',
|
|
@@ -102,3 +109,13 @@ function builder(yargs) {
|
|
|
102
109
|
]);
|
|
103
110
|
return yargs;
|
|
104
111
|
}
|
|
112
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(accountCreateOverrideBuilder, command, describe, {
|
|
113
|
+
useGlobalOptions: true,
|
|
114
|
+
});
|
|
115
|
+
const accountCreateOverrideCommand = {
|
|
116
|
+
command,
|
|
117
|
+
describe,
|
|
118
|
+
handler,
|
|
119
|
+
builder,
|
|
120
|
+
};
|
|
121
|
+
exports.default = accountCreateOverrideCommand;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs, ConfigArgs } from '../../types/Yargs';
|
|
3
|
-
export declare const describe: string;
|
|
4
|
-
export declare const command = "info [account]";
|
|
1
|
+
import { CommonArgs, ConfigArgs, YargsCommandModule } from '../../types/Yargs';
|
|
5
2
|
type AccountInfoArgs = CommonArgs & ConfigArgs;
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export {};
|
|
3
|
+
declare const accountInfoCommand: YargsCommandModule<unknown, AccountInfoArgs>;
|
|
4
|
+
export default accountInfoCommand;
|
package/commands/account/info.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.builder = exports.command = exports.describe = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
3
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
6
4
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
7
5
|
const personalAccessKey_1 = require("@hubspot/local-dev-lib/personalAccessKey");
|
|
@@ -9,8 +7,8 @@ const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
|
9
7
|
const lang_1 = require("../../lib/lang");
|
|
10
8
|
const index_1 = require("../../lib/ui/index");
|
|
11
9
|
const table_1 = require("../../lib/ui/table");
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const describe = (0, lang_1.i18n)(`commands.account.subcommands.info.describe`);
|
|
11
|
+
const command = 'info [account]';
|
|
14
12
|
async function handler(args) {
|
|
15
13
|
const { derivedAccountId } = args;
|
|
16
14
|
const config = (0, config_1.getAccountConfig)(derivedAccountId);
|
|
@@ -74,4 +72,14 @@ function accountInfoBuilder(yargs) {
|
|
|
74
72
|
]);
|
|
75
73
|
return yargs;
|
|
76
74
|
}
|
|
77
|
-
|
|
75
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(accountInfoBuilder, command, describe, {
|
|
76
|
+
useGlobalOptions: true,
|
|
77
|
+
useConfigOptions: true,
|
|
78
|
+
});
|
|
79
|
+
const accountInfoCommand = {
|
|
80
|
+
command,
|
|
81
|
+
describe,
|
|
82
|
+
handler,
|
|
83
|
+
builder,
|
|
84
|
+
};
|
|
85
|
+
exports.default = accountInfoCommand;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs, ConfigArgs } from '../../types/Yargs';
|
|
3
|
-
export declare const command: string[];
|
|
4
|
-
export declare const describe: string;
|
|
1
|
+
import { CommonArgs, ConfigArgs, YargsCommandModule } from '../../types/Yargs';
|
|
5
2
|
type AccountListArgs = CommonArgs & ConfigArgs;
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export {};
|
|
3
|
+
declare const accountListCommand: YargsCommandModule<unknown, AccountListArgs>;
|
|
4
|
+
export default accountListCommand;
|
package/commands/account/list.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
7
4
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
8
5
|
const getAccountIdentifier_1 = require("@hubspot/local-dev-lib/config/getAccountIdentifier");
|
|
9
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
10
6
|
const index_1 = require("../../lib/ui/index");
|
|
11
7
|
const table_1 = require("../../lib/ui/table");
|
|
12
8
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
13
9
|
const accountTypes_1 = require("../../lib/accountTypes");
|
|
14
10
|
const lang_1 = require("../../lib/lang");
|
|
15
11
|
const config_2 = require("@hubspot/local-dev-lib/constants/config");
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
13
|
+
const command = ['list', 'ls'];
|
|
14
|
+
const describe = (0, lang_1.i18n)('commands.account.subcommands.list.describe');
|
|
18
15
|
function sortAndMapAccounts(accounts) {
|
|
19
16
|
const mappedAccountData = {};
|
|
20
17
|
// Standard and app developer accounts
|
|
@@ -105,8 +102,18 @@ async function handler(args) {
|
|
|
105
102
|
logger_1.logger.log((0, lang_1.i18n)(`commands.account.subcommands.list.accounts`));
|
|
106
103
|
logger_1.logger.log((0, table_1.getTableContents)(accountData, { border: { bodyLeft: ' ' } }));
|
|
107
104
|
}
|
|
108
|
-
function
|
|
109
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
105
|
+
function accountListBuilder(yargs) {
|
|
110
106
|
yargs.example([['$0 accounts list']]);
|
|
111
107
|
return yargs;
|
|
112
108
|
}
|
|
109
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(accountListBuilder, command, describe, {
|
|
110
|
+
useGlobalOptions: true,
|
|
111
|
+
useConfigOptions: true,
|
|
112
|
+
});
|
|
113
|
+
const accountListCommand = {
|
|
114
|
+
command,
|
|
115
|
+
describe,
|
|
116
|
+
handler,
|
|
117
|
+
builder,
|
|
118
|
+
};
|
|
119
|
+
exports.default = accountListCommand;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs, ConfigArgs } from '../../types/Yargs';
|
|
3
|
-
export declare const command = "remove [account]";
|
|
4
|
-
export declare const describe: string;
|
|
1
|
+
import { CommonArgs, ConfigArgs, YargsCommandModule } from '../../types/Yargs';
|
|
5
2
|
type AccountRemoveArgs = CommonArgs & ConfigArgs & {
|
|
6
3
|
account?: string;
|
|
7
4
|
};
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export {};
|
|
5
|
+
declare const accountRemoveCommand: YargsCommandModule<unknown, AccountRemoveArgs>;
|
|
6
|
+
export default accountRemoveCommand;
|
|
@@ -3,9 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.describe = exports.command = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
|
-
exports.builder = builder;
|
|
9
6
|
const fs_1 = __importDefault(require("fs"));
|
|
10
7
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
11
8
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
@@ -14,9 +11,9 @@ const lang_1 = require("../../lib/lang");
|
|
|
14
11
|
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
15
12
|
const errorHandlers_1 = require("../../lib/errorHandlers");
|
|
16
13
|
const accountsPrompt_1 = require("../../lib/prompts/accountsPrompt");
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
15
|
+
const command = 'remove [account]';
|
|
16
|
+
const describe = (0, lang_1.i18n)(`commands.account.subcommands.remove.describe`);
|
|
20
17
|
async function handler(args) {
|
|
21
18
|
const { account } = args;
|
|
22
19
|
let accountToRemove = account;
|
|
@@ -59,15 +56,19 @@ async function handler(args) {
|
|
|
59
56
|
}));
|
|
60
57
|
// Get updated version of the config
|
|
61
58
|
(0, config_1.loadConfig)((0, config_1.getConfigPath)());
|
|
62
|
-
|
|
59
|
+
const accountToRemoveId = (0, config_1.getAccountId)(accountToRemove);
|
|
60
|
+
let defaultAccountId;
|
|
61
|
+
if (currentDefaultAccount) {
|
|
62
|
+
defaultAccountId = (0, config_1.getAccountId)(currentDefaultAccount);
|
|
63
|
+
}
|
|
64
|
+
if (accountToRemoveId === defaultAccountId) {
|
|
63
65
|
logger_1.logger.log();
|
|
64
66
|
logger_1.logger.log((0, lang_1.i18n)(`commands.account.subcommands.remove.logs.replaceDefaultAccount`));
|
|
65
67
|
const newDefaultAccount = await (0, accountsPrompt_1.selectAccountFromConfig)();
|
|
66
68
|
(0, config_1.updateDefaultAccount)(newDefaultAccount);
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
|
-
function
|
|
70
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
71
|
+
function accountRemoveBuilder(yargs) {
|
|
71
72
|
yargs.positional('account', {
|
|
72
73
|
describe: (0, lang_1.i18n)(`commands.account.subcommands.remove.options.account.describe`),
|
|
73
74
|
type: 'string',
|
|
@@ -84,3 +85,14 @@ function builder(yargs) {
|
|
|
84
85
|
]);
|
|
85
86
|
return yargs;
|
|
86
87
|
}
|
|
88
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(accountRemoveBuilder, command, describe, {
|
|
89
|
+
useGlobalOptions: true,
|
|
90
|
+
useConfigOptions: true,
|
|
91
|
+
});
|
|
92
|
+
const accountRemoveCommand = {
|
|
93
|
+
command,
|
|
94
|
+
describe,
|
|
95
|
+
handler,
|
|
96
|
+
builder,
|
|
97
|
+
};
|
|
98
|
+
exports.default = accountRemoveCommand;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs } from '../../types/Yargs';
|
|
3
|
-
export declare const describe: string;
|
|
4
|
-
export declare const command = "remove-override";
|
|
1
|
+
import { CommonArgs, YargsCommandModule } from '../../types/Yargs';
|
|
5
2
|
type RemoveOverrideArgs = CommonArgs & {
|
|
6
3
|
force?: boolean;
|
|
7
4
|
};
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export {};
|
|
5
|
+
declare const accountRemoveOverrideCommand: YargsCommandModule<unknown, RemoveOverrideArgs>;
|
|
6
|
+
export default accountRemoveOverrideCommand;
|
|
@@ -3,24 +3,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.command = exports.describe = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
|
-
exports.builder = builder;
|
|
9
6
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
7
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
11
8
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
12
9
|
const config_2 = require("@hubspot/local-dev-lib/constants/config");
|
|
10
|
+
const migrate_1 = require("@hubspot/local-dev-lib/config/migrate");
|
|
13
11
|
const lang_1 = require("../../lib/lang");
|
|
14
12
|
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
15
13
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
16
14
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
17
15
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
18
|
-
|
|
16
|
+
const ui_1 = require("../../lib/ui");
|
|
17
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
18
|
+
const command = 'remove-override';
|
|
19
|
+
const describe = (0, lang_1.i18n)('commands.account.subcommands.removeOverride.describe', {
|
|
19
20
|
overrideFile: config_2.DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME,
|
|
20
21
|
});
|
|
21
|
-
exports.command = 'remove-override';
|
|
22
22
|
async function handler(args) {
|
|
23
23
|
const { force } = args;
|
|
24
|
+
const globalConfig = (0, migrate_1.getGlobalConfig)();
|
|
25
|
+
if (!globalConfig) {
|
|
26
|
+
logger_1.logger.error((0, lang_1.i18n)('commands.account.subcommands.createOverride.errors.globalConfigNotFound', {
|
|
27
|
+
authCommand: (0, ui_1.uiCommandReference)('hs account auth'),
|
|
28
|
+
}));
|
|
29
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
30
|
+
}
|
|
24
31
|
const accountOverride = (0, config_1.getCWDAccountOverride)();
|
|
25
32
|
const overrideFilePath = (0, config_1.getDefaultAccountOverrideFilePath)();
|
|
26
33
|
if (accountOverride && overrideFilePath) {
|
|
@@ -67,10 +74,20 @@ async function handler(args) {
|
|
|
67
74
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
68
75
|
}
|
|
69
76
|
}
|
|
70
|
-
function
|
|
77
|
+
function accountRemoveOverrideBuilder(yargs) {
|
|
71
78
|
yargs.options('force', {
|
|
72
79
|
describe: (0, lang_1.i18n)('commands.account.subcommands.removeOverride.options.force.describe'),
|
|
73
80
|
type: 'boolean',
|
|
74
81
|
});
|
|
75
82
|
return yargs;
|
|
76
83
|
}
|
|
84
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(accountRemoveOverrideBuilder, command, describe, {
|
|
85
|
+
useGlobalOptions: true,
|
|
86
|
+
});
|
|
87
|
+
const accountRemoveOverrideCommand = {
|
|
88
|
+
command,
|
|
89
|
+
describe,
|
|
90
|
+
handler,
|
|
91
|
+
builder,
|
|
92
|
+
};
|
|
93
|
+
exports.default = accountRemoveOverrideCommand;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs, ConfigArgs } from '../../types/Yargs';
|
|
3
|
-
export declare const command = "rename <account-name> <new-name>";
|
|
4
|
-
export declare const describe: string;
|
|
1
|
+
import { CommonArgs, ConfigArgs, YargsCommandModule } from '../../types/Yargs';
|
|
5
2
|
type AccountRenameArgs = CommonArgs & ConfigArgs & {
|
|
6
3
|
accountName: string;
|
|
7
4
|
newName: string;
|
|
8
5
|
};
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
6
|
+
declare const accountRenameCommand: YargsCommandModule<unknown, AccountRenameArgs>;
|
|
7
|
+
export default accountRenameCommand;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
7
4
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
8
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
9
5
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
10
6
|
const lang_1 = require("../../lib/lang");
|
|
11
7
|
const errorHandlers_1 = require("../../lib/errorHandlers");
|
|
12
8
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
10
|
+
const command = 'rename <account-name> <new-name>';
|
|
11
|
+
const describe = (0, lang_1.i18n)(`commands.account.subcommands.rename.describe`);
|
|
15
12
|
async function handler(args) {
|
|
16
13
|
const { accountName, newName, derivedAccountId } = args;
|
|
17
14
|
(0, usageTracking_1.trackCommandUsage)('accounts-rename', undefined, derivedAccountId);
|
|
@@ -28,9 +25,7 @@ async function handler(args) {
|
|
|
28
25
|
}));
|
|
29
26
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
30
27
|
}
|
|
31
|
-
function
|
|
32
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
33
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
28
|
+
function accountRenameBuilder(yargs) {
|
|
34
29
|
yargs.positional('account-name', {
|
|
35
30
|
describe: (0, lang_1.i18n)(`commands.account.subcommands.rename.positionals.accountName.describe`),
|
|
36
31
|
type: 'string',
|
|
@@ -44,3 +39,15 @@ function builder(yargs) {
|
|
|
44
39
|
]);
|
|
45
40
|
return yargs;
|
|
46
41
|
}
|
|
42
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(accountRenameBuilder, command, describe, {
|
|
43
|
+
useGlobalOptions: true,
|
|
44
|
+
useConfigOptions: true,
|
|
45
|
+
useAccountOptions: true,
|
|
46
|
+
});
|
|
47
|
+
const accountRenameCommand = {
|
|
48
|
+
command,
|
|
49
|
+
describe,
|
|
50
|
+
handler,
|
|
51
|
+
builder,
|
|
52
|
+
};
|
|
53
|
+
exports.default = accountRenameCommand;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "use [account]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
interface AccountUseArgs extends CommonArgs {
|
|
1
|
+
import { CommonArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type AccountUseArgs = CommonArgs & {
|
|
6
3
|
account?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export {};
|
|
4
|
+
};
|
|
5
|
+
declare const accountUseCommand: YargsCommandModule<unknown, AccountUseArgs>;
|
|
6
|
+
export default accountUseCommand;
|