@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.
Files changed (289) hide show
  1. package/bin/cli.js +5 -6
  2. package/bin/hsmcp.d.ts +2 -0
  3. package/bin/hsmcp.js +13 -0
  4. package/commands/account/auth.d.ts +3 -7
  5. package/commands/account/auth.js +19 -9
  6. package/commands/account/clean.d.ts +3 -7
  7. package/commands/account/clean.js +16 -9
  8. package/commands/account/createOverride.d.ts +3 -7
  9. package/commands/account/createOverride.js +23 -6
  10. package/commands/account/info.d.ts +3 -7
  11. package/commands/account/info.js +13 -5
  12. package/commands/account/list.d.ts +3 -7
  13. package/commands/account/list.js +15 -8
  14. package/commands/account/remove.d.ts +3 -7
  15. package/commands/account/remove.js +21 -9
  16. package/commands/account/removeOverride.d.ts +3 -7
  17. package/commands/account/removeOverride.js +23 -6
  18. package/commands/account/rename.d.ts +3 -7
  19. package/commands/account/rename.js +16 -9
  20. package/commands/account/use.d.ts +5 -9
  21. package/commands/account/use.js +14 -6
  22. package/commands/account.d.ts +3 -4
  23. package/commands/account.js +35 -58
  24. package/commands/app/migrate.d.ts +1 -2
  25. package/commands/app/migrate.js +7 -8
  26. package/commands/app/secret/add.d.ts +7 -0
  27. package/commands/app/secret/add.js +64 -0
  28. package/commands/app/secret/delete.d.ts +8 -0
  29. package/commands/app/secret/delete.js +87 -0
  30. package/commands/app/secret/list.d.ts +6 -0
  31. package/commands/app/secret/list.js +64 -0
  32. package/commands/app/secret/update.d.ts +7 -0
  33. package/commands/app/secret/update.js +77 -0
  34. package/commands/app/secret.d.ts +3 -0
  35. package/commands/app/secret.js +30 -0
  36. package/commands/app.d.ts +2 -5
  37. package/commands/app.js +12 -8
  38. package/commands/auth.d.ts +3 -7
  39. package/commands/auth.js +12 -5
  40. package/commands/cms/convertFields.d.ts +7 -1
  41. package/commands/cms/convertFields.js +57 -41
  42. package/commands/cms/getReactModule.d.ts +7 -1
  43. package/commands/cms/getReactModule.js +52 -34
  44. package/commands/cms/lighthouseScore.d.ts +8 -1
  45. package/commands/cms/lighthouseScore.js +129 -100
  46. package/commands/cms.d.ts +3 -1
  47. package/commands/cms.js +24 -15
  48. package/commands/completion.d.ts +3 -1
  49. package/commands/completion.js +25 -12
  50. package/commands/config/migrate.d.ts +3 -7
  51. package/commands/config/migrate.js +25 -15
  52. package/commands/config/set.d.ts +5 -6
  53. package/commands/config/set.js +38 -14
  54. package/commands/config.d.ts +3 -4
  55. package/commands/config.js +20 -44
  56. package/commands/create/api-sample.d.ts +3 -1
  57. package/commands/create/api-sample.js +34 -38
  58. package/commands/create/app.d.ts +3 -1
  59. package/commands/create/app.js +9 -7
  60. package/commands/create/function.d.ts +3 -1
  61. package/commands/create/function.js +11 -10
  62. package/commands/create/index.d.ts +5 -1
  63. package/commands/create/index.js +23 -11
  64. package/commands/create/module.d.ts +3 -1
  65. package/commands/create/module.js +14 -13
  66. package/commands/create/react-app.d.ts +3 -1
  67. package/commands/create/react-app.js +10 -7
  68. package/commands/create/template.d.ts +3 -1
  69. package/commands/create/template.js +14 -14
  70. package/commands/create/vue-app.d.ts +3 -1
  71. package/commands/create/vue-app.js +10 -7
  72. package/commands/create/webpack-serverless.d.ts +3 -1
  73. package/commands/create/webpack-serverless.js +10 -7
  74. package/commands/create/website-theme.d.ts +3 -1
  75. package/commands/create/website-theme.js +10 -9
  76. package/commands/create.d.ts +4 -24
  77. package/commands/create.js +64 -74
  78. package/commands/customObject/create.d.ts +4 -9
  79. package/commands/customObject/create.js +17 -10
  80. package/commands/customObject/schema/create.d.ts +4 -9
  81. package/commands/customObject/schema/create.js +18 -11
  82. package/commands/customObject/schema/delete.d.ts +4 -9
  83. package/commands/customObject/schema/delete.js +17 -10
  84. package/commands/customObject/schema/fetch-all.d.ts +4 -9
  85. package/commands/customObject/schema/fetch-all.js +17 -10
  86. package/commands/customObject/schema/fetch.d.ts +4 -9
  87. package/commands/customObject/schema/fetch.js +17 -10
  88. package/commands/customObject/schema/list.d.ts +4 -8
  89. package/commands/customObject/schema/list.js +17 -10
  90. package/commands/customObject/schema/update.d.ts +4 -9
  91. package/commands/customObject/schema/update.js +18 -11
  92. package/commands/customObject/schema.d.ts +3 -5
  93. package/commands/customObject/schema.js +27 -54
  94. package/commands/customObject.d.ts +3 -4
  95. package/commands/customObject.js +20 -45
  96. package/commands/doctor.d.ts +6 -8
  97. package/commands/doctor.js +32 -21
  98. package/commands/feedback.d.ts +4 -1
  99. package/commands/feedback.js +40 -47
  100. package/commands/fetch.d.ts +12 -1
  101. package/commands/fetch.js +49 -33
  102. package/commands/filemanager/fetch.d.ts +4 -9
  103. package/commands/filemanager/fetch.js +18 -11
  104. package/commands/filemanager/upload.d.ts +4 -9
  105. package/commands/filemanager/upload.js +17 -11
  106. package/commands/filemanager.d.ts +3 -4
  107. package/commands/filemanager.js +20 -41
  108. package/commands/function/deploy.d.ts +6 -1
  109. package/commands/function/deploy.js +70 -50
  110. package/commands/function/list.d.ts +6 -1
  111. package/commands/function/list.js +44 -32
  112. package/commands/function/server.d.ts +10 -1
  113. package/commands/function/server.js +49 -38
  114. package/commands/function.d.ts +5 -1
  115. package/commands/function.js +24 -10
  116. package/commands/hubdb/clear.d.ts +4 -9
  117. package/commands/hubdb/clear.js +17 -10
  118. package/commands/hubdb/create.d.ts +4 -9
  119. package/commands/hubdb/create.js +17 -10
  120. package/commands/hubdb/delete.d.ts +4 -9
  121. package/commands/hubdb/delete.js +17 -10
  122. package/commands/hubdb/fetch.d.ts +4 -9
  123. package/commands/hubdb/fetch.js +17 -10
  124. package/commands/hubdb.d.ts +3 -2
  125. package/commands/hubdb.js +23 -45
  126. package/commands/init.d.ts +3 -7
  127. package/commands/init.js +12 -5
  128. package/commands/lint.d.ts +6 -4
  129. package/commands/lint.js +44 -43
  130. package/commands/list.d.ts +3 -7
  131. package/commands/list.js +19 -11
  132. package/commands/logs.d.ts +10 -1
  133. package/commands/logs.js +53 -44
  134. package/commands/module/marketplace-validate.d.ts +6 -1
  135. package/commands/module/marketplace-validate.js +39 -27
  136. package/commands/module.d.ts +3 -1
  137. package/commands/module.js +22 -10
  138. package/commands/mv.d.ts +3 -7
  139. package/commands/mv.js +19 -11
  140. package/commands/open.d.ts +3 -7
  141. package/commands/open.js +19 -11
  142. package/commands/project/cloneApp.d.ts +1 -1
  143. package/commands/project/cloneApp.js +2 -2
  144. package/commands/project/create.js +3 -3
  145. package/commands/project/deploy.d.ts +1 -0
  146. package/commands/project/deploy.js +40 -12
  147. package/commands/project/dev/index.d.ts +1 -4
  148. package/commands/project/dev/index.js +48 -16
  149. package/commands/project/dev/unifiedFlow.d.ts +2 -1
  150. package/commands/project/dev/unifiedFlow.js +85 -30
  151. package/commands/project/migrate.d.ts +1 -0
  152. package/commands/project/profile/add.d.ts +7 -0
  153. package/commands/project/profile/add.js +209 -0
  154. package/commands/project/profile/delete.d.ts +6 -0
  155. package/commands/project/profile/delete.js +123 -0
  156. package/commands/project/profile.d.ts +3 -0
  157. package/commands/project/profile.js +25 -0
  158. package/commands/project/upload.d.ts +1 -0
  159. package/commands/project/upload.js +38 -8
  160. package/commands/project/validate.d.ts +4 -0
  161. package/commands/project/validate.js +53 -0
  162. package/commands/project.js +4 -0
  163. package/commands/remove.d.ts +3 -7
  164. package/commands/remove.js +19 -11
  165. package/commands/sandbox/create.d.ts +4 -9
  166. package/commands/sandbox/create.js +18 -11
  167. package/commands/sandbox/delete.d.ts +4 -9
  168. package/commands/sandbox/delete.js +18 -11
  169. package/commands/sandbox.d.ts +3 -4
  170. package/commands/sandbox.js +20 -43
  171. package/commands/secret/addSecret.d.ts +4 -9
  172. package/commands/secret/addSecret.js +17 -10
  173. package/commands/secret/deleteSecret.d.ts +4 -9
  174. package/commands/secret/deleteSecret.js +17 -10
  175. package/commands/secret/listSecret.d.ts +4 -9
  176. package/commands/secret/listSecret.js +17 -10
  177. package/commands/secret/updateSecret.d.ts +4 -9
  178. package/commands/secret/updateSecret.js +17 -10
  179. package/commands/secret.d.ts +3 -4
  180. package/commands/secret.js +25 -48
  181. package/commands/setupMcp.d.ts +8 -0
  182. package/commands/setupMcp.js +229 -0
  183. package/commands/theme/generate-selectors.d.ts +3 -7
  184. package/commands/theme/generate-selectors.js +14 -6
  185. package/commands/theme/marketplace-validate.d.ts +4 -9
  186. package/commands/theme/marketplace-validate.js +17 -10
  187. package/commands/theme/preview.d.ts +4 -9
  188. package/commands/theme/preview.js +16 -9
  189. package/commands/theme.d.ts +3 -4
  190. package/commands/theme.js +23 -46
  191. package/commands/upload.d.ts +12 -1
  192. package/commands/upload.js +118 -97
  193. package/commands/watch.d.ts +14 -1
  194. package/commands/watch.js +76 -65
  195. package/lang/en.d.ts +838 -574
  196. package/lang/en.js +630 -373
  197. package/lang/en.lyaml +30 -23
  198. package/lib/accountTypes.js +2 -1
  199. package/lib/app/migrate.d.ts +23 -0
  200. package/lib/app/migrate.js +14 -3
  201. package/lib/app/migrate_legacy.js +7 -7
  202. package/lib/app/urls.d.ts +16 -0
  203. package/lib/app/urls.js +16 -0
  204. package/lib/configMigrate.js +24 -10
  205. package/lib/configOptions.d.ts +4 -0
  206. package/lib/configOptions.js +41 -46
  207. package/lib/constants.d.ts +6 -0
  208. package/lib/constants.js +7 -1
  209. package/lib/dependencyManagement.d.ts +0 -5
  210. package/lib/dependencyManagement.js +13 -39
  211. package/lib/doctor/Doctor.js +2 -1
  212. package/lib/filesystem.d.ts +1 -1
  213. package/lib/interpolation.d.ts +2 -3
  214. package/lib/lang.d.ts +2 -3
  215. package/lib/middleware/autoUpdateMiddleware.d.ts +1 -0
  216. package/lib/middleware/autoUpdateMiddleware.js +89 -0
  217. package/lib/middleware/configMiddleware.js +8 -0
  218. package/lib/npm.d.ts +9 -0
  219. package/lib/npm.js +36 -0
  220. package/lib/projectProfiles.d.ts +6 -0
  221. package/lib/projectProfiles.js +65 -0
  222. package/lib/projects/buildAndDeploy.js +17 -2
  223. package/lib/projects/localDev/AppDevModeInterface.d.ts +26 -0
  224. package/lib/projects/localDev/AppDevModeInterface.js +156 -0
  225. package/lib/projects/localDev/DevServerManagerV2.d.ts +11 -22
  226. package/lib/projects/localDev/DevServerManagerV2.js +19 -15
  227. package/lib/projects/localDev/LocalDevLogger.d.ts +30 -0
  228. package/lib/projects/localDev/LocalDevLogger.js +158 -0
  229. package/lib/projects/localDev/LocalDevManager.js +12 -5
  230. package/lib/projects/localDev/LocalDevProcess.d.ts +27 -0
  231. package/lib/projects/localDev/LocalDevProcess.js +171 -0
  232. package/lib/projects/localDev/LocalDevState.d.ts +37 -0
  233. package/lib/projects/localDev/LocalDevState.js +78 -0
  234. package/lib/projects/localDev/LocalDevWatcher.d.ts +10 -0
  235. package/lib/projects/localDev/LocalDevWatcher.js +56 -0
  236. package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +17 -0
  237. package/lib/projects/localDev/LocalDevWebsocketServer.js +92 -0
  238. package/lib/projects/localDev/helpers.d.ts +3 -2
  239. package/lib/projects/localDev/helpers.js +32 -2
  240. package/lib/projects/upload.d.ts +2 -1
  241. package/lib/projects/upload.js +2 -2
  242. package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
  243. package/lib/prompts/createTemplatePrompt.d.ts +22 -4
  244. package/lib/prompts/installAppPrompt.d.ts +1 -0
  245. package/lib/prompts/installAppPrompt.js +35 -0
  246. package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
  247. package/lib/prompts/projectDevTargetAccountPrompt.js +6 -6
  248. package/lib/prompts/promptUtils.d.ts +2 -1
  249. package/lib/prompts/promptUtils.js +2 -1
  250. package/lib/prompts/selectAppPrompt.d.ts +2 -0
  251. package/lib/prompts/selectAppPrompt.js +40 -0
  252. package/lib/prompts/{selectPublicAppPrompt.d.ts → selectPublicAppForMigrationPrompt.d.ts} +1 -1
  253. package/lib/prompts/{selectPublicAppPrompt.js → selectPublicAppForMigrationPrompt.js} +8 -8
  254. package/lib/testUtils.d.ts +3 -3
  255. package/lib/testUtils.js +8 -9
  256. package/lib/ui/index.js +4 -1
  257. package/lib/upload.d.ts +1 -1
  258. package/lib/validation.js +4 -5
  259. package/lib/yargsUtils.d.ts +4 -0
  260. package/lib/yargsUtils.js +6 -0
  261. package/mcp-server/index.d.ts +1 -0
  262. package/mcp-server/index.js +17 -0
  263. package/mcp-server/mcpLoader.d.ts +5 -0
  264. package/mcp-server/mcpLoader.js +24 -0
  265. package/mcp-server/tools/ExplainProjectStructureTool.d.ts +33 -0
  266. package/mcp-server/tools/ExplainProjectStructureTool.js +266 -0
  267. package/mcp-server/tools/GenerateAppComponentTool.d.ts +99 -0
  268. package/mcp-server/tools/GenerateAppComponentTool.js +193 -0
  269. package/mcp-server/tools/GenerateCardComponentTool.d.ts +74 -0
  270. package/mcp-server/tools/GenerateCardComponentTool.js +146 -0
  271. package/mcp-server/tools/GenerateProjectConfigTool.d.ts +32 -0
  272. package/mcp-server/tools/GenerateProjectConfigTool.js +40 -0
  273. package/mcp-server/tools/HubSpotCLIHelper.d.ts +16 -0
  274. package/mcp-server/tools/HubSpotCLIHelper.js +74 -0
  275. package/mcp-server/tools/UploadProjectTool.d.ts +44 -0
  276. package/mcp-server/tools/UploadProjectTool.js +149 -0
  277. package/mcp-server/tools/ValidateProjectTool.d.ts +62 -0
  278. package/mcp-server/tools/ValidateProjectTool.js +315 -0
  279. package/package.json +13 -6
  280. package/types/Cms.d.ts +30 -0
  281. package/types/Cms.js +2 -0
  282. package/types/LocalDev.d.ts +24 -0
  283. package/types/LocalDev.js +2 -0
  284. package/types/Prompts.d.ts +0 -7
  285. package/types/Yargs.d.ts +8 -1
  286. package/lib/projects/localDev/LocalDevManagerV2.d.ts +0 -64
  287. package/lib/projects/localDev/LocalDevManagerV2.js +0 -345
  288. package/lib/prompts/installPublicAppPrompt.d.ts +0 -1
  289. 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 { notifyAboutUpdates, } = require('../lib/middleware/notificationsMiddleware');
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
- notifyAboutUpdates();
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
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
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 { Argv, ArgumentsCamelCase } from 'yargs';
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
- export declare function handler(args: ArgumentsCamelCase<AccountAuthArgs>): Promise<void>;
9
- export declare function builder(yargs: Argv): Argv<AccountAuthArgs>;
10
- export {};
5
+ declare const accountAuthCommand: YargsCommandModule<unknown, AccountAuthArgs>;
6
+ export default accountAuthCommand;
@@ -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 commonOpts_1 = require("../../lib/commonOpts");
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
- exports.describe = (0, lang_1.i18n)('commands.account.subcommands.auth.describe');
159
- exports.command = 'auth';
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 builder(yargs) {
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 { Argv, ArgumentsCamelCase } from 'yargs';
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
- export declare function handler(args: ArgumentsCamelCase<AccountCleanArgs>): Promise<void>;
9
- export declare function builder(yargs: Argv): Argv<AccountCleanArgs>;
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
- exports.command = 'clean';
27
- exports.describe = (0, lang_1.i18n)(`commands.account.subcommands.clean.describe`);
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 builder(yargs) {
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 { Argv, ArgumentsCamelCase } from 'yargs';
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
- export declare function handler(args: ArgumentsCamelCase<AccountCreateOverrideArgs>): Promise<void>;
9
- export declare function builder(yargs: Argv): Argv<AccountCreateOverrideArgs>;
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
- exports.describe = (0, lang_1.i18n)('commands.account.subcommands.createOverride.describe', {
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 builder(yargs) {
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 { Argv, ArgumentsCamelCase } from 'yargs';
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
- export declare function handler(args: ArgumentsCamelCase<AccountInfoArgs>): Promise<void>;
7
- export declare const builder: (yargs: Argv) => Promise<Argv<AccountInfoArgs>>;
8
- export {};
3
+ declare const accountInfoCommand: YargsCommandModule<unknown, AccountInfoArgs>;
4
+ export default accountInfoCommand;
@@ -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
- exports.describe = (0, lang_1.i18n)(`commands.account.subcommands.info.describe`);
13
- exports.command = 'info [account]';
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
- exports.builder = (0, yargsUtils_1.makeYargsBuilder)(accountInfoBuilder, exports.command, exports.describe, { useConfigOptions: true });
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 { Argv, ArgumentsCamelCase } from 'yargs';
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
- export declare function handler(args: ArgumentsCamelCase<AccountListArgs>): Promise<void>;
7
- export declare function builder(yargs: Argv): Argv<AccountListArgs>;
8
- export {};
3
+ declare const accountListCommand: YargsCommandModule<unknown, AccountListArgs>;
4
+ export default accountListCommand;
@@ -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
- exports.command = ['list', 'ls'];
17
- exports.describe = (0, lang_1.i18n)('commands.account.subcommands.list.describe');
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 builder(yargs) {
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 { Argv, ArgumentsCamelCase } from 'yargs';
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
- export declare function handler(args: ArgumentsCamelCase<AccountRemoveArgs>): Promise<void>;
9
- export declare function builder(yargs: Argv): Argv<AccountRemoveArgs>;
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 commonOpts_1 = require("../../lib/commonOpts");
18
- exports.command = 'remove [account]';
19
- exports.describe = (0, lang_1.i18n)(`commands.account.subcommands.remove.describe`);
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
- if (accountToRemove === currentDefaultAccount) {
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 builder(yargs) {
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 { Argv, ArgumentsCamelCase } from 'yargs';
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
- export declare function handler(args: ArgumentsCamelCase<RemoveOverrideArgs>): Promise<void>;
9
- export declare function builder(yargs: Argv): Argv<RemoveOverrideArgs>;
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
- exports.describe = (0, lang_1.i18n)('commands.account.subcommands.removeOverride.describe', {
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 builder(yargs) {
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 { Argv, ArgumentsCamelCase } from 'yargs';
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
- export declare function handler(args: ArgumentsCamelCase<AccountRenameArgs>): Promise<void>;
10
- export declare function builder(yargs: Argv): Argv<AccountRenameArgs>;
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
- exports.command = 'rename <account-name> <new-name>';
14
- exports.describe = (0, lang_1.i18n)(`commands.account.subcommands.rename.describe`);
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 builder(yargs) {
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 { Argv, ArgumentsCamelCase } from 'yargs';
2
- import { CommonArgs } from '../../types/Yargs';
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
- export declare function handler(args: ArgumentsCamelCase<AccountUseArgs>): Promise<void>;
9
- export declare function builder(yargs: Argv): Argv<AccountUseArgs>;
10
- export {};
4
+ };
5
+ declare const accountUseCommand: YargsCommandModule<unknown, AccountUseArgs>;
6
+ export default accountUseCommand;