@hubspot/cli 7.6.0-beta.2 → 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
@@ -0,0 +1,37 @@
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
+ const yargs_1 = __importDefault(require("yargs"));
7
+ const createConfig_1 = __importDefault(require("../createConfig"));
8
+ vi.mock('../../../lib/commonOpts');
9
+ describe('commands/testAccount/createConfig', () => {
10
+ const yargsMock = yargs_1.default;
11
+ describe('command', () => {
12
+ it('should have the correct command structure', () => {
13
+ expect(createConfig_1.default.command).toEqual('create-config');
14
+ });
15
+ });
16
+ describe('describe', () => {
17
+ it('should provide a description', () => {
18
+ expect(createConfig_1.default.describe).toBeDefined();
19
+ });
20
+ });
21
+ describe('builder', () => {
22
+ it('should support the correct options', () => {
23
+ const optionSpy = vi.spyOn(yargsMock, 'option');
24
+ createConfig_1.default.builder(yargsMock);
25
+ expect(yargsMock.example).toHaveBeenCalledTimes(1);
26
+ expect(optionSpy).toHaveBeenCalledWith('name', expect.objectContaining({
27
+ type: 'string',
28
+ }));
29
+ expect(optionSpy).toHaveBeenCalledWith('description', expect.objectContaining({
30
+ type: 'string',
31
+ }));
32
+ expect(optionSpy).toHaveBeenCalledWith('path', expect.objectContaining({
33
+ type: 'string',
34
+ }));
35
+ });
36
+ });
37
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
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
+ const yargs_1 = __importDefault(require("yargs"));
7
+ const commonOpts_1 = require("../../../lib/commonOpts");
8
+ const delete_1 = __importDefault(require("../delete"));
9
+ vi.mock('../../../lib/commonOpts');
10
+ describe('commands/testAccount/delete', () => {
11
+ const yargsMock = yargs_1.default;
12
+ describe('command', () => {
13
+ it('should have the correct command structure', () => {
14
+ expect(delete_1.default.command).toEqual('delete <test-account-id>');
15
+ });
16
+ });
17
+ describe('describe', () => {
18
+ it('should provide a description', () => {
19
+ expect(delete_1.default.describe).toBeDefined();
20
+ });
21
+ });
22
+ describe('builder', () => {
23
+ it('should support the correct options', () => {
24
+ delete_1.default.builder(yargsMock);
25
+ expect(yargsMock.example).toHaveBeenCalledTimes(1);
26
+ expect(commonOpts_1.addTestingOptions).toHaveBeenCalledTimes(1);
27
+ expect(commonOpts_1.addTestingOptions).toHaveBeenCalledWith(yargsMock);
28
+ expect(commonOpts_1.addAccountOptions).toHaveBeenCalledTimes(1);
29
+ expect(commonOpts_1.addAccountOptions).toHaveBeenCalledWith(yargsMock);
30
+ expect(commonOpts_1.addConfigOptions).toHaveBeenCalledTimes(1);
31
+ expect(commonOpts_1.addConfigOptions).toHaveBeenCalledWith(yargsMock);
32
+ expect(commonOpts_1.addUseEnvironmentOptions).toHaveBeenCalledTimes(1);
33
+ expect(commonOpts_1.addUseEnvironmentOptions).toHaveBeenCalledWith(yargsMock);
34
+ });
35
+ });
36
+ });
@@ -77,7 +77,6 @@ async function handler(args) {
77
77
  if (formatOutputAsJson) {
78
78
  jsonOutput.accountName = data.accountName;
79
79
  jsonOutput.accountId = data.id;
80
- jsonOutput.personalAccessKey = data.personalAccessKey;
81
80
  }
82
81
  testAccountId = data.id;
83
82
  }
@@ -93,16 +92,30 @@ async function handler(args) {
93
92
  successStates: ['SUCCESS'],
94
93
  errorStates: [],
95
94
  });
96
- SpinniesManager_1.default.succeed('createTestAccount', {
97
- text: en_1.commands.testAccount.create.polling.success(testAccountConfig.accountName, testAccountId),
95
+ }
96
+ catch (err) {
97
+ (0, errorHandlers_1.debugError)(err);
98
+ SpinniesManager_1.default.fail('createTestAccount', {
99
+ text: en_1.commands.testAccount.create.polling.failure,
98
100
  });
99
101
  }
102
+ // HACK: The status endpoint sometimes returns an early success status.
103
+ // Sleep for an extra 5 seconds to make sure the sync is actually complete.
104
+ await new Promise(resolve => setTimeout(resolve, 5000));
105
+ try {
106
+ // Attempt to generate a new personal access key for the test account now that gate sync is complete.
107
+ const { data } = await (0, developerTestAccounts_1.generateDeveloperTestAccountPersonalAccessKey)(derivedAccountId, testAccountId);
108
+ jsonOutput.personalAccessKey = data.personalAccessKey;
109
+ }
100
110
  catch (err) {
101
111
  (0, errorHandlers_1.debugError)(err);
102
112
  SpinniesManager_1.default.fail('createTestAccount', {
103
113
  text: en_1.commands.testAccount.create.polling.failure,
104
114
  });
105
115
  }
116
+ SpinniesManager_1.default.succeed('createTestAccount', {
117
+ text: en_1.commands.testAccount.create.polling.success(testAccountConfig.accountName, testAccountId),
118
+ });
106
119
  if (formatOutputAsJson) {
107
120
  logger_1.uiLogger.json(jsonOutput);
108
121
  }
@@ -1,9 +1,7 @@
1
1
  import { CommonArgs, YargsCommandModule } from '../../types/Yargs';
2
- import { HubConfig } from '../../lib/prompts/createDeveloperTestAccountConfigPrompt';
3
2
  type CreateTestAccountConfigArgs = CommonArgs & {
4
3
  name?: string;
5
4
  description?: string;
6
- tiers?: HubConfig[];
7
5
  path?: string;
8
6
  };
9
7
  declare const createTestAccountConfigCommand: YargsCommandModule<unknown, CreateTestAccountConfigArgs>;
@@ -17,20 +17,20 @@ const validation_1 = require("../../lib/validation");
17
17
  const command = 'create-config';
18
18
  const describe = en_1.commands.testAccount.createConfig.describe;
19
19
  async function handler(args) {
20
- const { derivedAccountId, name, tiers, description, path: configPath } = args;
20
+ const { derivedAccountId, name, description, path: configPath } = args;
21
21
  (0, usageTracking_1.trackCommandUsage)('test-account-create-config', {}, derivedAccountId);
22
22
  let accountConfigPath = configPath;
23
23
  const testAccountConfig = await (0, createDeveloperTestAccountConfigPrompt_1.createDeveloperTestAccountConfigPrompt)({
24
24
  name,
25
25
  description,
26
- tiers,
27
26
  });
28
27
  if (!accountConfigPath) {
29
28
  const pathPromptResult = await (0, promptUtils_1.promptUser)({
30
29
  name: 'path',
31
30
  message: en_1.commands.testAccount.createConfig.pathPrompt,
32
31
  type: 'input',
33
- default: 'test-account-config.json',
32
+ default: testAccountConfig.accountName.toLowerCase().replace(/\s+/g, '-') +
33
+ '.json',
34
34
  validate: path => {
35
35
  if (!path) {
36
36
  return en_1.commands.testAccount.createConfig.errors.pathError;
@@ -38,6 +38,9 @@ async function handler(args) {
38
38
  else if (!path.endsWith('.json')) {
39
39
  return en_1.commands.testAccount.createConfig.errors.pathFormatError;
40
40
  }
41
+ else if ((0, validation_1.fileExists)(path)) {
42
+ return en_1.commands.testAccount.createConfig.errors.pathExistsError;
43
+ }
41
44
  return true;
42
45
  },
43
46
  });
@@ -70,17 +73,13 @@ function createTestAccountConfigBuilder(yargs) {
70
73
  type: 'string',
71
74
  description: en_1.commands.testAccount.createConfig.options.description,
72
75
  });
73
- yargs.option('tiers', {
74
- type: 'array',
75
- description: en_1.commands.testAccount.createConfig.options.tiers,
76
- });
77
76
  yargs.option('path', {
78
77
  type: 'string',
79
78
  description: en_1.commands.testAccount.createConfig.options.path,
80
79
  });
81
80
  yargs.example([
82
81
  [
83
- '$0 create-config --name my-account',
82
+ '$0 test-account create-config --name my-account',
84
83
  en_1.commands.testAccount.createConfig.example('my-account'),
85
84
  ],
86
85
  ]);
@@ -0,0 +1,33 @@
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
+ const yargs_1 = __importDefault(require("yargs"));
7
+ const generate_selectors_1 = __importDefault(require("../generate-selectors"));
8
+ const positionalSpy = vi
9
+ .spyOn(yargs_1.default, 'positional')
10
+ .mockReturnValue(yargs_1.default);
11
+ describe('commands/theme/generate-selectors', () => {
12
+ describe('command', () => {
13
+ it('should have the correct command structure', () => {
14
+ expect(generate_selectors_1.default.command).toEqual('generate-selectors <path>');
15
+ });
16
+ });
17
+ describe('describe', () => {
18
+ it('should provide a description', () => {
19
+ expect(generate_selectors_1.default.describe).toBeDefined();
20
+ });
21
+ });
22
+ describe('builder', () => {
23
+ it('should support the correct options', () => {
24
+ generate_selectors_1.default.builder(yargs_1.default);
25
+ expect(positionalSpy).toHaveBeenCalledTimes(1);
26
+ expect(positionalSpy).toHaveBeenCalledWith('path', {
27
+ describe: expect.any(String),
28
+ required: true,
29
+ type: 'string',
30
+ });
31
+ });
32
+ });
33
+ });
@@ -0,0 +1,41 @@
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
+ const yargs_1 = __importDefault(require("yargs"));
7
+ const commonOpts_1 = require("../../../lib/commonOpts");
8
+ const marketplace_validate_1 = __importDefault(require("../marketplace-validate"));
9
+ vi.mock('../../../lib/commonOpts');
10
+ const positionalSpy = vi
11
+ .spyOn(yargs_1.default, 'positional')
12
+ .mockReturnValue(yargs_1.default);
13
+ describe('commands/theme/marketplace-validate', () => {
14
+ describe('command', () => {
15
+ it('should have the correct command structure', () => {
16
+ expect(marketplace_validate_1.default.command).toEqual('marketplace-validate <path>');
17
+ });
18
+ });
19
+ describe('describe', () => {
20
+ it('should provide a description', () => {
21
+ expect(marketplace_validate_1.default.describe).toBeDefined();
22
+ });
23
+ });
24
+ describe('builder', () => {
25
+ it('should support the correct options', () => {
26
+ marketplace_validate_1.default.builder(yargs_1.default);
27
+ expect(positionalSpy).toHaveBeenCalledTimes(1);
28
+ expect(positionalSpy).toHaveBeenCalledWith('path', {
29
+ describe: expect.any(String),
30
+ required: true,
31
+ type: 'string',
32
+ });
33
+ expect(commonOpts_1.addAccountOptions).toHaveBeenCalledTimes(1);
34
+ expect(commonOpts_1.addAccountOptions).toHaveBeenCalledWith(yargs_1.default);
35
+ expect(commonOpts_1.addConfigOptions).toHaveBeenCalledTimes(1);
36
+ expect(commonOpts_1.addConfigOptions).toHaveBeenCalledWith(yargs_1.default);
37
+ expect(commonOpts_1.addUseEnvironmentOptions).toHaveBeenCalledTimes(1);
38
+ expect(commonOpts_1.addUseEnvironmentOptions).toHaveBeenCalledWith(yargs_1.default);
39
+ });
40
+ });
41
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,65 @@
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
+ const yargs_1 = __importDefault(require("yargs"));
7
+ const commonOpts_1 = require("../../../lib/commonOpts");
8
+ const preview_1 = __importDefault(require("../preview"));
9
+ vi.mock('../../../lib/commonOpts');
10
+ const optionSpy = vi
11
+ .spyOn(yargs_1.default, 'option')
12
+ .mockReturnValue(yargs_1.default);
13
+ describe('commands/theme/preview', () => {
14
+ describe('command', () => {
15
+ it('should have the correct command structure', () => {
16
+ expect(preview_1.default.command).toEqual('preview [--src] [--dest]');
17
+ });
18
+ });
19
+ describe('describe', () => {
20
+ it('should provide a description', () => {
21
+ expect(preview_1.default.describe).toBeDefined();
22
+ });
23
+ });
24
+ describe('builder', () => {
25
+ it('should support the correct options', () => {
26
+ preview_1.default.builder(yargs_1.default);
27
+ expect(optionSpy).toHaveBeenCalledWith('src', {
28
+ describe: expect.any(String),
29
+ type: 'string',
30
+ requiresArg: true,
31
+ });
32
+ expect(optionSpy).toHaveBeenCalledWith('dest', {
33
+ describe: expect.any(String),
34
+ type: 'string',
35
+ requiresArg: true,
36
+ });
37
+ expect(optionSpy).toHaveBeenCalledWith('notify', {
38
+ describe: expect.any(String),
39
+ alias: 'n',
40
+ type: 'string',
41
+ requiresArg: true,
42
+ });
43
+ expect(optionSpy).toHaveBeenCalledWith('no-ssl', {
44
+ describe: expect.any(String),
45
+ type: 'boolean',
46
+ });
47
+ expect(optionSpy).toHaveBeenCalledWith('port', {
48
+ describe: expect.any(String),
49
+ type: 'number',
50
+ });
51
+ expect(optionSpy).toHaveBeenCalledWith('resetSession', {
52
+ hidden: true,
53
+ type: 'boolean',
54
+ });
55
+ expect(optionSpy).toHaveBeenCalledWith('generateFieldsTypes', {
56
+ hidden: true,
57
+ type: 'boolean',
58
+ });
59
+ expect(commonOpts_1.addAccountOptions).toHaveBeenCalledTimes(1);
60
+ expect(commonOpts_1.addAccountOptions).toHaveBeenCalledWith(yargs_1.default);
61
+ expect(commonOpts_1.addConfigOptions).toHaveBeenCalledTimes(1);
62
+ expect(commonOpts_1.addConfigOptions).toHaveBeenCalledWith(yargs_1.default);
63
+ });
64
+ });
65
+ });
package/lang/en.d.ts CHANGED
@@ -837,6 +837,7 @@ Global configuration replaces hubspot.config.yml, and you will be prompted to mi
837
837
  readonly success: (derivedTargets: string[]) => string;
838
838
  readonly errors: {
839
839
  readonly needsNode20: "This feature requires node >=20";
840
+ readonly errorParsingJsonFIle: (filename: string, errorMessage: string) => string;
840
841
  };
841
842
  readonly spinners: {
842
843
  readonly failedToConfigure: "Failed to configure the HubSpot mcp server.";
@@ -1833,7 +1834,6 @@ ${string}`;
1833
1834
  readonly options: {
1834
1835
  readonly name: "The name of the test account";
1835
1836
  readonly description: "The description of the test account";
1836
- readonly tiers: "The tiers of the test account";
1837
1837
  readonly path: "The path to the test account config";
1838
1838
  };
1839
1839
  readonly example: (name: string) => string;
@@ -2847,9 +2847,22 @@ Run ${string} to upgrade to version ${string}`;
2847
2847
  readonly createDeveloperTestAccountConfigPrompt: {
2848
2848
  readonly namePrompt: "[--name] What is the name of the test account?";
2849
2849
  readonly descriptionPrompt: "[--description] What is the description of the test account?";
2850
- readonly tiersPrompt: "[--tiers] Which product tiers should the test account have?";
2850
+ readonly useDefaultAccountLevelsPrompt: {
2851
+ readonly message: "Would you like to create a default Test Account, or customize your own?";
2852
+ readonly default: "Default (All Hubs, ENTERPRISE)";
2853
+ readonly manual: "Customize my own";
2854
+ };
2855
+ readonly tiersPrompt: "Select an option per hub to customize tiers. If left blank, default is ENTERPRISE";
2856
+ readonly hubTypes: {
2857
+ readonly marketing: "Marketing";
2858
+ readonly ops: "Ops";
2859
+ readonly service: "Service";
2860
+ readonly sales: "Sales";
2861
+ readonly content: "Content";
2862
+ };
2851
2863
  readonly errors: {
2852
2864
  readonly tiersError: "Cannot have more than one tier per hub";
2865
+ readonly nameRequired: "The name may not be blank. Please add a name for the Test Account.";
2853
2866
  };
2854
2867
  };
2855
2868
  readonly accountNamePrompt: {
package/lang/en.js CHANGED
@@ -846,6 +846,7 @@ exports.commands = {
846
846
  success: (derivedTargets) => `You can now use the HubSpot CLI MCP Server in ${derivedTargets.join(', ')}. ${chalk_1.default.bold('You may need to restart these tools to apply the changes')}.`,
847
847
  errors: {
848
848
  needsNode20: `This feature requires node >=20`,
849
+ errorParsingJsonFIle: (filename, errorMessage) => `Unable to update ${chalk_1.default.bold(filename)} due to invalid JSON: ${errorMessage}`,
849
850
  },
850
851
  spinners: {
851
852
  failedToConfigure: 'Failed to configure the HubSpot mcp server.',
@@ -1831,7 +1832,6 @@ exports.commands = {
1831
1832
  options: {
1832
1833
  name: 'The name of the test account',
1833
1834
  description: 'The description of the test account',
1834
- tiers: 'The tiers of the test account',
1835
1835
  path: 'The path to the test account config',
1836
1836
  },
1837
1837
  example: (name) => `Create a test account config file with the name "${name}"`,
@@ -2842,9 +2842,22 @@ exports.lib = {
2842
2842
  createDeveloperTestAccountConfigPrompt: {
2843
2843
  namePrompt: '[--name] What is the name of the test account?',
2844
2844
  descriptionPrompt: '[--description] What is the description of the test account?',
2845
- tiersPrompt: '[--tiers] Which product tiers should the test account have?',
2845
+ useDefaultAccountLevelsPrompt: {
2846
+ message: 'Would you like to create a default Test Account, or customize your own?',
2847
+ default: 'Default (All Hubs, ENTERPRISE)',
2848
+ manual: 'Customize my own',
2849
+ },
2850
+ tiersPrompt: 'Select an option per hub to customize tiers. If left blank, default is ENTERPRISE',
2851
+ hubTypes: {
2852
+ marketing: 'Marketing',
2853
+ ops: 'Ops',
2854
+ service: 'Service',
2855
+ sales: 'Sales',
2856
+ content: 'Content',
2857
+ },
2846
2858
  errors: {
2847
2859
  tiersError: 'Cannot have more than one tier per hub',
2860
+ nameRequired: 'The name may not be blank. Please add a name for the Test Account.',
2848
2861
  },
2849
2862
  },
2850
2863
  accountNamePrompt: {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_1 = require("@hubspot/local-dev-lib/constants/config");
4
+ const accountTypes_1 = require("../accountTypes");
5
+ const STANDARD_ACCOUNT = {
6
+ name: 'standard-account',
7
+ accountId: 123,
8
+ accountType: config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD,
9
+ env: 'prod',
10
+ };
11
+ const DEVELOPMENT_SANDBOX_ACCOUNT = {
12
+ name: 'development-sandbox-account',
13
+ accountId: 456,
14
+ accountType: config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX,
15
+ env: 'prod',
16
+ };
17
+ const STANDARD_SANDBOX_ACCOUNT = {
18
+ name: 'sandbox-account',
19
+ accountId: 456,
20
+ accountType: config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX,
21
+ env: 'prod',
22
+ };
23
+ const DEVELOPER_TEST_ACCOUNT = {
24
+ name: 'developer-test-account',
25
+ accountId: 789,
26
+ accountType: config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPER_TEST,
27
+ env: 'prod',
28
+ };
29
+ const APP_DEVELOPER_ACCOUNT = {
30
+ name: 'app-developer-account',
31
+ accountId: 1011,
32
+ accountType: config_1.HUBSPOT_ACCOUNT_TYPES.APP_DEVELOPER,
33
+ env: 'prod',
34
+ };
35
+ describe('lib/accountTypes', () => {
36
+ describe('isStandardAccount()', () => {
37
+ it('should return true if the account is a standard account', () => {
38
+ const result = (0, accountTypes_1.isStandardAccount)(STANDARD_ACCOUNT);
39
+ expect(result).toBe(true);
40
+ });
41
+ it('should return false if the account is not a standard account', () => {
42
+ const result = (0, accountTypes_1.isStandardAccount)(DEVELOPER_TEST_ACCOUNT);
43
+ expect(result).toBe(false);
44
+ });
45
+ });
46
+ describe('isSandbox()', () => {
47
+ it('should return true if the account is a standard sandbox account', () => {
48
+ const result = (0, accountTypes_1.isSandbox)(STANDARD_SANDBOX_ACCOUNT);
49
+ expect(result).toBe(true);
50
+ });
51
+ it('should return true if the account is a development sandbox account', () => {
52
+ const result = (0, accountTypes_1.isSandbox)(DEVELOPMENT_SANDBOX_ACCOUNT);
53
+ expect(result).toBe(true);
54
+ });
55
+ it('should return false if the account is not a sandbox account', () => {
56
+ const result = (0, accountTypes_1.isSandbox)(STANDARD_ACCOUNT);
57
+ expect(result).toBe(false);
58
+ });
59
+ });
60
+ describe('isStandardSandbox()', () => {
61
+ it('should return true if the account is a standard sandbox account', () => {
62
+ const result = (0, accountTypes_1.isStandardSandbox)(STANDARD_SANDBOX_ACCOUNT);
63
+ expect(result).toBe(true);
64
+ });
65
+ it('should return false if the account is not a standard sandbox account', () => {
66
+ const result = (0, accountTypes_1.isStandardSandbox)(DEVELOPMENT_SANDBOX_ACCOUNT);
67
+ expect(result).toBe(false);
68
+ });
69
+ });
70
+ describe('isDevelopmentSandbox()', () => {
71
+ it('should return true if the account is a development sandbox account', () => {
72
+ const result = (0, accountTypes_1.isDevelopmentSandbox)(DEVELOPMENT_SANDBOX_ACCOUNT);
73
+ expect(result).toBe(true);
74
+ });
75
+ it('should return false if the account is not a development sandbox account', () => {
76
+ const result = (0, accountTypes_1.isDevelopmentSandbox)(STANDARD_ACCOUNT);
77
+ expect(result).toBe(false);
78
+ });
79
+ });
80
+ describe('isDeveloperTestAccount()', () => {
81
+ it('should return true if the account is a developer test account', () => {
82
+ const result = (0, accountTypes_1.isDeveloperTestAccount)(DEVELOPER_TEST_ACCOUNT);
83
+ expect(result).toBe(true);
84
+ });
85
+ it('should return false if the account is not a developer test account', () => {
86
+ const result = (0, accountTypes_1.isDeveloperTestAccount)(STANDARD_ACCOUNT);
87
+ expect(result).toBe(false);
88
+ });
89
+ });
90
+ describe('isAppDeveloperAccount()', () => {
91
+ it('should return true if the account is an app developer account', () => {
92
+ const result = (0, accountTypes_1.isAppDeveloperAccount)(APP_DEVELOPER_ACCOUNT);
93
+ expect(result).toBe(true);
94
+ });
95
+ it('should return false if the account is not an app developer account', () => {
96
+ const result = (0, accountTypes_1.isAppDeveloperAccount)(STANDARD_ACCOUNT);
97
+ expect(result).toBe(false);
98
+ });
99
+ });
100
+ });
@@ -0,0 +1 @@
1
+ export {};