@hubspot/cli 7.8.0-experimental.0 → 7.8.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 (357) hide show
  1. package/bin/cli.js +31 -27
  2. package/commands/__tests__/auth.test.js +5 -0
  3. package/commands/__tests__/doctor.test.js +16 -16
  4. package/commands/__tests__/getStarted.test.js +2 -2
  5. package/commands/__tests__/mcp.test.js +1 -1
  6. package/commands/__tests__/project.test.js +2 -3
  7. package/commands/account/auth.js +1 -0
  8. package/commands/account/clean.js +18 -27
  9. package/commands/account/createOverride.js +13 -31
  10. package/commands/account/info.js +20 -31
  11. package/commands/account/list.js +16 -22
  12. package/commands/account/remove.js +12 -20
  13. package/commands/account/removeOverride.js +11 -21
  14. package/commands/account/rename.js +6 -9
  15. package/commands/account/use.js +12 -26
  16. package/commands/account.js +2 -2
  17. package/commands/app/__tests__/migrate.test.js +5 -6
  18. package/commands/app/migrate.js +13 -19
  19. package/commands/app/secret/add.js +2 -1
  20. package/commands/app/secret/delete.js +2 -1
  21. package/commands/app/secret/list.js +2 -1
  22. package/commands/app/secret/update.js +2 -1
  23. package/commands/app/secret.js +2 -1
  24. package/commands/app.js +2 -2
  25. package/commands/auth.d.ts +1 -0
  26. package/commands/auth.js +17 -7
  27. package/commands/cms/convertFields.js +7 -9
  28. package/commands/cms/getReactModule.js +9 -14
  29. package/commands/cms/lighthouseScore.js +33 -36
  30. package/commands/cms.js +2 -2
  31. package/commands/completion.js +3 -3
  32. package/commands/config/set.d.ts +1 -1
  33. package/commands/config/set.js +64 -37
  34. package/commands/config.js +2 -2
  35. package/commands/create.js +2 -2
  36. package/commands/customObject/create.js +10 -12
  37. package/commands/customObject/schema/create.js +9 -11
  38. package/commands/customObject/schema/delete.js +16 -16
  39. package/commands/customObject/schema/fetch-all.js +12 -11
  40. package/commands/customObject/schema/fetch.js +15 -15
  41. package/commands/customObject/schema/list.js +4 -4
  42. package/commands/customObject/schema/update.js +13 -13
  43. package/commands/customObject/schema.js +2 -2
  44. package/commands/customObject.js +6 -7
  45. package/commands/doctor.js +8 -11
  46. package/commands/feedback.js +8 -13
  47. package/commands/fetch.js +8 -8
  48. package/commands/filemanager/fetch.js +7 -7
  49. package/commands/filemanager/upload.js +15 -34
  50. package/commands/filemanager.js +2 -2
  51. package/commands/function/deploy.js +11 -29
  52. package/commands/function/list.js +8 -8
  53. package/commands/function/server.js +9 -11
  54. package/commands/function.d.ts +1 -1
  55. package/commands/function.js +2 -2
  56. package/commands/getStarted.d.ts +1 -3
  57. package/commands/getStarted.js +68 -20
  58. package/commands/hubdb/clear.js +7 -15
  59. package/commands/hubdb/create.js +9 -15
  60. package/commands/hubdb/delete.js +8 -15
  61. package/commands/hubdb/fetch.js +6 -9
  62. package/commands/hubdb.d.ts +1 -1
  63. package/commands/hubdb.js +2 -2
  64. package/commands/init.js +2 -3
  65. package/commands/lint.js +16 -16
  66. package/commands/list.js +8 -14
  67. package/commands/logs.js +14 -20
  68. package/commands/mcp/__tests__/setup.test.js +2 -2
  69. package/commands/mcp/setup.js +11 -2
  70. package/commands/mcp.js +3 -3
  71. package/commands/mv.js +6 -17
  72. package/commands/open.js +5 -5
  73. package/commands/project/__tests__/add.test.js +15 -13
  74. package/commands/project/__tests__/create.test.js +6 -6
  75. package/commands/project/__tests__/deploy.test.js +3 -7
  76. package/commands/project/__tests__/devUnifiedFlow.test.js +2 -4
  77. package/commands/project/__tests__/installDeps.test.js +8 -8
  78. package/commands/project/__tests__/list.test.js +31 -0
  79. package/commands/project/__tests__/logs.test.js +1 -4
  80. package/commands/project/__tests__/migrate.test.js +7 -7
  81. package/commands/project/__tests__/migrateApp.test.js +3 -7
  82. package/commands/project/__tests__/profile.test.js +1 -1
  83. package/commands/project/__tests__/validate.test.js +98 -0
  84. package/commands/project/add.d.ts +2 -2
  85. package/commands/project/add.js +7 -10
  86. package/commands/project/cloneApp.js +14 -19
  87. package/commands/project/create.js +4 -11
  88. package/commands/project/deploy.js +5 -5
  89. package/commands/project/dev/deprecatedFlow.js +9 -18
  90. package/commands/project/dev/index.js +21 -18
  91. package/commands/project/dev/unifiedFlow.js +15 -8
  92. package/commands/project/download.js +15 -16
  93. package/commands/project/installDeps.d.ts +2 -2
  94. package/commands/project/installDeps.js +9 -9
  95. package/commands/project/list.d.ts +4 -0
  96. package/commands/project/list.js +62 -0
  97. package/commands/project/listBuilds.js +12 -21
  98. package/commands/project/logs.js +21 -24
  99. package/commands/project/migrate.js +33 -12
  100. package/commands/project/migrateApp.js +10 -17
  101. package/commands/project/open.js +6 -14
  102. package/commands/project/profile/add.js +3 -3
  103. package/commands/project/profile/delete.js +1 -2
  104. package/commands/project/profile.js +2 -3
  105. package/commands/project/upload.js +16 -25
  106. package/commands/project/validate.js +7 -7
  107. package/commands/project/watch.js +13 -22
  108. package/commands/project.js +4 -3
  109. package/commands/sandbox/__tests__/create.test.js +5 -5
  110. package/commands/sandbox/create.js +22 -32
  111. package/commands/sandbox/delete.js +39 -64
  112. package/commands/sandbox.js +2 -2
  113. package/commands/secret/addSecret.js +7 -17
  114. package/commands/secret/deleteSecret.js +10 -20
  115. package/commands/secret/listSecret.js +8 -10
  116. package/commands/secret/updateSecret.js +9 -17
  117. package/commands/secret.js +2 -2
  118. package/commands/testAccount/__tests__/delete.test.js +2 -4
  119. package/commands/testAccount/create.js +2 -2
  120. package/commands/testAccount/delete.d.ts +4 -3
  121. package/commands/testAccount/delete.js +155 -14
  122. package/commands/testAccount/importData.d.ts +1 -1
  123. package/commands/testAccount/importData.js +1 -1
  124. package/commands/testAccount.js +1 -1
  125. package/commands/theme/preview.js +1 -4
  126. package/lang/en.d.ts +365 -111
  127. package/lang/en.js +409 -158
  128. package/lang/en.lyaml +4 -4
  129. package/lib/__tests__/buildAccount.test.js +4 -3
  130. package/lib/__tests__/commonOpts.test.js +1 -1
  131. package/lib/__tests__/dependencyManagement.test.js +1 -1
  132. package/lib/__tests__/developerTestAccounts.test.js +3 -3
  133. package/lib/__tests__/hasFeature.test.js +145 -7
  134. package/lib/__tests__/npm.test.js +1 -1
  135. package/lib/__tests__/oauth.test.js +4 -4
  136. package/lib/__tests__/process.test.js +10 -5
  137. package/lib/__tests__/sandboxSync.test.js +8 -8
  138. package/lib/__tests__/sandboxes.test.js +8 -8
  139. package/lib/__tests__/serverlessLogs.test.js +1 -1
  140. package/lib/__tests__/usageTracking.test.js +5 -5
  141. package/lib/__tests__/validation.test.js +2 -1
  142. package/lib/__tests__/yargsUtils.test.js +83 -9
  143. package/lib/app/__tests__/migrate.test.js +19 -56
  144. package/lib/app/__tests__/migrate_legacy.test.js +1 -1
  145. package/lib/app/migrate.d.ts +2 -8
  146. package/lib/app/migrate.js +6 -81
  147. package/lib/app/migrate_legacy.js +20 -24
  148. package/lib/buildAccount.d.ts +2 -2
  149. package/lib/buildAccount.js +32 -64
  150. package/lib/commonOpts.d.ts +1 -1
  151. package/lib/commonOpts.js +25 -22
  152. package/lib/configMigrate.js +88 -9
  153. package/lib/configOptions.js +7 -0
  154. package/lib/constants.d.ts +22 -1
  155. package/lib/constants.js +26 -1
  156. package/lib/dependencyManagement.d.ts +0 -5
  157. package/lib/dependencyManagement.js +9 -36
  158. package/lib/developerTestAccounts.js +9 -23
  159. package/lib/doctor/Diagnosis.js +11 -23
  160. package/lib/doctor/DiagnosticInfoBuilder.js +12 -11
  161. package/lib/doctor/Doctor.js +42 -90
  162. package/lib/doctor/__tests__/Doctor.test.js +4 -4
  163. package/lib/errorHandlers/index.js +12 -20
  164. package/lib/errorHandlers/suppressError.js +11 -18
  165. package/lib/hasFeature.js +6 -0
  166. package/lib/lang.js +6 -5
  167. package/lib/links.d.ts +1 -0
  168. package/lib/links.js +14 -7
  169. package/lib/mcp/setup.js +1 -1
  170. package/lib/middleware/__test__/commandTargetingUtils.test.js +99 -0
  171. package/lib/middleware/__test__/configMiddleware.test.js +11 -11
  172. package/lib/middleware/__test__/yargsChecksMiddleware.test.js +6 -8
  173. package/lib/middleware/commandTargetingUtils.d.ts +8 -0
  174. package/lib/middleware/commandTargetingUtils.js +74 -0
  175. package/lib/middleware/configMiddleware.d.ts +1 -1
  176. package/lib/middleware/configMiddleware.js +21 -81
  177. package/lib/middleware/fireAlarmMiddleware.js +15 -5
  178. package/lib/middleware/gitMiddleware.js +5 -1
  179. package/lib/middleware/notificationsMiddleware.js +5 -11
  180. package/lib/middleware/yargsChecksMiddleware.js +6 -9
  181. package/lib/npm.js +2 -2
  182. package/lib/oauth.js +5 -5
  183. package/lib/process.js +5 -4
  184. package/lib/projects/__tests__/AppDevModeInterface.test.js +87 -90
  185. package/lib/projects/__tests__/LocalDevProcess.test.js +231 -19
  186. package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +89 -63
  187. package/lib/projects/__tests__/deploy.test.js +73 -8
  188. package/lib/projects/__tests__/localDevProjectHelpers.test.js +6 -2
  189. package/lib/projects/__tests__/platformVersion.test.js +8 -8
  190. package/lib/projects/__tests__/projects.test.js +12 -12
  191. package/lib/projects/__tests__/structure.test.js +3 -3
  192. package/lib/projects/__tests__/upload.test.d.ts +1 -0
  193. package/lib/projects/__tests__/upload.test.js +82 -0
  194. package/lib/projects/add/__tests__/legacyAddComponent.test.js +6 -6
  195. package/lib/projects/add/__tests__/v2AddComponent.test.d.ts +1 -0
  196. package/lib/projects/add/__tests__/{v3AddComponent.test.js → v2AddComponent.test.js} +39 -39
  197. package/lib/projects/add/{v3AddComponent.d.ts → v2AddComponent.d.ts} +1 -1
  198. package/lib/projects/add/{v3AddComponent.js → v2AddComponent.js} +5 -5
  199. package/lib/projects/create/__tests__/legacy.test.js +5 -5
  200. package/lib/projects/create/__tests__/v2.test.d.ts +1 -0
  201. package/lib/projects/create/__tests__/{v3.test.js → v2.test.js} +82 -7
  202. package/lib/projects/create/index.js +4 -4
  203. package/lib/projects/create/legacy.js +2 -2
  204. package/lib/projects/create/{v3.d.ts → v2.d.ts} +3 -3
  205. package/lib/projects/create/{v3.js → v2.js} +16 -13
  206. package/lib/projects/deploy.d.ts +1 -1
  207. package/lib/projects/deploy.js +2 -2
  208. package/lib/projects/localDev/AppDevModeInterface.d.ts +10 -1
  209. package/lib/projects/localDev/AppDevModeInterface.js +118 -89
  210. package/lib/projects/localDev/DevServerManager.d.ts +11 -29
  211. package/lib/projects/localDev/DevServerManager.js +19 -61
  212. package/lib/projects/localDev/DevServerManager_DEPRECATED.d.ts +40 -0
  213. package/lib/projects/localDev/DevServerManager_DEPRECATED.js +120 -0
  214. package/lib/projects/localDev/LocalDevLogger.d.ts +4 -0
  215. package/lib/projects/localDev/LocalDevLogger.js +27 -6
  216. package/lib/projects/localDev/{LocalDevManager.js → LocalDevManager_DEPRECATED.js} +10 -11
  217. package/lib/projects/localDev/LocalDevProcess.d.ts +7 -5
  218. package/lib/projects/localDev/LocalDevProcess.js +93 -21
  219. package/lib/projects/localDev/LocalDevState.d.ts +12 -8
  220. package/lib/projects/localDev/LocalDevState.js +27 -17
  221. package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +6 -1
  222. package/lib/projects/localDev/LocalDevWebsocketServer.js +94 -33
  223. package/lib/projects/localDev/helpers/account.d.ts +1 -1
  224. package/lib/projects/localDev/helpers/account.js +2 -2
  225. package/lib/projects/localDev/helpers/project.d.ts +3 -2
  226. package/lib/projects/localDev/helpers/project.js +49 -10
  227. package/lib/projects/localDev/localDevWebsocketServerUtils.d.ts +7 -0
  228. package/lib/projects/localDev/localDevWebsocketServerUtils.js +19 -0
  229. package/lib/projects/platformVersion.d.ts +1 -1
  230. package/lib/projects/platformVersion.js +1 -1
  231. package/lib/projects/pollProjectBuildAndDeploy.js +4 -4
  232. package/lib/projects/structure.js +6 -6
  233. package/lib/projects/upload.d.ts +1 -1
  234. package/lib/projects/upload.js +17 -8
  235. package/lib/projects/urls.d.ts +0 -1
  236. package/lib/projects/urls.js +0 -3
  237. package/lib/prompts/__tests__/downloadProjectPrompt.test.js +1 -0
  238. package/lib/prompts/__tests__/projectAddPrompt.test.js +10 -10
  239. package/lib/prompts/accountNamePrompt.js +14 -19
  240. package/lib/prompts/accountsPrompt.js +2 -2
  241. package/lib/prompts/cmsFieldPrompt.js +2 -2
  242. package/lib/prompts/createApiSamplePrompt.js +5 -5
  243. package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +10 -1
  244. package/lib/prompts/createFunctionPrompt.js +14 -14
  245. package/lib/prompts/createModulePrompt.js +9 -9
  246. package/lib/prompts/createTemplatePrompt.js +2 -2
  247. package/lib/prompts/downloadProjectPrompt.js +5 -8
  248. package/lib/prompts/installAppPrompt.d.ts +1 -6
  249. package/lib/prompts/installAppPrompt.js +1 -6
  250. package/lib/prompts/personalAccessKeyPrompt.js +3 -3
  251. package/lib/prompts/previewPrompt.js +6 -6
  252. package/lib/prompts/projectAddPrompt.d.ts +2 -2
  253. package/lib/prompts/projectAddPrompt.js +9 -2
  254. package/lib/prompts/projectDevTargetAccountPrompt.js +20 -32
  255. package/lib/prompts/projectNamePrompt.js +4 -8
  256. package/lib/prompts/projectsLogsPrompt.js +2 -4
  257. package/lib/prompts/promptUtils.js +30 -9
  258. package/lib/prompts/sandboxesPrompt.js +7 -7
  259. package/lib/prompts/secretPrompt.js +3 -3
  260. package/lib/prompts/selectAppPrompt.js +3 -3
  261. package/lib/prompts/selectHubDBTablePrompt.js +9 -13
  262. package/lib/prompts/selectProjectTemplatePrompt.js +2 -0
  263. package/lib/prompts/selectPublicAppForMigrationPrompt.js +15 -19
  264. package/lib/prompts/setAsDefaultAccountPrompt.js +4 -8
  265. package/lib/prompts/uploadPrompt.js +5 -5
  266. package/lib/sandboxSync.js +24 -41
  267. package/lib/sandboxes.js +19 -47
  268. package/lib/schema.js +3 -3
  269. package/lib/serverlessLogs.js +11 -13
  270. package/lib/theme/__tests__/migrate.test.d.ts +1 -0
  271. package/lib/theme/__tests__/migrate.test.js +233 -0
  272. package/lib/theme/migrate.d.ts +13 -0
  273. package/lib/theme/migrate.js +90 -0
  274. package/lib/ui/SpinniesManager.d.ts +2 -0
  275. package/lib/ui/SpinniesManager.js +112 -8
  276. package/lib/ui/boxen.js +1 -2
  277. package/lib/ui/git.js +13 -10
  278. package/lib/ui/index.d.ts +4 -0
  279. package/lib/ui/index.js +47 -38
  280. package/lib/ui/serverlessFunctionLogs.js +9 -7
  281. package/lib/ui/uiMessages.d.ts +72 -0
  282. package/lib/ui/uiMessages.js +75 -0
  283. package/lib/usageTracking.js +8 -8
  284. package/lib/validation.js +20 -23
  285. package/lib/yargsUtils.d.ts +1 -1
  286. package/lib/yargsUtils.js +12 -5
  287. package/mcp-server/tools/cms/HsCreateFunctionTool.js +1 -1
  288. package/mcp-server/tools/cms/HsCreateModuleTool.d.ts +2 -2
  289. package/mcp-server/tools/cms/HsCreateModuleTool.js +1 -1
  290. package/mcp-server/tools/cms/HsCreateTemplateTool.js +1 -1
  291. package/mcp-server/tools/cms/HsFunctionLogsTool.js +2 -2
  292. package/mcp-server/tools/cms/HsListFunctionsTool.js +1 -1
  293. package/mcp-server/tools/cms/HsListTool.js +1 -1
  294. package/mcp-server/tools/cms/__tests__/HsCreateFunctionTool.test.js +1 -1
  295. package/mcp-server/tools/cms/__tests__/HsCreateModuleTool.test.js +1 -1
  296. package/mcp-server/tools/cms/__tests__/HsCreateTemplateTool.test.js +1 -1
  297. package/mcp-server/tools/cms/__tests__/HsFunctionLogsTool.test.js +2 -2
  298. package/mcp-server/tools/cms/__tests__/HsListFunctionsTool.test.js +1 -1
  299. package/mcp-server/tools/cms/__tests__/HsListTool.test.js +1 -1
  300. package/mcp-server/tools/index.js +4 -0
  301. package/mcp-server/tools/project/AddFeatureToProjectTool.d.ts +3 -3
  302. package/mcp-server/tools/project/AddFeatureToProjectTool.js +3 -3
  303. package/mcp-server/tools/project/CreateProjectTool.d.ts +3 -3
  304. package/mcp-server/tools/project/CreateProjectTool.js +5 -5
  305. package/mcp-server/tools/project/DeployProjectTool.js +1 -1
  306. package/mcp-server/tools/project/DocFetchTool.js +2 -2
  307. package/mcp-server/tools/project/DocsSearchTool.d.ts +4 -1
  308. package/mcp-server/tools/project/DocsSearchTool.js +7 -7
  309. package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.d.ts +23 -0
  310. package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.js +68 -0
  311. package/mcp-server/tools/project/GetApplicationInfoTool.d.ts +11 -0
  312. package/mcp-server/tools/project/GetApplicationInfoTool.js +49 -0
  313. package/mcp-server/tools/project/GetConfigValuesTool.d.ts +4 -1
  314. package/mcp-server/tools/project/GetConfigValuesTool.js +13 -7
  315. package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +2 -2
  316. package/mcp-server/tools/project/GuidedWalkthroughTool.js +1 -1
  317. package/mcp-server/tools/project/UploadProjectTools.js +2 -2
  318. package/mcp-server/tools/project/ValidateProjectTool.js +1 -1
  319. package/mcp-server/tools/project/__tests__/AddFeatureToProjectTool.test.js +1 -1
  320. package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +2 -2
  321. package/mcp-server/tools/project/__tests__/DeployProjectTool.test.js +1 -1
  322. package/mcp-server/tools/project/__tests__/DocFetchTool.test.js +2 -2
  323. package/mcp-server/tools/project/__tests__/DocsSearchTool.test.js +14 -12
  324. package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.d.ts +1 -0
  325. package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.js +169 -0
  326. package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.d.ts +1 -0
  327. package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.js +115 -0
  328. package/mcp-server/tools/project/__tests__/GetConfigValuesTool.test.js +9 -8
  329. package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.js +1 -1
  330. package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +1 -1
  331. package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.js +1 -1
  332. package/mcp-server/tools/project/constants.d.ts +1 -1
  333. package/mcp-server/tools/project/constants.js +9 -3
  334. package/mcp-server/utils/__tests__/cliConfig.test.d.ts +1 -0
  335. package/mcp-server/utils/__tests__/cliConfig.test.js +110 -0
  336. package/mcp-server/utils/cliConfig.d.ts +1 -0
  337. package/mcp-server/utils/cliConfig.js +12 -0
  338. package/mcp-server/utils/toolUsageTracking.js +2 -2
  339. package/package.json +8 -12
  340. package/types/LocalDev.d.ts +19 -3
  341. package/ui/components/HorizontalSelectPrompt.js +1 -1
  342. package/ui/index.js +1 -1
  343. package/commands/getStartedV2.d.ts +0 -9
  344. package/commands/getStartedV2.js +0 -39
  345. package/lib/middleware/__test__/utils.test.js +0 -51
  346. package/lib/middleware/utils.d.ts +0 -8
  347. package/lib/middleware/utils.js +0 -14
  348. package/lib/projects/localDev/DevServerManagerV2.d.ts +0 -22
  349. package/lib/projects/localDev/DevServerManagerV2.js +0 -81
  350. package/ui/components/Ascii.d.ts +0 -10
  351. package/ui/components/Ascii.js +0 -11
  352. package/ui/views/GetStarted.d.ts +0 -7
  353. package/ui/views/GetStarted.js +0 -157
  354. /package/{lib/middleware/__test__/utils.test.d.ts → commands/project/__tests__/list.test.d.ts} +0 -0
  355. /package/{lib/projects/add/__tests__/v3AddComponent.test.d.ts → commands/project/__tests__/validate.test.d.ts} +0 -0
  356. /package/lib/{projects/create/__tests__/v3.test.d.ts → middleware/__test__/commandTargetingUtils.test.d.ts} +0 -0
  357. /package/lib/projects/localDev/{LocalDevManager.d.ts → LocalDevManager_DEPRECATED.d.ts} +0 -0
package/lib/validation.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as fs from 'fs';
2
2
  import * as path from 'path';
3
- import { logger } from '@hubspot/local-dev-lib/logger';
3
+ import { uiLogger } from '../lib/ui/logger.js';
4
4
  import { CMS_PUBLISH_MODE } from '@hubspot/local-dev-lib/constants/files';
5
5
  import { API_KEY_AUTH_METHOD, OAUTH_AUTH_METHOD, PERSONAL_ACCESS_KEY_AUTH_METHOD, } from '@hubspot/local-dev-lib/constants/auth';
6
6
  import { commaSeparatedValues } from '@hubspot/local-dev-lib/text';
@@ -10,43 +10,43 @@ import { accessTokenForPersonalAccessKey } from '@hubspot/local-dev-lib/personal
10
10
  import { getAbsoluteFilePath, getCwd, getExt, } from '@hubspot/local-dev-lib/path';
11
11
  import { getCmsPublishMode } from './commonOpts.js';
12
12
  import { logError } from './errorHandlers/index.js';
13
+ import { lib } from '../lang/en.js';
13
14
  export async function validateAccount(options) {
14
15
  const { derivedAccountId, userProvidedAccount } = options;
15
16
  const accountId = getAccountId(derivedAccountId);
16
17
  if (!accountId) {
17
18
  if (userProvidedAccount) {
18
- logger.error(`The account "${userProvidedAccount}" could not be found in the config`);
19
+ uiLogger.error(lib.validation.accountNotFoundInConfig(userProvidedAccount));
19
20
  }
20
21
  else {
21
- logger.error('An account needs to be supplied either via "--account" or through setting a "defaultPortal"');
22
+ uiLogger.error(lib.validation.accountRequired);
22
23
  }
23
24
  return false;
24
25
  }
25
26
  if (userProvidedAccount && loadConfigFromEnvironment()) {
26
- throw new Error('Cannot specify an account when environment variables are supplied. Please unset the environment variables or do not use the "--account" flag.');
27
+ throw new Error(lib.validation.userProvidedAccount);
27
28
  }
28
29
  const accountConfig = getAccountConfig(accountId);
29
30
  if (!accountConfig) {
30
- logger.error(`The account ${accountId} has not been configured`);
31
+ uiLogger.error(lib.validation.accountNotConfigured(accountId));
31
32
  return false;
32
33
  }
33
34
  const { authType, auth, apiKey, personalAccessKey } = accountConfig;
34
35
  if (typeof authType === 'string' && authType !== authType.toLowerCase()) {
35
- logger.error(`Invalid "authType" value "${authType}" for account "${accountId}" in config file: ${getConfigPath()}. Valid values are ${commaSeparatedValues([
36
+ uiLogger.error(lib.validation.invalidAuthType(authType, accountId, getConfigPath() || '', commaSeparatedValues([
36
37
  PERSONAL_ACCESS_KEY_AUTH_METHOD,
37
38
  OAUTH_AUTH_METHOD,
38
39
  API_KEY_AUTH_METHOD,
39
- ].map(method => method.value))}.`);
40
+ ].map(method => method.value))));
40
41
  }
41
42
  if (authType === 'oauth2') {
42
43
  if (typeof auth !== 'object') {
43
- logger.error(`The OAuth2 auth configuration for account ${accountId} is missing`);
44
+ uiLogger.error(lib.validation.oauth2ConfigMissing(accountId));
44
45
  return false;
45
46
  }
46
47
  const { clientId, clientSecret, tokenInfo } = auth;
47
48
  if (!clientId || !clientSecret || !tokenInfo || !tokenInfo.refreshToken) {
48
- logger.error(`The OAuth2 configuration for account ${accountId} is incorrect`);
49
- logger.error('Run "hs auth --type=oauth2" to reauthenticate');
49
+ uiLogger.error(lib.validation.oauth2ConfigIncorrect(accountId));
50
50
  return false;
51
51
  }
52
52
  const oauth = getOauthManager(accountId, accountConfig);
@@ -56,7 +56,7 @@ export async function validateAccount(options) {
56
56
  accessToken = await oauth.accessToken();
57
57
  }
58
58
  if (!accessToken) {
59
- logger.error(`The OAuth2 access token could not be found for accountId ${accountId}`);
59
+ uiLogger.error(lib.validation.oauth2AccessTokenNotFound(accountId));
60
60
  return false;
61
61
  }
62
62
  }
@@ -67,13 +67,13 @@ export async function validateAccount(options) {
67
67
  }
68
68
  else if (authType === 'personalaccesskey') {
69
69
  if (!personalAccessKey) {
70
- logger.error(`The account "${accountId}" is configured to use a access key for authentication and is missing a "personalAccessKey" in the configuration file`);
70
+ uiLogger.error(lib.validation.personalAccessKeyMissing(accountId));
71
71
  return false;
72
72
  }
73
73
  try {
74
74
  const accessToken = await accessTokenForPersonalAccessKey(accountId);
75
75
  if (!accessToken) {
76
- logger.error(`An OAuth2 access token for account "${accountId} could not be retrieved using the "personalAccessKey" provided`);
76
+ uiLogger.error(lib.validation.personalAccessKeyTokenRetrievalFailed(accountId));
77
77
  return false;
78
78
  }
79
79
  }
@@ -83,7 +83,7 @@ export async function validateAccount(options) {
83
83
  }
84
84
  }
85
85
  else if (!apiKey) {
86
- logger.error(`The accountId ${accountId} is missing authentication configuration`);
86
+ uiLogger.error(lib.validation.authConfigurationMissing(accountId));
87
87
  return false;
88
88
  }
89
89
  return true;
@@ -93,15 +93,12 @@ export function validateCmsPublishMode(options) {
93
93
  if (CMS_PUBLISH_MODE[cmsPublishMode]) {
94
94
  return true;
95
95
  }
96
- const modesMessage = `Available CMS publish modes are: ${Object.values(CMS_PUBLISH_MODE).join(', ')}.`;
96
+ const modesMessage = lib.validation.availableCMSModes(Object.values(CMS_PUBLISH_MODE).join(', '));
97
97
  if (cmsPublishMode != null) {
98
- logger.error([
99
- `The CMS publish mode "${cmsPublishMode}" is invalid.`,
100
- modesMessage,
101
- ].join(' '));
98
+ uiLogger.error(lib.validation.invalidCmsPublishMode(cmsPublishMode, modesMessage));
102
99
  }
103
100
  else {
104
- logger.error(['The CMS publish mode option is missing.', modesMessage].join(' '));
101
+ uiLogger.error(lib.validation.missingCmsPublishMode(modesMessage));
105
102
  }
106
103
  return false;
107
104
  }
@@ -124,11 +121,11 @@ export function fileExists(_path) {
124
121
  export function checkAndConvertToJson(_path) {
125
122
  const filePath = getAbsoluteFilePath(_path);
126
123
  if (!fileExists(filePath)) {
127
- logger.error(`The path "${_path}" is not a path to a file`);
124
+ uiLogger.error(lib.validation.pathNotFile(_path));
128
125
  return null;
129
126
  }
130
127
  if (getExt(_path) !== 'json') {
131
- logger.error(`The file "${_path}" must be a valid JSON file`);
128
+ uiLogger.error(lib.validation.fileNotJson(_path));
132
129
  return null;
133
130
  }
134
131
  let result;
@@ -136,7 +133,7 @@ export function checkAndConvertToJson(_path) {
136
133
  result = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
137
134
  }
138
135
  catch (e) {
139
- logger.error(`The file "${_path}" contains invalid JSON`);
136
+ uiLogger.error(lib.validation.fileInvalidJson(_path));
140
137
  result = null;
141
138
  }
142
139
  return result;
@@ -13,4 +13,4 @@ export declare function makeYargsBuilder<T>(callback: (yargs: Argv) => Argv<T>,
13
13
  };
14
14
  useJSONOutputOptions?: boolean;
15
15
  }): (yargs: Argv) => Promise<Argv<T>>;
16
- export declare function getExclusiveConflicts(options: string[]): Record<string, string[]>;
16
+ export declare function strictEnforceBoolean(rawArgs: string[], booleanOptions: string[]): boolean;
package/lib/yargsUtils.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { addCustomHelpOutput, addTestingOptions, addAccountOptions, addConfigOptions, addGlobalOptions, addUseEnvironmentOptions, addCmsPublishModeOptions, addJSONOutputOptions, } from './commonOpts.js';
2
2
  import { hasFlag } from './utils/hasFlag.js';
3
+ import { commands } from '../lang/en.js';
3
4
  // Re-export for backwards compatibility
4
5
  export { hasFlag };
5
6
  export function makeYargsBuilder(callback, command, describe, options = {}) {
@@ -34,9 +35,15 @@ export function makeYargsBuilder(callback, command, describe, options = {}) {
34
35
  return result;
35
36
  };
36
37
  }
37
- export function getExclusiveConflicts(options) {
38
- return options.reduce((acc, curr) => {
39
- acc[curr] = options.filter(s => s !== curr);
40
- return acc;
41
- }, {});
38
+ export function strictEnforceBoolean(rawArgs, booleanOptions) {
39
+ for (const option of booleanOptions) {
40
+ const argIndex = rawArgs.findIndex(arg => arg.startsWith(`--${option}=`));
41
+ if (argIndex !== -1) {
42
+ const value = rawArgs[argIndex].split('=')[1];
43
+ if (value && !['true', 'false'].includes(value.toLowerCase())) {
44
+ throw new Error(commands.config.subcommands.set.errors.invalidBoolean(option, value));
45
+ }
46
+ }
47
+ }
48
+ return true;
42
49
  }
@@ -31,7 +31,7 @@ const inputSchema = {
31
31
  };
32
32
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
33
33
  const inputSchemaZodObject = z.object({ ...inputSchema });
34
- const toolName = 'create-hubspot-cms-function';
34
+ const toolName = 'create-cms-function';
35
35
  export class HsCreateFunctionTool extends Tool {
36
36
  constructor(mcpServer) {
37
37
  super(mcpServer);
@@ -13,19 +13,19 @@ declare const inputSchemaZodObject: z.ZodObject<{
13
13
  }, "strip", z.ZodTypeAny, {
14
14
  absoluteCurrentWorkingDirectory: string;
15
15
  dest?: string | undefined;
16
- global?: boolean | undefined;
17
16
  moduleLabel?: string | undefined;
18
17
  reactType?: boolean | undefined;
19
18
  contentTypes?: string | undefined;
19
+ global?: boolean | undefined;
20
20
  availableForNewContent?: boolean | undefined;
21
21
  userSuppliedName?: string | undefined;
22
22
  }, {
23
23
  absoluteCurrentWorkingDirectory: string;
24
24
  dest?: string | undefined;
25
- global?: boolean | undefined;
26
25
  moduleLabel?: string | undefined;
27
26
  reactType?: boolean | undefined;
28
27
  contentTypes?: string | undefined;
28
+ global?: boolean | undefined;
29
29
  availableForNewContent?: boolean | undefined;
30
30
  userSuppliedName?: string | undefined;
31
31
  }>;
@@ -47,7 +47,7 @@ const inputSchema = {
47
47
  };
48
48
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
49
49
  const inputSchemaZodObject = z.object({ ...inputSchema });
50
- const toolName = 'create-hubspot-cms-module';
50
+ const toolName = 'create-cms-module';
51
51
  export class HsCreateModuleTool extends Tool {
52
52
  constructor(mcpServer) {
53
53
  super(mcpServer);
@@ -23,7 +23,7 @@ const inputSchema = {
23
23
  };
24
24
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
25
25
  const inputSchemaZodObject = z.object({ ...inputSchema });
26
- const toolName = 'create-hubspot-cms-template';
26
+ const toolName = 'create-cms-template';
27
27
  export class HsCreateTemplateTool extends Tool {
28
28
  constructor(mcpServer) {
29
29
  super(mcpServer);
@@ -26,7 +26,7 @@ const inputSchema = {
26
26
  };
27
27
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
28
  const inputSchemaZodObject = z.object({ ...inputSchema });
29
- const toolName = 'get-hubspot-cms-serverless-function-logs';
29
+ const toolName = 'get-cms-serverless-function-logs';
30
30
  export class HsFunctionLogsTool extends Tool {
31
31
  constructor(mcpServer) {
32
32
  super(mcpServer);
@@ -69,7 +69,7 @@ export class HsFunctionLogsTool extends Tool {
69
69
  register() {
70
70
  return this.mcpServer.registerTool(toolName, {
71
71
  title: 'Get HubSpot CMS serverless function logs for an endpoint',
72
- description: 'Retrieve logs for HubSpot CMS serverless functions. Use this tool to help debug issues with serverless functions by reading the production logs. Supports various options like latest, compact, and limiting results. Use after listing functions with list-hubspot-cms-serverless-functions to get the endpoint path.',
72
+ description: 'Retrieve logs for HubSpot CMS serverless functions. Use this tool to help debug issues with serverless functions by reading the production logs. Supports various options like latest, compact, and limiting results. Use after listing functions with list-cms-serverless-functions to get the endpoint path.',
73
73
  inputSchema,
74
74
  }, this.handler);
75
75
  }
@@ -18,7 +18,7 @@ const inputSchema = {
18
18
  };
19
19
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
20
20
  const inputSchemaZodObject = z.object({ ...inputSchema });
21
- const toolName = 'list-hubspot-cms-serverless-functions';
21
+ const toolName = 'list-cms-serverless-functions';
22
22
  export class HsListFunctionsTool extends Tool {
23
23
  constructor(mcpServer) {
24
24
  super(mcpServer);
@@ -18,7 +18,7 @@ const inputSchema = {
18
18
  };
19
19
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
20
20
  const inputSchemaZodObject = z.object({ ...inputSchema });
21
- const toolName = 'list-hubspot-cms-remote-contents';
21
+ const toolName = 'list-cms-remote-contents';
22
22
  export class HsListTool extends Tool {
23
23
  constructor(mcpServer) {
24
24
  super(mcpServer);
@@ -28,7 +28,7 @@ describe('HsCreateFunctionTool', () => {
28
28
  describe('register', () => {
29
29
  it('should register the tool with the MCP server', () => {
30
30
  const result = tool.register();
31
- expect(mockMcpServer.registerTool).toHaveBeenCalledWith('create-hubspot-cms-function', {
31
+ expect(mockMcpServer.registerTool).toHaveBeenCalledWith('create-cms-function', {
32
32
  title: 'Create HubSpot CMS Serverless Function',
33
33
  description: `Creates a new HubSpot CMS serverless function using the hs create function command. Functions can be created non-interactively by specifying functionsFolder, filename, and endpointPath. Supports all HTTP methods (${HTTP_METHODS.join(', ')}).`,
34
34
  inputSchema: expect.any(Object),
@@ -27,7 +27,7 @@ describe('HsCreateModuleTool', () => {
27
27
  describe('register', () => {
28
28
  it('should register the tool with the MCP server', () => {
29
29
  const result = tool.register();
30
- expect(mockMcpServer.registerTool).toHaveBeenCalledWith('create-hubspot-cms-module', {
30
+ expect(mockMcpServer.registerTool).toHaveBeenCalledWith('create-cms-module', {
31
31
  title: 'Create HubSpot CMS Module',
32
32
  description: 'Creates a new HubSpot CMS module using the hs create module command. Modules can be created non-interactively by specifying moduleLabel and other module options. You can create either HubL or React modules by setting the reactType parameter.',
33
33
  inputSchema: expect.any(Object),
@@ -28,7 +28,7 @@ describe('HsCreateTemplateTool', () => {
28
28
  describe('register', () => {
29
29
  it('should register the tool with the MCP server', () => {
30
30
  const result = tool.register();
31
- expect(mockMcpServer.registerTool).toHaveBeenCalledWith('create-hubspot-cms-template', {
31
+ expect(mockMcpServer.registerTool).toHaveBeenCalledWith('create-cms-template', {
32
32
  title: 'Create HubSpot CMS Template',
33
33
  description: `Creates a new HubSpot CMS template using the hs create template command. Templates can be created non-interactively by specifying templateType. Supports all template types including: ${TEMPLATE_TYPES.join(', ')}.`,
34
34
  inputSchema: expect.any(Object),
@@ -27,9 +27,9 @@ describe('HsFunctionLogsTool', () => {
27
27
  describe('register', () => {
28
28
  it('should register the tool with the MCP server', () => {
29
29
  const result = tool.register();
30
- expect(mockMcpServer.registerTool).toHaveBeenCalledWith('get-hubspot-cms-serverless-function-logs', expect.objectContaining({
30
+ expect(mockMcpServer.registerTool).toHaveBeenCalledWith('get-cms-serverless-function-logs', expect.objectContaining({
31
31
  title: 'Get HubSpot CMS serverless function logs for an endpoint',
32
- description: 'Retrieve logs for HubSpot CMS serverless functions. Use this tool to help debug issues with serverless functions by reading the production logs. Supports various options like latest, compact, and limiting results. Use after listing functions with list-hubspot-cms-serverless-functions to get the endpoint path.',
32
+ description: 'Retrieve logs for HubSpot CMS serverless functions. Use this tool to help debug issues with serverless functions by reading the production logs. Supports various options like latest, compact, and limiting results. Use after listing functions with list-cms-serverless-functions to get the endpoint path.',
33
33
  inputSchema: expect.any(Object),
34
34
  }), expect.any(Function));
35
35
  expect(result).toBe(mockRegisteredTool);
@@ -27,7 +27,7 @@ describe('HsListFunctionsTool', () => {
27
27
  describe('register', () => {
28
28
  it('should register the tool with the MCP server', () => {
29
29
  const result = tool.register();
30
- expect(mockMcpServer.registerTool).toHaveBeenCalledWith('list-hubspot-cms-serverless-functions', {
30
+ expect(mockMcpServer.registerTool).toHaveBeenCalledWith('list-cms-serverless-functions', {
31
31
  title: 'List HubSpot CMS Serverless Functions',
32
32
  description: 'Get a list of all serverless functions deployed in a HubSpot portal/account. Shows function routes, HTTP methods, secrets, and timestamps.',
33
33
  inputSchema: expect.any(Object),
@@ -27,7 +27,7 @@ describe('HsListTool', () => {
27
27
  describe('register', () => {
28
28
  it('should register the tool with the MCP server', () => {
29
29
  const result = tool.register();
30
- expect(mockMcpServer.registerTool).toHaveBeenCalledWith('list-hubspot-cms-remote-contents', {
30
+ expect(mockMcpServer.registerTool).toHaveBeenCalledWith('list-cms-remote-contents', {
31
31
  title: 'List HubSpot CMS Directory Contents',
32
32
  description: 'List remote contents of a HubSpot CMS directory.',
33
33
  inputSchema: expect.any(Object),
@@ -7,6 +7,8 @@ import { ValidateProjectTool } from './project/ValidateProjectTool.js';
7
7
  import { GetConfigValuesTool } from './project/GetConfigValuesTool.js';
8
8
  import { DocsSearchTool } from './project/DocsSearchTool.js';
9
9
  import { DocFetchTool } from './project/DocFetchTool.js';
10
+ import { GetApiUsagePatternsByAppIdTool } from './project/GetApiUsagePatternsByAppIdTool.js';
11
+ import { GetApplicationInfoTool } from './project/GetApplicationInfoTool.js';
10
12
  import { HsListTool } from './cms/HsListTool.js';
11
13
  import { HsCreateModuleTool } from './cms/HsCreateModuleTool.js';
12
14
  import { HsCreateTemplateTool } from './cms/HsCreateTemplateTool.js';
@@ -24,6 +26,8 @@ export function registerProjectTools(mcpServer) {
24
26
  new GetConfigValuesTool(mcpServer).register(),
25
27
  new DocsSearchTool(mcpServer).register(),
26
28
  new DocFetchTool(mcpServer).register(),
29
+ new GetApiUsagePatternsByAppIdTool(mcpServer).register(),
30
+ new GetApplicationInfoTool(mcpServer).register(),
27
31
  ];
28
32
  }
29
33
  export function registerCmsTools(mcpServer) {
@@ -6,19 +6,19 @@ declare const inputSchemaZodObject: z.ZodObject<{
6
6
  addApp: z.ZodBoolean;
7
7
  distribution: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"marketplace">, z.ZodLiteral<"private">]>>;
8
8
  auth: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"static">, z.ZodLiteral<"oauth">]>>;
9
- features: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">, z.ZodLiteral<"workflow-action">, z.ZodLiteral<"workflow-action-tool">, z.ZodLiteral<"app-object">, z.ZodLiteral<"scim">]>, "many">>;
9
+ features: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">, z.ZodLiteral<"workflow-action">, z.ZodLiteral<"workflow-action-tool">, z.ZodLiteral<"app-object">, z.ZodLiteral<"app-event">, z.ZodLiteral<"scim">, z.ZodLiteral<"page">]>, "many">>;
10
10
  }, "strip", z.ZodTypeAny, {
11
11
  absoluteProjectPath: string;
12
12
  addApp: boolean;
13
13
  auth?: "oauth" | "static" | undefined;
14
14
  distribution?: "marketplace" | "private" | undefined;
15
- features?: ("card" | "settings" | "workflow-action-tool" | "workflow-action" | "app-function" | "webhooks" | "app-object" | "scim")[] | undefined;
15
+ features?: ("card" | "settings" | "page" | "app-event" | "workflow-action-tool" | "workflow-action" | "app-function" | "webhooks" | "app-object" | "scim")[] | undefined;
16
16
  }, {
17
17
  absoluteProjectPath: string;
18
18
  addApp: boolean;
19
19
  auth?: "oauth" | "static" | undefined;
20
20
  distribution?: "marketplace" | "private" | undefined;
21
- features?: ("card" | "settings" | "workflow-action-tool" | "workflow-action" | "app-function" | "webhooks" | "app-object" | "scim")[] | undefined;
21
+ features?: ("card" | "settings" | "page" | "app-event" | "workflow-action-tool" | "workflow-action" | "app-function" | "webhooks" | "app-object" | "scim")[] | undefined;
22
22
  }>;
23
23
  export type AddFeatureInputSchema = z.infer<typeof inputSchemaZodObject>;
24
24
  export declare class AddFeatureToProjectTool extends Tool<AddFeatureInputSchema> {
@@ -16,20 +16,20 @@ const inputSchema = {
16
16
  z.literal(APP_DISTRIBUTION_TYPES.MARKETPLACE),
17
17
  z.literal(APP_DISTRIBUTION_TYPES.PRIVATE),
18
18
  ]))
19
- .describe('Private is used if you do not wish to distribute your application on the HubSpot marketplace. If not specified by the user, do not choose for them. This cannot be changed after a project is uploaded.'),
19
+ .describe('If not specified by the user, DO NOT choose for them. This cannot be changed after a project is uploaded. Private is used if you do not wish to distribute your application on the HubSpot marketplace. '),
20
20
  auth: z
21
21
  .optional(z.union([
22
22
  z.literal(APP_AUTH_TYPES.STATIC),
23
23
  z.literal(APP_AUTH_TYPES.OAUTH),
24
24
  ]))
25
- .describe('Static uses a static non changing authentication token, and is only available for private distribution. If not specified by the user, do not choose for them. This cannot be changed after a project is uploaded.'),
25
+ .describe('If not specified by the user, DO NOT choose for them. This cannot be changed after a project is uploaded. Static uses a static non changing authentication token, and is only available for private distribution. '),
26
26
  features,
27
27
  };
28
28
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
29
29
  const inputSchemaZodObject = z.object({
30
30
  ...inputSchema,
31
31
  });
32
- const toolName = 'add-feature-to-hubspot-project';
32
+ const toolName = 'add-feature-to-project';
33
33
  export class AddFeatureToProjectTool extends Tool {
34
34
  constructor(mcpServer) {
35
35
  super(mcpServer);
@@ -8,7 +8,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
8
8
  projectBase: z.ZodUnion<[z.ZodLiteral<"empty">, z.ZodLiteral<"app">]>;
9
9
  distribution: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"marketplace">, z.ZodLiteral<"private">]>>;
10
10
  auth: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"static">, z.ZodLiteral<"oauth">]>>>;
11
- features: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">, z.ZodLiteral<"workflow-action">, z.ZodLiteral<"workflow-action-tool">, z.ZodLiteral<"app-object">, z.ZodLiteral<"scim">]>, "many">>;
11
+ features: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">, z.ZodLiteral<"workflow-action">, z.ZodLiteral<"workflow-action-tool">, z.ZodLiteral<"app-object">, z.ZodLiteral<"app-event">, z.ZodLiteral<"scim">, z.ZodLiteral<"page">]>, "many">>;
12
12
  }, "strip", z.ZodTypeAny, {
13
13
  projectBase: "app" | "empty";
14
14
  absoluteCurrentWorkingDirectory: string;
@@ -16,7 +16,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
16
16
  name?: string | undefined;
17
17
  auth?: "oauth" | "static" | undefined;
18
18
  distribution?: "marketplace" | "private" | undefined;
19
- features?: ("card" | "settings" | "workflow-action-tool" | "workflow-action" | "app-function" | "webhooks" | "app-object" | "scim")[] | undefined;
19
+ features?: ("card" | "settings" | "page" | "app-event" | "workflow-action-tool" | "workflow-action" | "app-function" | "webhooks" | "app-object" | "scim")[] | undefined;
20
20
  }, {
21
21
  projectBase: "app" | "empty";
22
22
  absoluteCurrentWorkingDirectory: string;
@@ -24,7 +24,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
24
24
  name?: string | undefined;
25
25
  auth?: "oauth" | "static" | undefined;
26
26
  distribution?: "marketplace" | "private" | undefined;
27
- features?: ("card" | "settings" | "workflow-action-tool" | "workflow-action" | "app-function" | "webhooks" | "app-object" | "scim")[] | undefined;
27
+ features?: ("card" | "settings" | "page" | "app-event" | "workflow-action-tool" | "workflow-action" | "app-function" | "webhooks" | "app-object" | "scim")[] | undefined;
28
28
  }>;
29
29
  export type CreateProjectInputSchema = z.infer<typeof inputSchemaZodObject>;
30
30
  export declare class CreateProjectTool extends Tool<CreateProjectInputSchema> {
@@ -10,11 +10,11 @@ const inputSchema = {
10
10
  absoluteCurrentWorkingDirectory,
11
11
  name: z
12
12
  .string()
13
- .describe('The name of the project to be created. This name is how your project will appear in HubSpot. If not specified by the user, do not choose for them. Changing this is potentially destructive.')
13
+ .describe('If not specified by the user, DO NOT choose for them. Changing this is potentially destructive.The name of the project to be created. This name is how your project will appear in HubSpot. ')
14
14
  .optional(),
15
15
  destination: z
16
16
  .string()
17
- .describe('Relative path to the directory the project will be created in. DO NOT use the current directory unless the user has explicitly stated to do so.'),
17
+ .describe('DO NOT use the current directory unless the user has explicitly stated to do so. Relative path to the directory the project will be created in.'),
18
18
  projectBase: z
19
19
  .union([z.literal(EMPTY_PROJECT), z.literal(PROJECT_WITH_APP)])
20
20
  .describe('Empty will create an empty project, and app will create a project with an app inside of it.'),
@@ -23,19 +23,19 @@ const inputSchema = {
23
23
  z.literal(APP_DISTRIBUTION_TYPES.MARKETPLACE),
24
24
  z.literal(APP_DISTRIBUTION_TYPES.PRIVATE),
25
25
  ]))
26
- .describe('Private is used if you do not wish to distribute your application on the HubSpot marketplace. If not specified by the user, do not choose for them. This cannot be changed after a project is uploaded.'),
26
+ .describe('If not specified by the user, DO NOT choose for them. This cannot be changed after a project is uploaded. Private is used if you do not wish to distribute your application on the HubSpot marketplace. '),
27
27
  auth: z
28
28
  .optional(z.union([
29
29
  z.literal(APP_AUTH_TYPES.STATIC),
30
30
  z.literal(APP_AUTH_TYPES.OAUTH),
31
31
  ]))
32
- .describe('Static uses a static non changing authentication token, and is only available for private distribution. If not specified by the user, do not choose for them. This cannot be changed after a project is uploaded.')
32
+ .describe('If not specified by the user, DO NOT choose for them. This cannot be changed after a project is uploaded. Static uses a static non changing authentication token, and is only available for private distribution. ')
33
33
  .optional(),
34
34
  features,
35
35
  };
36
36
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
37
37
  const inputSchemaZodObject = z.object({ ...inputSchema });
38
- const toolName = 'create-hubspot-project';
38
+ const toolName = 'create-project';
39
39
  export class CreateProjectTool extends Tool {
40
40
  constructor(mcpServer) {
41
41
  super(mcpServer);
@@ -15,7 +15,7 @@ const inputSchema = {
15
15
  const inputSchemaZodObject = z.object({
16
16
  ...inputSchema,
17
17
  });
18
- const toolName = 'deploy-hubspot-project';
18
+ const toolName = 'deploy-project';
19
19
  export class DeployProjectTool extends Tool {
20
20
  constructor(mcpServer) {
21
21
  super(mcpServer);
@@ -12,7 +12,7 @@ const inputSchema = {
12
12
  const inputSchemaZodObject = z.object({
13
13
  ...inputSchema,
14
14
  });
15
- const toolName = 'fetch-hubspot-doc';
15
+ const toolName = 'fetch-doc';
16
16
  export class DocFetchTool extends Tool {
17
17
  constructor(mcpServer) {
18
18
  super(mcpServer);
@@ -42,7 +42,7 @@ export class DocFetchTool extends Tool {
42
42
  register() {
43
43
  return this.mcpServer.registerTool(toolName, {
44
44
  title: 'Fetch HubSpot Developer Documentation (single file)',
45
- description: 'Always use this immediately after `search-hubspot-docs` and before creating a plan, writing code, or answering technical questions. This tool retrieves the full, authoritative content of a HubSpot Developer Documentation page from its URL, ensuring responses are accurate, up-to-date, and grounded in the official docs.',
45
+ description: 'Always use this immediately after `search-docs` and before creating a plan, writing code, or answering technical questions. This tool retrieves the full, authoritative content of a HubSpot Developer Documentation page from its URL, ensuring responses are accurate, up-to-date, and grounded in the official docs.',
46
46
  inputSchema,
47
47
  }, this.handler);
48
48
  }
@@ -2,10 +2,13 @@ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.
2
2
  import z from 'zod';
3
3
  import { TextContentResponse, Tool } from '../../types.js';
4
4
  declare const inputSchemaZodObject: z.ZodObject<{
5
+ absoluteCurrentWorkingDirectory: z.ZodString;
5
6
  docsSearchQuery: z.ZodString;
6
7
  }, "strip", z.ZodTypeAny, {
8
+ absoluteCurrentWorkingDirectory: string;
7
9
  docsSearchQuery: string;
8
10
  }, {
11
+ absoluteCurrentWorkingDirectory: string;
9
12
  docsSearchQuery: string;
10
13
  }>;
11
14
  export interface DocsSearchResponse {
@@ -20,7 +23,7 @@ export interface DocsSearchResponse {
20
23
  type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
21
24
  export declare class DocsSearchTool extends Tool<InputSchemaType> {
22
25
  constructor(mcpServer: McpServer);
23
- handler({ docsSearchQuery, }: InputSchemaType): Promise<TextContentResponse>;
26
+ handler({ absoluteCurrentWorkingDirectory, docsSearchQuery, }: InputSchemaType): Promise<TextContentResponse>;
24
27
  register(): RegisteredTool;
25
28
  }
26
29
  export {};
@@ -3,25 +3,25 @@ import z from 'zod';
3
3
  import { Tool } from '../../types.js';
4
4
  import { formatTextContents } from '../../utils/content.js';
5
5
  import { trackToolUsage } from '../../utils/toolUsageTracking.js';
6
- import { docsSearchQuery } from './constants.js';
7
- import { getAccountId, getConfigPath, loadConfig, } from '@hubspot/local-dev-lib/config';
6
+ import { absoluteCurrentWorkingDirectory, docsSearchQuery, } from './constants.js';
8
7
  import { isHubSpotHttpError } from '@hubspot/local-dev-lib/errors/index';
8
+ import { getAccountIdFromCliConfig } from '../../utils/cliConfig.js';
9
9
  const inputSchema = {
10
+ absoluteCurrentWorkingDirectory,
10
11
  docsSearchQuery,
11
12
  };
12
13
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
13
14
  const inputSchemaZodObject = z.object({
14
15
  ...inputSchema,
15
16
  });
16
- const toolName = 'search-hubspot-docs';
17
+ const toolName = 'search-docs';
17
18
  export class DocsSearchTool extends Tool {
18
19
  constructor(mcpServer) {
19
20
  super(mcpServer);
20
21
  }
21
- async handler({ docsSearchQuery, }) {
22
+ async handler({ absoluteCurrentWorkingDirectory, docsSearchQuery, }) {
22
23
  await trackToolUsage(toolName, { mode: docsSearchQuery });
23
- loadConfig(getConfigPath());
24
- const accountId = getAccountId();
24
+ const accountId = getAccountIdFromCliConfig(absoluteCurrentWorkingDirectory);
25
25
  if (!accountId) {
26
26
  const authErrorMessage = `No account ID found. Please run \`hs account auth\` to configure an account, or set a default account with \`hs account use <account>\``;
27
27
  return formatTextContents(authErrorMessage);
@@ -55,7 +55,7 @@ export class DocsSearchTool extends Tool {
55
55
  register() {
56
56
  return this.mcpServer.registerTool(toolName, {
57
57
  title: 'Search HubSpot Developer Documentation',
58
- description: 'Use this first whenever you need details about HubSpot APIs, SDKs, integrations, or developer platform features. This searches the official HubSpot Developer Documentation and returns the most relevant pages, each with a URL for use in `fetch-hubspot-doc`. Always follow this with a fetch to get the full, authoritative content before making plans or writing answers.',
58
+ description: 'Use this first whenever you need details about HubSpot APIs, SDKs, integrations, or developer platform features. This searches the official HubSpot Developer Documentation and returns the most relevant pages, each with a URL for use in `fetch-doc`. Always follow this with a fetch to get the full, authoritative content before making plans or writing answers.',
59
59
  inputSchema,
60
60
  }, this.handler);
61
61
  }
@@ -0,0 +1,23 @@
1
+ import { TextContentResponse, Tool } from '../../types.js';
2
+ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { z } from 'zod';
4
+ declare const inputSchemaZodObject: z.ZodObject<{
5
+ appId: z.ZodString;
6
+ startDate: z.ZodOptional<z.ZodString>;
7
+ endDate: z.ZodOptional<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ appId: string;
10
+ startDate?: string | undefined;
11
+ endDate?: string | undefined;
12
+ }, {
13
+ appId: string;
14
+ startDate?: string | undefined;
15
+ endDate?: string | undefined;
16
+ }>;
17
+ export type GetApiUsagePatternsByAppIdInputSchema = z.infer<typeof inputSchemaZodObject>;
18
+ export declare class GetApiUsagePatternsByAppIdTool extends Tool<GetApiUsagePatternsByAppIdInputSchema> {
19
+ constructor(mcpServer: McpServer);
20
+ handler({ appId, startDate, endDate, }: GetApiUsagePatternsByAppIdInputSchema): Promise<TextContentResponse>;
21
+ register(): RegisteredTool;
22
+ }
23
+ export {};