@hubspot/cli 7.6.0-beta.3 → 7.6.0-beta.4

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 (324) hide show
  1. package/api/__tests__/migrate.test.d.ts +1 -0
  2. package/api/__tests__/migrate.test.js +183 -0
  3. package/bin/cli.js +6 -2
  4. package/commands/__tests__/account.test.d.ts +1 -0
  5. package/commands/__tests__/account.test.js +74 -0
  6. package/commands/__tests__/auth.test.d.ts +1 -0
  7. package/commands/__tests__/auth.test.js +43 -0
  8. package/commands/__tests__/cms.test.d.ts +1 -0
  9. package/commands/__tests__/cms.test.js +49 -0
  10. package/commands/__tests__/config.test.d.ts +1 -0
  11. package/commands/__tests__/config.test.js +49 -0
  12. package/commands/__tests__/create.test.d.ts +1 -0
  13. package/commands/__tests__/create.test.js +38 -0
  14. package/commands/__tests__/customObject.test.d.ts +1 -0
  15. package/commands/__tests__/customObject.test.js +54 -0
  16. package/commands/__tests__/doctor.test.d.ts +1 -0
  17. package/commands/__tests__/doctor.test.js +139 -0
  18. package/commands/__tests__/feedback.test.d.ts +1 -0
  19. package/commands/__tests__/feedback.test.js +62 -0
  20. package/commands/__tests__/fetch.test.d.ts +1 -0
  21. package/commands/__tests__/fetch.test.js +56 -0
  22. package/commands/__tests__/filemanager.test.d.ts +1 -0
  23. package/commands/__tests__/filemanager.test.js +50 -0
  24. package/commands/__tests__/function.test.d.ts +1 -0
  25. package/commands/__tests__/function.test.js +51 -0
  26. package/commands/__tests__/getStarted.test.d.ts +1 -0
  27. package/commands/__tests__/getStarted.test.js +170 -0
  28. package/commands/__tests__/hubdb.test.d.ts +1 -0
  29. package/commands/__tests__/hubdb.test.js +55 -0
  30. package/commands/__tests__/init.test.d.ts +1 -0
  31. package/commands/__tests__/init.test.js +47 -0
  32. package/commands/__tests__/lint.test.d.ts +1 -0
  33. package/commands/__tests__/lint.test.js +38 -0
  34. package/commands/__tests__/list.test.d.ts +1 -0
  35. package/commands/__tests__/list.test.js +47 -0
  36. package/commands/__tests__/logs.test.d.ts +1 -0
  37. package/commands/__tests__/logs.test.js +70 -0
  38. package/commands/__tests__/mcp.test.d.ts +1 -0
  39. package/commands/__tests__/mcp.test.js +51 -0
  40. package/commands/__tests__/mv.test.d.ts +1 -0
  41. package/commands/__tests__/mv.test.js +84 -0
  42. package/commands/__tests__/open.test.d.ts +1 -0
  43. package/commands/__tests__/open.test.js +96 -0
  44. package/commands/__tests__/project.test.d.ts +1 -0
  45. package/commands/__tests__/project.test.js +100 -0
  46. package/commands/__tests__/remove.test.d.ts +1 -0
  47. package/commands/__tests__/remove.test.js +77 -0
  48. package/commands/__tests__/sandbox.test.d.ts +1 -0
  49. package/commands/__tests__/sandbox.test.js +49 -0
  50. package/commands/__tests__/secret.test.d.ts +1 -0
  51. package/commands/__tests__/secret.test.js +54 -0
  52. package/commands/__tests__/testAccount.test.d.ts +1 -0
  53. package/commands/__tests__/testAccount.test.js +60 -0
  54. package/commands/__tests__/theme.test.d.ts +1 -0
  55. package/commands/__tests__/theme.test.js +52 -0
  56. package/commands/account/__tests__/auth.test.d.ts +1 -0
  57. package/commands/account/__tests__/auth.test.js +31 -0
  58. package/commands/account/__tests__/clean.test.d.ts +1 -0
  59. package/commands/account/__tests__/clean.test.js +33 -0
  60. package/commands/account/__tests__/createOverride.test.d.ts +1 -0
  61. package/commands/account/__tests__/createOverride.test.js +37 -0
  62. package/commands/account/__tests__/info.test.d.ts +1 -0
  63. package/commands/account/__tests__/info.test.js +33 -0
  64. package/commands/account/__tests__/list.test.d.ts +1 -0
  65. package/commands/account/__tests__/list.test.js +33 -0
  66. package/commands/account/__tests__/remove.test.d.ts +1 -0
  67. package/commands/account/__tests__/remove.test.js +41 -0
  68. package/commands/account/__tests__/removeOverride.d.ts +1 -0
  69. package/commands/account/__tests__/removeOverride.js +30 -0
  70. package/commands/account/__tests__/rename.test.d.ts +1 -0
  71. package/commands/account/__tests__/rename.test.js +47 -0
  72. package/commands/account/__tests__/use.test.d.ts +1 -0
  73. package/commands/account/__tests__/use.test.js +37 -0
  74. package/commands/app/__tests__/migrate.test.d.ts +1 -0
  75. package/commands/app/__tests__/migrate.test.js +129 -0
  76. package/commands/app/secret/__tests__/add.test.d.ts +1 -0
  77. package/commands/app/secret/__tests__/add.test.js +33 -0
  78. package/commands/app/secret/__tests__/delete.test.d.ts +1 -0
  79. package/commands/app/secret/__tests__/delete.test.js +33 -0
  80. package/commands/app/secret/__tests__/list.test.d.ts +1 -0
  81. package/commands/app/secret/__tests__/list.test.js +30 -0
  82. package/commands/app/secret/__tests__/update.test.d.ts +1 -0
  83. package/commands/app/secret/__tests__/update.test.js +33 -0
  84. package/commands/customObject/__tests__/create.test.d.ts +1 -0
  85. package/commands/customObject/__tests__/create.test.js +45 -0
  86. package/commands/customObject/__tests__/schema.test.d.ts +1 -0
  87. package/commands/customObject/__tests__/schema.test.js +58 -0
  88. package/commands/customObject/schema/__tests__/create.test.d.ts +1 -0
  89. package/commands/customObject/schema/__tests__/create.test.js +33 -0
  90. package/commands/customObject/schema/__tests__/delete.test.d.ts +1 -0
  91. package/commands/customObject/schema/__tests__/delete.test.js +47 -0
  92. package/commands/customObject/schema/__tests__/fetch-all.test.d.ts +1 -0
  93. package/commands/customObject/schema/__tests__/fetch-all.test.js +46 -0
  94. package/commands/customObject/schema/__tests__/fetch.test.d.ts +1 -0
  95. package/commands/customObject/schema/__tests__/fetch.test.js +50 -0
  96. package/commands/customObject/schema/__tests__/list.test.d.ts +1 -0
  97. package/commands/customObject/schema/__tests__/list.test.js +34 -0
  98. package/commands/customObject/schema/__tests__/update.test.d.ts +1 -0
  99. package/commands/customObject/schema/__tests__/update.test.js +45 -0
  100. package/commands/fetch.js +0 -1
  101. package/commands/filemanager/__tests__/fetch.test.d.ts +1 -0
  102. package/commands/filemanager/__tests__/fetch.test.js +37 -0
  103. package/commands/filemanager/__tests__/upload.test.d.ts +1 -0
  104. package/commands/filemanager/__tests__/upload.test.js +35 -0
  105. package/commands/getStarted.js +8 -14
  106. package/commands/hubdb/__tests__/clear.test.d.ts +1 -0
  107. package/commands/hubdb/__tests__/clear.test.js +33 -0
  108. package/commands/hubdb/__tests__/create.test.d.ts +1 -0
  109. package/commands/hubdb/__tests__/create.test.js +33 -0
  110. package/commands/hubdb/__tests__/delete.test.d.ts +1 -0
  111. package/commands/hubdb/__tests__/delete.test.js +33 -0
  112. package/commands/hubdb/__tests__/fetch.test.d.ts +1 -0
  113. package/commands/hubdb/__tests__/fetch.test.js +33 -0
  114. package/commands/hubdb/__tests__/list.test.d.ts +1 -0
  115. package/commands/hubdb/__tests__/list.test.js +101 -0
  116. package/commands/logs.js +0 -1
  117. package/commands/mcp/__tests__/setup.test.d.ts +1 -0
  118. package/commands/mcp/__tests__/setup.test.js +31 -0
  119. package/commands/mcp/__tests__/start.test.d.ts +1 -0
  120. package/commands/mcp/__tests__/start.test.js +32 -0
  121. package/commands/mcp/setup.js +1 -0
  122. package/commands/mcp/start.d.ts +4 -1
  123. package/commands/mcp/start.js +8 -3
  124. package/commands/open.js +14 -12
  125. package/commands/project/__tests__/add.test.d.ts +1 -0
  126. package/commands/project/__tests__/add.test.js +48 -0
  127. package/commands/project/__tests__/create.test.d.ts +1 -0
  128. package/commands/project/__tests__/create.test.js +45 -0
  129. package/commands/project/__tests__/deploy.test.d.ts +1 -0
  130. package/commands/project/__tests__/deploy.test.js +350 -0
  131. package/commands/project/__tests__/devUnifiedFlow.test.d.ts +1 -0
  132. package/commands/project/__tests__/devUnifiedFlow.test.js +419 -0
  133. package/commands/project/__tests__/download.test.d.ts +1 -0
  134. package/commands/project/__tests__/download.test.js +44 -0
  135. package/commands/project/__tests__/fixtures/exampleProject.json +33 -0
  136. package/commands/project/__tests__/installDeps.test.d.ts +1 -0
  137. package/commands/project/__tests__/installDeps.test.js +180 -0
  138. package/commands/project/__tests__/listBuilds.test.d.ts +1 -0
  139. package/commands/project/__tests__/listBuilds.test.js +43 -0
  140. package/commands/project/__tests__/logs.test.d.ts +1 -0
  141. package/commands/project/__tests__/logs.test.js +246 -0
  142. package/commands/project/__tests__/migrate.test.d.ts +1 -0
  143. package/commands/project/__tests__/migrate.test.js +116 -0
  144. package/commands/project/__tests__/migrateApp.test.d.ts +1 -0
  145. package/commands/project/__tests__/migrateApp.test.js +87 -0
  146. package/commands/project/__tests__/open.test.d.ts +1 -0
  147. package/commands/project/__tests__/open.test.js +44 -0
  148. package/commands/project/__tests__/profile.test.d.ts +1 -0
  149. package/commands/project/__tests__/profile.test.js +47 -0
  150. package/commands/project/__tests__/upload.test.d.ts +1 -0
  151. package/commands/project/__tests__/upload.test.js +48 -0
  152. package/commands/project/__tests__/watch.test.d.ts +1 -0
  153. package/commands/project/__tests__/watch.test.js +40 -0
  154. package/commands/project/deploy.d.ts +1 -0
  155. package/commands/project/deploy.js +21 -10
  156. package/commands/sandbox/__tests__/create.test.d.ts +1 -0
  157. package/commands/sandbox/__tests__/create.test.js +36 -0
  158. package/commands/sandbox/__tests__/delete.test.d.ts +1 -0
  159. package/commands/sandbox/__tests__/delete.test.js +36 -0
  160. package/commands/secret/__tests__/addSecret.test.d.ts +1 -0
  161. package/commands/secret/__tests__/addSecret.test.js +34 -0
  162. package/commands/secret/__tests__/deleteSecret.test.d.ts +1 -0
  163. package/commands/secret/__tests__/deleteSecret.test.js +46 -0
  164. package/commands/secret/__tests__/listSecret.test.d.ts +1 -0
  165. package/commands/secret/__tests__/listSecret.test.js +34 -0
  166. package/commands/secret/__tests__/updateSecret.test.d.ts +1 -0
  167. package/commands/secret/__tests__/updateSecret.test.js +34 -0
  168. package/commands/testAccount/__tests__/create.test.d.ts +1 -0
  169. package/commands/testAccount/__tests__/create.test.js +38 -0
  170. package/commands/testAccount/__tests__/createConfig.test.d.ts +1 -0
  171. package/commands/testAccount/__tests__/createConfig.test.js +37 -0
  172. package/commands/testAccount/__tests__/delete.test.d.ts +1 -0
  173. package/commands/testAccount/__tests__/delete.test.js +36 -0
  174. package/commands/testAccount/create.js +16 -3
  175. package/commands/testAccount/createConfig.d.ts +0 -2
  176. package/commands/testAccount/createConfig.js +7 -8
  177. package/commands/theme/__tests__/generate-selectors.test.d.ts +1 -0
  178. package/commands/theme/__tests__/generate-selectors.test.js +33 -0
  179. package/commands/theme/__tests__/marketplace-validate.test.d.ts +1 -0
  180. package/commands/theme/__tests__/marketplace-validate.test.js +41 -0
  181. package/commands/theme/__tests__/preview.test.d.ts +1 -0
  182. package/commands/theme/__tests__/preview.test.js +65 -0
  183. package/lang/en.d.ts +15 -2
  184. package/lang/en.js +15 -2
  185. package/lib/__tests__/accountTypes.test.d.ts +1 -0
  186. package/lib/__tests__/accountTypes.test.js +100 -0
  187. package/lib/__tests__/buildAccount.test.d.ts +1 -0
  188. package/lib/__tests__/buildAccount.test.js +231 -0
  189. package/lib/__tests__/commonOpts.test.d.ts +1 -0
  190. package/lib/__tests__/commonOpts.test.js +87 -0
  191. package/lib/__tests__/dependencyManagement.test.d.ts +1 -0
  192. package/lib/__tests__/dependencyManagement.test.js +180 -0
  193. package/lib/__tests__/developerTestAccounts.test.d.ts +1 -0
  194. package/lib/__tests__/developerTestAccounts.test.js +180 -0
  195. package/lib/__tests__/hasFeature.test.d.ts +1 -0
  196. package/lib/__tests__/hasFeature.test.js +37 -0
  197. package/lib/__tests__/npm.test.d.ts +1 -0
  198. package/lib/__tests__/npm.test.js +62 -0
  199. package/lib/__tests__/oauth.test.d.ts +1 -0
  200. package/lib/__tests__/oauth.test.js +113 -0
  201. package/lib/__tests__/parsing.test.d.ts +1 -0
  202. package/lib/__tests__/parsing.test.js +36 -0
  203. package/lib/__tests__/polling.test.d.ts +1 -0
  204. package/lib/__tests__/polling.test.js +78 -0
  205. package/lib/__tests__/process.test.d.ts +1 -0
  206. package/lib/__tests__/process.test.js +90 -0
  207. package/lib/__tests__/projectProfiles.test.d.ts +1 -0
  208. package/lib/__tests__/projectProfiles.test.js +134 -0
  209. package/lib/__tests__/sandboxSync.test.d.ts +1 -0
  210. package/lib/__tests__/sandboxSync.test.js +131 -0
  211. package/lib/__tests__/sandboxes.test.d.ts +1 -0
  212. package/lib/__tests__/sandboxes.test.js +148 -0
  213. package/lib/__tests__/serverlessLogs.test.d.ts +1 -0
  214. package/lib/__tests__/serverlessLogs.test.js +154 -0
  215. package/lib/__tests__/usageTracking.test.d.ts +1 -0
  216. package/lib/__tests__/usageTracking.test.js +165 -0
  217. package/lib/__tests__/validation.test.d.ts +1 -0
  218. package/lib/__tests__/validation.test.js +145 -0
  219. package/lib/__tests__/yargsUtils.test.d.ts +1 -0
  220. package/lib/__tests__/yargsUtils.test.js +74 -0
  221. package/lib/app/__tests__/migrate.test.d.ts +1 -0
  222. package/lib/app/__tests__/migrate.test.js +495 -0
  223. package/lib/app/__tests__/migrate_legacy.test.d.ts +1 -0
  224. package/lib/app/__tests__/migrate_legacy.test.js +136 -0
  225. package/lib/app/migrate.js +2 -6
  226. package/lib/dependencyManagement.d.ts +1 -1
  227. package/lib/dependencyManagement.js +2 -2
  228. package/lib/doctor/Diagnosis.js +11 -11
  229. package/lib/doctor/Doctor.js +42 -42
  230. package/lib/doctor/__tests__/Diagnosis.test.d.ts +1 -0
  231. package/lib/doctor/__tests__/Diagnosis.test.js +87 -0
  232. package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.d.ts +1 -0
  233. package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.js +172 -0
  234. package/lib/doctor/__tests__/Doctor.test.d.ts +1 -0
  235. package/lib/doctor/__tests__/Doctor.test.js +398 -0
  236. package/lib/errorHandlers/index.js +8 -0
  237. package/lib/mcp/setup.js +26 -5
  238. package/lib/middleware/__test__/configMiddleware.test.js +12 -12
  239. package/lib/middleware/__test__/gitMiddleware.test.js +4 -4
  240. package/lib/middleware/__test__/notificationsMiddleware.test.js +2 -2
  241. package/lib/middleware/__test__/requestMiddleware.test.js +2 -2
  242. package/lib/middleware/__test__/yargsChecksMiddleware.test.js +7 -7
  243. package/lib/middleware/notificationsMiddleware.js +16 -13
  244. package/lib/projects/__tests__/AppDevModeInterface.test.d.ts +1 -0
  245. package/lib/projects/__tests__/AppDevModeInterface.test.js +517 -0
  246. package/lib/projects/__tests__/LocalDevProcess.test.d.ts +1 -0
  247. package/lib/projects/__tests__/LocalDevProcess.test.js +314 -0
  248. package/lib/projects/__tests__/LocalDevWebsocketServer.test.d.ts +1 -0
  249. package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +175 -0
  250. package/lib/projects/__tests__/ProjectLogsManager.test.d.ts +1 -0
  251. package/lib/projects/__tests__/ProjectLogsManager.test.js +191 -0
  252. package/lib/projects/__tests__/buildAndDeploy.test.d.ts +1 -0
  253. package/lib/projects/__tests__/buildAndDeploy.test.js +25 -0
  254. package/lib/projects/__tests__/components.test.d.ts +1 -0
  255. package/lib/projects/__tests__/components.test.js +186 -0
  256. package/lib/projects/__tests__/projects.test.d.ts +1 -0
  257. package/lib/projects/__tests__/projects.test.js +89 -0
  258. package/lib/projects/__tests__/structure.test.d.ts +1 -0
  259. package/lib/projects/__tests__/structure.test.js +249 -0
  260. package/lib/projects/add/__tests__/legacyAddComponent.test.d.ts +1 -0
  261. package/lib/projects/add/__tests__/legacyAddComponent.test.js +206 -0
  262. package/lib/projects/add/__tests__/v3AddComponent.test.d.ts +1 -0
  263. package/lib/projects/add/__tests__/v3AddComponent.test.js +190 -0
  264. package/lib/projects/create/__tests__/legacy.test.d.ts +1 -0
  265. package/lib/projects/create/__tests__/legacy.test.js +126 -0
  266. package/lib/projects/create/__tests__/v3.test.d.ts +1 -0
  267. package/lib/projects/create/__tests__/v3.test.js +80 -0
  268. package/lib/projects/create/v3.d.ts +3 -2
  269. package/lib/projects/create/v3.js +2 -2
  270. package/lib/projects/localDev/DevServerManager.js +0 -1
  271. package/lib/projects/upload.js +1 -1
  272. package/lib/prompts/__tests__/downloadProjectPrompt.test.d.ts +1 -0
  273. package/lib/prompts/__tests__/downloadProjectPrompt.test.js +30 -0
  274. package/lib/prompts/__tests__/projectsLogsPrompt.test.d.ts +1 -0
  275. package/lib/prompts/__tests__/projectsLogsPrompt.test.js +42 -0
  276. package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +10 -9
  277. package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +75 -31
  278. package/lib/prompts/createModulePrompt.js +1 -2
  279. package/lib/prompts/projectAddPrompt.d.ts +2 -1
  280. package/lib/prompts/projectAddPrompt.js +2 -1
  281. package/lib/prompts/promptUtils.d.ts +2 -2
  282. package/lib/prompts/promptUtils.js +161 -35
  283. package/lib/prompts/selectProjectTemplatePrompt.d.ts +2 -1
  284. package/lib/prompts/selectProjectTemplatePrompt.js +2 -1
  285. package/lib/schema.js +5 -1
  286. package/lib/testUtils.js +1 -2
  287. package/lib/ui/SpinniesManager.js +0 -1
  288. package/lib/ui/index.js +1 -1
  289. package/lib/ui/supportHyperlinks.js +2 -2
  290. package/lib/ui/supportsColor.js +2 -2
  291. package/lib/usageTracking.d.ts +11 -0
  292. package/lib/usageTracking.js +67 -73
  293. package/lib/utils/hasFlag.d.ts +1 -0
  294. package/lib/utils/hasFlag.js +15 -0
  295. package/lib/yargsUtils.d.ts +2 -1
  296. package/lib/yargsUtils.js +3 -13
  297. package/mcp-server/tools/project/AddFeatureToProject.js +4 -1
  298. package/mcp-server/tools/project/CreateProjectTool.d.ts +2 -2
  299. package/mcp-server/tools/project/CreateProjectTool.js +4 -1
  300. package/mcp-server/tools/project/DeployProject.js +4 -1
  301. package/mcp-server/tools/project/GuidedWalkthroughTool.js +4 -1
  302. package/mcp-server/tools/project/UploadProjectTools.js +4 -1
  303. package/mcp-server/tools/project/ValidateProjectTool.js +4 -1
  304. package/mcp-server/tools/project/__tests__/AddFeatureToProject.test.d.ts +1 -0
  305. package/mcp-server/tools/project/__tests__/AddFeatureToProject.test.js +153 -0
  306. package/mcp-server/tools/project/__tests__/CreateProjectTool.test.d.ts +1 -0
  307. package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +130 -0
  308. package/mcp-server/tools/project/__tests__/DeployProject.test.d.ts +1 -0
  309. package/mcp-server/tools/project/__tests__/DeployProject.test.js +121 -0
  310. package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.d.ts +1 -0
  311. package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.js +128 -0
  312. package/mcp-server/tools/project/__tests__/UploadProjectTools.test.d.ts +1 -0
  313. package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +109 -0
  314. package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.d.ts +1 -0
  315. package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.js +112 -0
  316. package/mcp-server/utils/__tests__/command.test.d.ts +1 -0
  317. package/mcp-server/utils/__tests__/command.test.js +47 -0
  318. package/mcp-server/utils/__tests__/project.test.d.ts +1 -0
  319. package/mcp-server/utils/__tests__/project.test.js +84 -0
  320. package/mcp-server/utils/project.js +3 -0
  321. package/mcp-server/utils/toolUsageTracking.d.ts +1 -0
  322. package/mcp-server/utils/toolUsageTracking.js +25 -0
  323. package/package.json +9 -9
  324. package/types/Prompts.d.ts +4 -2
@@ -5,49 +5,175 @@ exports.promptUser = promptUser;
5
5
  exports.confirmPrompt = confirmPrompt;
6
6
  exports.listPrompt = listPrompt;
7
7
  exports.inputPrompt = inputPrompt;
8
- const inquirer = require('inquirer');
9
- const promptModule = inquirer.createPromptModule();
10
- exports.Separator = new inquirer.Separator();
8
+ const prompts_1 = require("@inquirer/prompts");
9
+ exports.Separator = new prompts_1.Separator();
10
+ function mapPromptChoicesToChoices(choices) {
11
+ return (choices?.map(choice => {
12
+ if (typeof choice === 'string') {
13
+ return { value: choice, name: choice };
14
+ }
15
+ else if (choice instanceof prompts_1.Separator) {
16
+ return choice;
17
+ }
18
+ return {
19
+ value: choice.value,
20
+ name: choice.name,
21
+ disabled: choice.disabled,
22
+ checked: choice.checked,
23
+ };
24
+ }) || []);
25
+ }
26
+ function handleArrayConfig(config) {
27
+ return (async () => {
28
+ const result = {};
29
+ for (const prompt of config) {
30
+ if (prompt.when !== undefined) {
31
+ const shouldPrompt = typeof prompt.when === 'function'
32
+ ? prompt.when()
33
+ : (prompt.when ?? true);
34
+ if (!shouldPrompt) {
35
+ continue;
36
+ }
37
+ }
38
+ if (typeof prompt.message === 'function') {
39
+ prompt.message = prompt.message(result);
40
+ }
41
+ // Pass the accumulated results to each prompt
42
+ const promptWithAnswers = {
43
+ ...prompt,
44
+ default: typeof prompt.default === 'function'
45
+ ? (answers) => {
46
+ const mergedAnswers = { ...answers, ...result };
47
+ return prompt.default(mergedAnswers);
48
+ }
49
+ : prompt.default,
50
+ };
51
+ const response = await promptUser(promptWithAnswers);
52
+ Object.assign(result, response);
53
+ }
54
+ return result;
55
+ })();
56
+ }
11
57
  function promptUser(config) {
12
- return promptModule(config);
58
+ if (Array.isArray(config)) {
59
+ return handleArrayConfig(config);
60
+ }
61
+ else {
62
+ if (config.when !== undefined) {
63
+ const shouldPrompt = typeof config.when === 'function'
64
+ ? config.when()
65
+ : (config.when ?? true);
66
+ if (!shouldPrompt) {
67
+ return Promise.resolve({});
68
+ }
69
+ }
70
+ }
71
+ switch (config.type) {
72
+ case 'list':
73
+ return handleSelectPrompt(config);
74
+ case 'input':
75
+ return handleInputPrompt(config);
76
+ case 'confirm':
77
+ return handleConfirmPrompt(config);
78
+ case 'checkbox':
79
+ return handleCheckboxPrompt(config);
80
+ case 'password':
81
+ return handlePasswordPrompt(config);
82
+ case 'number':
83
+ return handleNumberPrompt(config);
84
+ case 'rawlist':
85
+ return handleRawListPrompt(config);
86
+ default:
87
+ return handleInputPrompt(config);
88
+ }
89
+ }
90
+ function handleRawListPrompt(config) {
91
+ const choices = mapPromptChoicesToChoices(config.choices);
92
+ choices.map((choice, index) => {
93
+ if (!(choice instanceof prompts_1.Separator)) {
94
+ choice.name = `${index + 1}) ${choice.name}`;
95
+ }
96
+ });
97
+ return (0, prompts_1.select)({
98
+ message: config.message,
99
+ choices: choices,
100
+ pageSize: config.pageSize,
101
+ default: config.default,
102
+ }).then(resp => ({ [config.name]: resp }));
103
+ }
104
+ function handleNumberPrompt(config) {
105
+ return (0, prompts_1.number)({
106
+ message: config.message,
107
+ default: config.default,
108
+ validate: config.validate,
109
+ }).then(resp => ({ [config.name]: resp }));
110
+ }
111
+ function handlePasswordPrompt(config) {
112
+ return (0, prompts_1.password)({
113
+ message: config.message,
114
+ mask: '*',
115
+ validate: config.validate,
116
+ }).then(resp => ({ [config.name]: resp }));
117
+ }
118
+ function handleCheckboxPrompt(config) {
119
+ const choices = mapPromptChoicesToChoices(config.choices);
120
+ return (0, prompts_1.checkbox)({
121
+ message: config.message,
122
+ choices: choices,
123
+ pageSize: config.pageSize,
124
+ validate: config.validate,
125
+ }).then(resp => ({ [config.name]: resp }));
126
+ }
127
+ function handleConfirmPrompt(config) {
128
+ return confirmPrompt(config.message, {
129
+ defaultAnswer: config.default,
130
+ }).then(resp => ({ [config.name]: resp }));
131
+ }
132
+ function handleInputPrompt(config) {
133
+ return (0, prompts_1.input)({
134
+ message: config.message,
135
+ default: config.default,
136
+ validate: config.validate,
137
+ transformer: config.transformer,
138
+ }).then(resp => ({ [config.name]: resp }));
139
+ }
140
+ function handleSelectPrompt(config) {
141
+ const choices = mapPromptChoicesToChoices(config.choices);
142
+ return (0, prompts_1.select)({
143
+ message: config.message,
144
+ choices: choices,
145
+ default: config.default,
146
+ pageSize: config.pageSize,
147
+ }).then(resp => ({ [config.name]: resp }));
13
148
  }
14
149
  async function confirmPrompt(message, options = {}) {
15
- const { defaultAnswer = true, when } = options;
16
- const { choice } = await promptUser([
17
- {
18
- name: 'choice',
19
- type: 'confirm',
20
- message,
21
- default: defaultAnswer,
22
- when,
23
- },
24
- ]);
150
+ const { defaultAnswer = true } = options;
151
+ const choice = await (0, prompts_1.confirm)({
152
+ message,
153
+ default: defaultAnswer,
154
+ });
25
155
  return choice;
26
156
  }
27
157
  async function listPrompt(message, { choices, when, defaultAnswer, validate, }) {
28
- const { choice } = await promptUser([
29
- {
30
- name: 'choice',
31
- type: 'list',
32
- message,
33
- choices,
34
- when,
35
- default: defaultAnswer,
36
- validate,
37
- },
38
- ]);
158
+ const { choice } = await promptUser({
159
+ name: 'choice',
160
+ type: 'list',
161
+ message,
162
+ choices,
163
+ when,
164
+ default: defaultAnswer,
165
+ validate,
166
+ });
39
167
  return choice;
40
168
  }
41
169
  async function inputPrompt(message, { when, validate, defaultAnswer, } = {}) {
42
- const { input } = await promptUser([
43
- {
44
- name: 'input',
45
- type: 'input',
46
- default: defaultAnswer,
47
- message,
48
- when,
49
- validate,
50
- },
51
- ]);
170
+ const { input } = await promptUser({
171
+ name: 'input',
172
+ type: 'input',
173
+ default: defaultAnswer,
174
+ message,
175
+ when,
176
+ validate,
177
+ });
52
178
  return input;
53
179
  }
@@ -1,3 +1,4 @@
1
+ import { Separator } from '@inquirer/prompts';
1
2
  import { ComponentTemplate, ComponentTemplateChoice, ProjectTemplate } from '../../types/Projects';
2
3
  export type SelectProjectTemplatePromptResponse = {
3
4
  projectTemplate?: ProjectTemplate;
@@ -22,5 +23,5 @@ export type PromptOptionsArg = {
22
23
  features?: string[];
23
24
  };
24
25
  export declare function selectProjectTemplatePrompt(promptOptions: PromptOptionsArg, projectTemplates?: ProjectTemplate[], componentTemplates?: undefined): Promise<SelectProjectTemplatePromptResponseProjectTemplate>;
25
- export declare function selectProjectTemplatePrompt(promptOptions: PromptOptionsArg, projectTemplates?: undefined, componentTemplates?: ComponentTemplateChoice[]): Promise<SelectProjectTemplatePromptResponseComponentTemplates>;
26
+ export declare function selectProjectTemplatePrompt(promptOptions: PromptOptionsArg, projectTemplates?: undefined, componentTemplates?: (ComponentTemplateChoice | Separator)[]): Promise<SelectProjectTemplatePromptResponseComponentTemplates>;
26
27
  export {};
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.selectProjectTemplatePrompt = selectProjectTemplatePrompt;
4
+ const prompts_1 = require("@inquirer/prompts");
4
5
  const promptUtils_1 = require("./promptUtils");
5
6
  const en_1 = require("../../lang/en");
6
7
  function findTemplateByNameOrLabel(projectTemplates, templateNameOrLabel) {
@@ -12,7 +13,7 @@ async function selectProjectTemplatePrompt(promptOptions, projectTemplates, comp
12
13
  const selectedComponents = [];
13
14
  if (createProjectFromComponents && promptOptions.features) {
14
15
  componentTemplates.forEach(template => {
15
- if (!template.value) {
16
+ if (template instanceof prompts_1.Separator || !template.value) {
16
17
  return;
17
18
  }
18
19
  if (promptOptions.features?.includes(template.value.type)) {
package/lib/schema.js CHANGED
@@ -13,6 +13,10 @@ function logSchemas(schemas) {
13
13
  const data = schemas
14
14
  .map(r => [r.labels.singular, r.name, r.objectTypeId || ''])
15
15
  .sort((a, b) => (a[1] > b[1] ? 1 : -1));
16
+ if (data.length === 0) {
17
+ logger_1.logger.log('No Schemas were found');
18
+ return;
19
+ }
16
20
  data.unshift([
17
21
  chalk_1.default.bold('Label'),
18
22
  chalk_1.default.bold('Name'),
@@ -22,7 +26,7 @@ function logSchemas(schemas) {
22
26
  singleLine: true,
23
27
  border: (0, table_1.getBorderCharacters)('honeywell'),
24
28
  };
25
- logger_1.logger.log(data.length ? (0, table_1.table)(data, tableConfig) : 'No Schemas were found');
29
+ logger_1.logger.log((0, table_1.table)(data, tableConfig));
26
30
  }
27
31
  async function listSchemas(accountId) {
28
32
  const { data } = await (0, customObjects_1.fetchObjectSchemas)(accountId);
package/lib/testUtils.js CHANGED
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mockHubSpotHttpResponse = mockHubSpotHttpResponse;
4
4
  exports.mockHubSpotHttpError = mockHubSpotHttpError;
5
- const axios_1 = require("axios");
6
5
  const HubSpotHttpError_1 = require("@hubspot/local-dev-lib/models/HubSpotHttpError");
7
6
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
7
  function mockHubSpotHttpResponse(data) {
@@ -12,7 +11,7 @@ function mockHubSpotHttpResponse(data) {
12
11
  statusText: 'OK',
13
12
  headers: {},
14
13
  config: {
15
- headers: new axios_1.AxiosHeaders(),
14
+ headers: {},
16
15
  },
17
16
  });
18
17
  }
@@ -256,4 +256,3 @@ class SpinniesManager {
256
256
  }
257
257
  const toExport = new SpinniesManager();
258
258
  exports.default = toExport;
259
- module.exports = toExport;
package/lib/ui/index.js CHANGED
@@ -59,7 +59,7 @@ function uiAccountDescription(accountId, bold = true) {
59
59
  const account = (0, config_1.getAccountConfig)(accountId || undefined);
60
60
  let message;
61
61
  if (account && account.accountType) {
62
- message = `${account.name} [${HUBSPOT_ACCOUNT_TYPE_STRINGS[account.accountType]}] (${accountId})`;
62
+ message = `${account.name ? `${account.name} ` : ''}[${HUBSPOT_ACCOUNT_TYPE_STRINGS[account.accountType]}] (${accountId})`;
63
63
  }
64
64
  else {
65
65
  message = accountId ? accountId.toString() : '';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.supportsHyperlinkModule = void 0;
4
- const yargsUtils_1 = require("../yargsUtils");
4
+ const hasFlag_1 = require("../utils/hasFlag");
5
5
  //See https://github.com/jamestalmage/supports-hyperlinks (License: https://github.com/jamestalmage/supports-hyperlinks/blob/master/license)
6
6
  function parseVersion(versionString) {
7
7
  if (/^\d{3,4}$/.test(versionString)) {
@@ -22,7 +22,7 @@ function parseVersion(versionString) {
22
22
  }
23
23
  function supportsHyperlink(stream) {
24
24
  const { env } = process;
25
- if ((0, yargsUtils_1.hasFlag)('noHyperlinks')) {
25
+ if ((0, hasFlag_1.hasFlag)('noHyperlinks')) {
26
26
  return false;
27
27
  }
28
28
  if (stream && !stream.isTTY) {
@@ -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 yargsUtils_1 = require("../yargsUtils");
10
+ const hasFlag_1 = require("../utils/hasFlag");
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, yargsUtils_1.hasFlag)('noColor')) {
36
+ if ((0, hasFlag_1.hasFlag)('noColor')) {
37
37
  return 0;
38
38
  }
39
39
  if (process_1.default.platform === 'win32') {
@@ -13,6 +13,17 @@ type Meta = {
13
13
  file?: boolean;
14
14
  successful?: boolean;
15
15
  };
16
+ export declare const EventClass: {
17
+ USAGE: string;
18
+ INTERACTION: string;
19
+ VIEW: string;
20
+ ACTIVATION: string;
21
+ };
22
+ export declare function getNodeVersionData(): {
23
+ nodeVersion: string;
24
+ nodeMajorVersion: string;
25
+ };
26
+ export declare function getPlatform(): string;
16
27
  export declare function trackCommandUsage(command: string, meta?: Meta, accountId?: number): Promise<void>;
17
28
  export declare function trackHelpUsage(command: string): Promise<void>;
18
29
  export declare function trackConvertFieldsUsage(command: string): Promise<void>;
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventClass = void 0;
4
+ exports.getNodeVersionData = getNodeVersionData;
5
+ exports.getPlatform = getPlatform;
3
6
  exports.trackCommandUsage = trackCommandUsage;
4
7
  exports.trackHelpUsage = trackHelpUsage;
5
8
  exports.trackConvertFieldsUsage = trackConvertFieldsUsage;
@@ -11,7 +14,7 @@ const auth_1 = require("@hubspot/local-dev-lib/constants/auth");
11
14
  const logger_1 = require("@hubspot/local-dev-lib/logger");
12
15
  const package_json_1 = require("../package.json");
13
16
  const errorHandlers_1 = require("./errorHandlers");
14
- const EventClass = {
17
+ exports.EventClass = {
15
18
  USAGE: 'USAGE',
16
19
  INTERACTION: 'INTERACTION',
17
20
  VIEW: 'VIEW',
@@ -46,86 +49,45 @@ async function trackCommandUsage(command, meta = {}, accountId) {
46
49
  ? accountConfig.authType
47
50
  : auth_1.API_KEY_AUTH_METHOD.value;
48
51
  }
49
- setImmediate(async () => {
50
- const usageTrackingEvent = {
51
- action: 'cli-command',
52
- os: getPlatform(),
53
- ...getNodeVersionData(),
54
- version: package_json_1.version,
55
- command,
56
- authType,
57
- ...meta,
58
- };
59
- try {
60
- await (0, trackUsage_1.trackUsage)('cli-interaction', EventClass.INTERACTION, usageTrackingEvent, accountId);
61
- logger_1.logger.debug('Sent usage tracking command event: %o', usageTrackingEvent);
62
- }
63
- catch (e) {
64
- (0, errorHandlers_1.debugError)(e);
65
- }
52
+ return trackCliInteraction({
53
+ action: 'cli-command',
54
+ command,
55
+ authType,
56
+ ...meta,
57
+ accountId,
66
58
  });
67
59
  }
68
60
  async function trackHelpUsage(command) {
69
61
  if (!(0, config_1.isTrackingAllowed)()) {
70
62
  return;
71
63
  }
72
- try {
73
- if (command) {
74
- logger_1.logger.debug('Tracking help usage of "%s" sub-command', command);
75
- }
76
- else {
77
- logger_1.logger.debug('Tracking help usage of main command');
78
- }
79
- await (0, trackUsage_1.trackUsage)('cli-interaction', EventClass.INTERACTION, {
80
- action: 'cli-help',
81
- os: getPlatform(),
82
- ...getNodeVersionData(),
83
- version: package_json_1.version,
84
- command,
85
- });
64
+ if (command) {
65
+ logger_1.logger.debug('Tracking help usage of "%s" sub-command', command);
86
66
  }
87
- catch (e) {
88
- (0, errorHandlers_1.debugError)(e);
67
+ else {
68
+ logger_1.logger.debug('Tracking help usage of main command');
89
69
  }
70
+ return trackCliInteraction({
71
+ action: 'cli-help',
72
+ command,
73
+ });
90
74
  }
91
75
  async function trackConvertFieldsUsage(command) {
92
- if (!(0, config_1.isTrackingAllowed)()) {
93
- return;
94
- }
95
- try {
96
- logger_1.logger.debug('Attempting to track usage of "%s" command', command);
97
- await (0, trackUsage_1.trackUsage)('cli-interaction', EventClass.INTERACTION, {
98
- action: 'cli-process-fields',
99
- os: getPlatform(),
100
- ...getNodeVersionData(),
101
- version: package_json_1.version,
102
- command,
103
- });
104
- }
105
- catch (e) {
106
- (0, errorHandlers_1.debugError)(e);
107
- }
76
+ return trackCliInteraction({
77
+ action: 'cli-process-fields',
78
+ command,
79
+ });
108
80
  }
109
81
  async function trackAuthAction(command, authType, step, accountId) {
110
- if (!(0, config_1.isTrackingAllowed)()) {
111
- return;
112
- }
113
- const usageTrackingEvent = {
82
+ return trackCliInteraction({
114
83
  action: 'cli-auth',
115
- os: getPlatform(),
116
- ...getNodeVersionData(),
117
- version: package_json_1.version,
118
84
  command,
119
85
  authType,
120
- step,
121
- };
122
- try {
123
- await (0, trackUsage_1.trackUsage)('cli-interaction', EventClass.INTERACTION, usageTrackingEvent, accountId);
124
- logger_1.logger.debug('Sent usage tracking command event: %o', usageTrackingEvent);
125
- }
126
- catch (e) {
127
- (0, errorHandlers_1.debugError)(e);
128
- }
86
+ accountId,
87
+ meta: {
88
+ step,
89
+ },
90
+ });
129
91
  }
130
92
  async function trackCommandMetadataUsage(command, meta = {}, accountId) {
131
93
  if (!(0, config_1.isTrackingAllowed)()) {
@@ -140,9 +102,21 @@ async function trackCommandMetadataUsage(command, meta = {}, accountId) {
140
102
  ? accountConfig.authType
141
103
  : auth_1.API_KEY_AUTH_METHOD.value;
142
104
  }
143
- setImmediate(async () => {
105
+ return trackCliInteraction({
106
+ action: 'cli-command-metadata',
107
+ command,
108
+ authType,
109
+ accountId,
110
+ meta,
111
+ });
112
+ }
113
+ async function trackCliInteraction({ action, accountId, command, authType, meta = {}, }) {
114
+ try {
115
+ if (!(0, config_1.isTrackingAllowed)()) {
116
+ return;
117
+ }
144
118
  const usageTrackingEvent = {
145
- action: 'cli-command-metadata',
119
+ action,
146
120
  os: getPlatform(),
147
121
  ...getNodeVersionData(),
148
122
  version: package_json_1.version,
@@ -150,12 +124,32 @@ async function trackCommandMetadataUsage(command, meta = {}, accountId) {
150
124
  authType,
151
125
  ...meta,
152
126
  };
127
+ if (process.env.HUBSPOT_MCP_AI_AGENT) {
128
+ try {
129
+ await (0, trackUsage_1.trackUsage)('cli-interaction', exports.EventClass.INTERACTION, {
130
+ ...usageTrackingEvent,
131
+ action: 'cli-mcp-server',
132
+ type: process.env.HUBSPOT_MCP_AI_AGENT,
133
+ }, accountId);
134
+ logger_1.logger.debug('Sent AI usage tracking command event: %o', {
135
+ ...usageTrackingEvent,
136
+ action: 'cli-mcp-server',
137
+ type: process.env.HUBSPOT_MCP_AI_AGENT,
138
+ });
139
+ }
140
+ catch (error) {
141
+ (0, errorHandlers_1.debugError)(error);
142
+ }
143
+ }
153
144
  try {
154
- await (0, trackUsage_1.trackUsage)('cli-interaction', EventClass.INTERACTION, usageTrackingEvent, accountId);
155
- logger_1.logger.debug('Sent usage tracking command event: %o', usageTrackingEvent);
145
+ return (0, trackUsage_1.trackUsage)('cli-interaction', exports.EventClass.INTERACTION, usageTrackingEvent, accountId);
156
146
  }
157
- catch (e) {
158
- (0, errorHandlers_1.debugError)(e);
147
+ catch (error) {
148
+ (0, errorHandlers_1.debugError)(error);
159
149
  }
160
- });
150
+ logger_1.logger.debug('Sent usage tracking command event: %o', usageTrackingEvent);
151
+ }
152
+ catch (e) {
153
+ (0, errorHandlers_1.debugError)(e);
154
+ }
161
155
  }
@@ -0,0 +1 @@
1
+ export declare function hasFlag(flag: string, argv?: string[]): boolean;
@@ -0,0 +1,15 @@
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
+ }
@@ -1,5 +1,6 @@
1
1
  import { Argv } from 'yargs';
2
- export declare function hasFlag(flag: string, argv?: string[]): boolean;
2
+ import { hasFlag } from './utils/hasFlag';
3
+ export { hasFlag };
3
4
  export declare function makeYargsBuilder<T>(callback: (yargs: Argv) => Argv<T>, command: string | string[], describe?: string, options?: {
4
5
  useGlobalOptions?: boolean;
5
6
  useAccountOptions?: boolean;
package/lib/yargsUtils.js CHANGED
@@ -1,20 +1,10 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.hasFlag = hasFlag;
3
+ exports.hasFlag = void 0;
7
4
  exports.makeYargsBuilder = makeYargsBuilder;
8
- const process_1 = __importDefault(require("process"));
9
5
  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
- }
6
+ const hasFlag_1 = require("./utils/hasFlag");
7
+ Object.defineProperty(exports, "hasFlag", { enumerable: true, get: function () { return hasFlag_1.hasFlag; } });
18
8
  function makeYargsBuilder(callback, command, describe, options = {}) {
19
9
  return async function (yargs) {
20
10
  if (options.useGlobalOptions) {
@@ -8,6 +8,7 @@ const command_1 = require("../../utils/command");
8
8
  const constants_2 = require("./constants");
9
9
  const project_1 = require("../../utils/project");
10
10
  const content_1 = require("../../utils/content");
11
+ const toolUsageTracking_1 = require("../../utils/toolUsageTracking");
11
12
  const inputSchema = {
12
13
  absoluteProjectPath: constants_2.absoluteProjectPath,
13
14
  addApp: zod_1.z
@@ -40,12 +41,14 @@ const inputSchema = {
40
41
  const inputSchemaZodObject = zod_1.z.object({
41
42
  ...inputSchema,
42
43
  });
44
+ const toolName = 'add-feature-to-hubspot-project';
43
45
  class AddFeatureToProject extends types_1.Tool {
44
46
  constructor(mcpServer) {
45
47
  super(mcpServer);
46
48
  }
47
49
  async handler({ absoluteProjectPath, distribution, auth, features, addApp, }) {
48
50
  try {
51
+ await (0, toolUsageTracking_1.trackToolUsage)(toolName);
49
52
  let command = `hs project add`;
50
53
  const content = [];
51
54
  if (distribution) {
@@ -75,7 +78,7 @@ class AddFeatureToProject extends types_1.Tool {
75
78
  }
76
79
  }
77
80
  register() {
78
- return this.mcpServer.registerTool('add-feature-to-hubspot-project', {
81
+ return this.mcpServer.registerTool(toolName, {
79
82
  title: 'Add feature to HubSpot Project',
80
83
  description: 'Adds a feature to an existing HubSpot project',
81
84
  inputSchema,
@@ -13,18 +13,18 @@ declare const inputSchemaZodObject: z.ZodObject<{
13
13
  projectBase: "app" | "empty";
14
14
  absoluteCurrentWorkingDirectory: string;
15
15
  destination: string;
16
+ name?: string | undefined;
16
17
  auth?: "oauth" | "static" | undefined;
17
18
  distribution?: "marketplace" | "private" | undefined;
18
19
  features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
19
- name?: string | undefined;
20
20
  }, {
21
21
  projectBase: "app" | "empty";
22
22
  absoluteCurrentWorkingDirectory: string;
23
23
  destination: string;
24
+ name?: string | undefined;
24
25
  auth?: "oauth" | "static" | undefined;
25
26
  distribution?: "marketplace" | "private" | undefined;
26
27
  features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
27
- name?: string | undefined;
28
28
  }>;
29
29
  export type CreateProjectInputSchema = z.infer<typeof inputSchemaZodObject>;
30
30
  export declare class CreateProjectTool extends Tool<CreateProjectInputSchema> {