@hubspot/cli 7.7.21-experimental.0 → 7.7.21-experimental.1

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 (570) hide show
  1. package/api/__tests__/migrate.test.js +29 -27
  2. package/api/migrate.js +22 -14
  3. package/bin/cli.js +101 -92
  4. package/bin/hs +2 -2
  5. package/bin/hscms +2 -2
  6. package/bin/silenceErrors.js +2 -1
  7. package/commands/__tests__/account.test.js +34 -29
  8. package/commands/__tests__/auth.test.js +16 -11
  9. package/commands/__tests__/cms.test.js +20 -15
  10. package/commands/__tests__/config.test.js +19 -14
  11. package/commands/__tests__/create.test.js +15 -10
  12. package/commands/__tests__/customObject.test.js +19 -14
  13. package/commands/__tests__/doctor.test.js +48 -43
  14. package/commands/__tests__/feedback.test.js +45 -7
  15. package/commands/__tests__/fetch.test.js +28 -29
  16. package/commands/__tests__/filemanager.test.js +19 -14
  17. package/commands/__tests__/function.test.js +21 -16
  18. package/commands/__tests__/getStarted.test.js +50 -55
  19. package/commands/__tests__/hubdb.test.js +22 -17
  20. package/commands/__tests__/init.test.js +17 -12
  21. package/commands/__tests__/lint.test.js +18 -13
  22. package/commands/__tests__/list.test.js +23 -18
  23. package/commands/__tests__/logs.test.js +27 -28
  24. package/commands/__tests__/mcp.test.js +19 -14
  25. package/commands/__tests__/mv.test.js +52 -14
  26. package/commands/__tests__/open.test.js +51 -13
  27. package/commands/__tests__/project.test.js +49 -44
  28. package/commands/__tests__/remove.test.js +51 -13
  29. package/commands/__tests__/sandbox.test.js +19 -14
  30. package/commands/__tests__/secret.test.js +21 -16
  31. package/commands/__tests__/testAccount.test.js +21 -16
  32. package/commands/__tests__/theme.test.js +20 -15
  33. package/commands/account/__tests__/auth.test.js +16 -11
  34. package/commands/account/__tests__/clean.test.js +17 -12
  35. package/commands/account/__tests__/createOverride.test.js +15 -10
  36. package/commands/account/__tests__/info.test.js +16 -11
  37. package/commands/account/__tests__/list.test.js +16 -11
  38. package/commands/account/__tests__/remove.test.js +18 -13
  39. package/commands/account/__tests__/removeOverride.js +13 -8
  40. package/commands/account/__tests__/rename.test.js +20 -15
  41. package/commands/account/__tests__/use.test.js +15 -10
  42. package/commands/account/auth.d.ts +1 -1
  43. package/commands/account/auth.js +67 -65
  44. package/commands/account/clean.d.ts +1 -1
  45. package/commands/account/clean.js +60 -55
  46. package/commands/account/createOverride.d.ts +1 -1
  47. package/commands/account/createOverride.js +57 -52
  48. package/commands/account/info.d.ts +1 -1
  49. package/commands/account/info.js +35 -33
  50. package/commands/account/list.d.ts +1 -1
  51. package/commands/account/list.js +45 -43
  52. package/commands/account/remove.d.ts +1 -1
  53. package/commands/account/remove.js +42 -37
  54. package/commands/account/removeOverride.d.ts +1 -1
  55. package/commands/account/removeOverride.js +43 -38
  56. package/commands/account/rename.d.ts +1 -1
  57. package/commands/account/rename.js +20 -18
  58. package/commands/account/use.d.ts +1 -1
  59. package/commands/account/use.js +31 -29
  60. package/commands/account.d.ts +1 -1
  61. package/commands/account.js +28 -23
  62. package/commands/app/__tests__/install.test.js +52 -0
  63. package/commands/app/__tests__/migrate.test.js +34 -29
  64. package/commands/app/install.d.ts +8 -0
  65. package/commands/app/install.js +127 -0
  66. package/commands/app/migrate.d.ts +2 -2
  67. package/commands/app/migrate.js +43 -40
  68. package/commands/app/secret/__tests__/add.test.js +11 -6
  69. package/commands/app/secret/__tests__/delete.test.js +11 -6
  70. package/commands/app/secret/__tests__/list.test.js +11 -6
  71. package/commands/app/secret/__tests__/update.test.js +11 -6
  72. package/commands/app/secret/add.d.ts +1 -1
  73. package/commands/app/secret/add.js +30 -28
  74. package/commands/app/secret/delete.d.ts +1 -1
  75. package/commands/app/secret/delete.js +36 -34
  76. package/commands/app/secret/list.d.ts +1 -1
  77. package/commands/app/secret/list.js +27 -25
  78. package/commands/app/secret/update.d.ts +1 -1
  79. package/commands/app/secret/update.js +34 -32
  80. package/commands/app/secret.d.ts +1 -1
  81. package/commands/app/secret.js +17 -12
  82. package/commands/app.d.ts +1 -1
  83. package/commands/app.js +16 -6
  84. package/commands/auth.d.ts +1 -1
  85. package/commands/auth.js +72 -70
  86. package/commands/cms/convertFields.d.ts +1 -1
  87. package/commands/cms/convertFields.js +39 -34
  88. package/commands/cms/getReactModule.d.ts +1 -1
  89. package/commands/cms/getReactModule.js +37 -32
  90. package/commands/cms/lighthouseScore.d.ts +1 -1
  91. package/commands/cms/lighthouseScore.js +72 -67
  92. package/commands/cms.d.ts +1 -1
  93. package/commands/cms.js +16 -11
  94. package/commands/completion.d.ts +1 -1
  95. package/commands/completion.js +15 -10
  96. package/commands/config/migrate.d.ts +1 -1
  97. package/commands/config/migrate.js +32 -27
  98. package/commands/config/set.d.ts +1 -1
  99. package/commands/config/set.js +25 -23
  100. package/commands/config.d.ts +1 -1
  101. package/commands/config.js +13 -8
  102. package/commands/create/api-sample.d.ts +1 -1
  103. package/commands/create/api-sample.js +33 -28
  104. package/commands/create/app.d.ts +1 -1
  105. package/commands/create/app.js +5 -3
  106. package/commands/create/function.d.ts +1 -1
  107. package/commands/create/function.js +11 -9
  108. package/commands/create/index.d.ts +1 -1
  109. package/commands/create/index.js +24 -19
  110. package/commands/create/module.d.ts +1 -1
  111. package/commands/create/module.js +14 -12
  112. package/commands/create/react-app.d.ts +1 -1
  113. package/commands/create/react-app.js +5 -3
  114. package/commands/create/template.d.ts +1 -1
  115. package/commands/create/template.js +14 -12
  116. package/commands/create/vue-app.d.ts +1 -1
  117. package/commands/create/vue-app.js +5 -3
  118. package/commands/create/webpack-serverless.d.ts +1 -1
  119. package/commands/create/webpack-serverless.js +5 -3
  120. package/commands/create/website-theme.d.ts +1 -1
  121. package/commands/create/website-theme.js +7 -5
  122. package/commands/create.d.ts +2 -2
  123. package/commands/create.js +35 -30
  124. package/commands/customObject/__tests__/create.test.js +18 -13
  125. package/commands/customObject/__tests__/schema.test.js +23 -18
  126. package/commands/customObject/create.d.ts +1 -1
  127. package/commands/customObject/create.js +30 -28
  128. package/commands/customObject/schema/__tests__/create.test.js +18 -13
  129. package/commands/customObject/schema/__tests__/delete.test.js +18 -13
  130. package/commands/customObject/schema/__tests__/fetch-all.test.js +18 -13
  131. package/commands/customObject/schema/__tests__/fetch.test.js +18 -13
  132. package/commands/customObject/schema/__tests__/list.test.js +18 -13
  133. package/commands/customObject/schema/__tests__/update.test.js +18 -13
  134. package/commands/customObject/schema/create.d.ts +1 -1
  135. package/commands/customObject/schema/create.js +30 -28
  136. package/commands/customObject/schema/delete.d.ts +1 -1
  137. package/commands/customObject/schema/delete.js +26 -24
  138. package/commands/customObject/schema/fetch-all.d.ts +1 -1
  139. package/commands/customObject/schema/fetch-all.js +24 -22
  140. package/commands/customObject/schema/fetch.d.ts +1 -1
  141. package/commands/customObject/schema/fetch.js +26 -24
  142. package/commands/customObject/schema/list.d.ts +1 -1
  143. package/commands/customObject/schema/list.js +15 -13
  144. package/commands/customObject/schema/update.d.ts +1 -1
  145. package/commands/customObject/schema/update.js +34 -32
  146. package/commands/customObject/schema.d.ts +1 -1
  147. package/commands/customObject/schema.js +22 -17
  148. package/commands/customObject.d.ts +1 -1
  149. package/commands/customObject.js +18 -13
  150. package/commands/doctor.d.ts +1 -1
  151. package/commands/doctor.js +33 -28
  152. package/commands/feedback.d.ts +1 -1
  153. package/commands/feedback.js +24 -19
  154. package/commands/fetch.d.ts +1 -1
  155. package/commands/fetch.js +30 -28
  156. package/commands/filemanager/__tests__/fetch.test.js +22 -17
  157. package/commands/filemanager/__tests__/upload.test.js +20 -15
  158. package/commands/filemanager/fetch.d.ts +1 -1
  159. package/commands/filemanager/fetch.js +25 -23
  160. package/commands/filemanager/upload.d.ts +1 -1
  161. package/commands/filemanager/upload.js +44 -39
  162. package/commands/filemanager.d.ts +1 -1
  163. package/commands/filemanager.js +13 -8
  164. package/commands/function/deploy.d.ts +1 -1
  165. package/commands/function/deploy.js +40 -35
  166. package/commands/function/list.d.ts +1 -1
  167. package/commands/function/list.js +29 -24
  168. package/commands/function/server.d.ts +1 -1
  169. package/commands/function/server.js +17 -15
  170. package/commands/function.d.ts +1 -1
  171. package/commands/function.js +18 -12
  172. package/commands/getStarted.d.ts +1 -1
  173. package/commands/getStarted.js +131 -140
  174. package/commands/hubdb/__tests__/clear.test.js +18 -13
  175. package/commands/hubdb/__tests__/create.test.js +18 -13
  176. package/commands/hubdb/__tests__/delete.test.js +18 -13
  177. package/commands/hubdb/__tests__/fetch.test.js +18 -13
  178. package/commands/hubdb/__tests__/list.test.js +28 -23
  179. package/commands/hubdb/clear.d.ts +1 -1
  180. package/commands/hubdb/clear.js +22 -20
  181. package/commands/hubdb/create.d.ts +1 -1
  182. package/commands/hubdb/create.js +35 -30
  183. package/commands/hubdb/delete.d.ts +1 -1
  184. package/commands/hubdb/delete.js +26 -24
  185. package/commands/hubdb/fetch.d.ts +1 -1
  186. package/commands/hubdb/fetch.js +19 -17
  187. package/commands/hubdb/list.d.ts +1 -1
  188. package/commands/hubdb/list.js +35 -33
  189. package/commands/hubdb.d.ts +1 -1
  190. package/commands/hubdb.js +24 -18
  191. package/commands/init.d.ts +1 -1
  192. package/commands/init.js +88 -83
  193. package/commands/lint.d.ts +1 -1
  194. package/commands/lint.js +26 -24
  195. package/commands/list.d.ts +1 -1
  196. package/commands/list.js +37 -32
  197. package/commands/logs.d.ts +1 -1
  198. package/commands/logs.js +37 -35
  199. package/commands/mcp/__tests__/setup.test.js +12 -7
  200. package/commands/mcp/__tests__/start.test.js +12 -7
  201. package/commands/mcp/setup.d.ts +1 -1
  202. package/commands/mcp/setup.js +20 -17
  203. package/commands/mcp/start.d.ts +5 -2
  204. package/commands/mcp/start.js +41 -31
  205. package/commands/mcp.d.ts +1 -1
  206. package/commands/mcp.js +12 -7
  207. package/commands/module/marketplace-validate.d.ts +1 -1
  208. package/commands/module/marketplace-validate.js +26 -21
  209. package/commands/module.d.ts +1 -1
  210. package/commands/module.js +13 -7
  211. package/commands/mv.d.ts +1 -1
  212. package/commands/mv.js +22 -20
  213. package/commands/open.d.ts +1 -1
  214. package/commands/open.js +21 -19
  215. package/commands/project/__tests__/add.test.js +15 -10
  216. package/commands/project/__tests__/create.test.js +19 -14
  217. package/commands/project/__tests__/deploy.test.js +143 -103
  218. package/commands/project/__tests__/devUnifiedFlow.test.js +157 -148
  219. package/commands/project/__tests__/download.test.js +19 -14
  220. package/commands/project/__tests__/installDeps.test.js +70 -32
  221. package/commands/project/__tests__/listBuilds.test.js +19 -14
  222. package/commands/project/__tests__/logs.test.js +94 -56
  223. package/commands/project/__tests__/migrate.test.js +30 -25
  224. package/commands/project/__tests__/migrateApp.test.js +22 -17
  225. package/commands/project/__tests__/open.test.js +21 -16
  226. package/commands/project/__tests__/profile.test.js +19 -14
  227. package/commands/project/__tests__/upload.test.js +23 -18
  228. package/commands/project/__tests__/watch.test.js +19 -14
  229. package/commands/project/add.d.ts +1 -1
  230. package/commands/project/add.js +36 -34
  231. package/commands/project/cloneApp.d.ts +1 -1
  232. package/commands/project/cloneApp.js +72 -67
  233. package/commands/project/create.d.ts +2 -2
  234. package/commands/project/create.js +68 -63
  235. package/commands/project/deploy.d.ts +3 -2
  236. package/commands/project/deploy.js +102 -91
  237. package/commands/project/dev/deprecatedFlow.d.ts +2 -2
  238. package/commands/project/dev/deprecatedFlow.js +58 -52
  239. package/commands/project/dev/index.d.ts +1 -1
  240. package/commands/project/dev/index.js +47 -44
  241. package/commands/project/dev/unifiedFlow.d.ts +3 -3
  242. package/commands/project/dev/unifiedFlow.js +74 -67
  243. package/commands/project/download.d.ts +1 -1
  244. package/commands/project/download.js +40 -35
  245. package/commands/project/installDeps.d.ts +1 -1
  246. package/commands/project/installDeps.js +34 -29
  247. package/commands/project/listBuilds.d.ts +1 -1
  248. package/commands/project/listBuilds.js +45 -40
  249. package/commands/project/logs.d.ts +1 -1
  250. package/commands/project/logs.js +54 -52
  251. package/commands/project/migrate.d.ts +1 -1
  252. package/commands/project/migrate.js +26 -24
  253. package/commands/project/migrateApp.d.ts +2 -2
  254. package/commands/project/migrateApp.js +20 -18
  255. package/commands/project/open.d.ts +1 -1
  256. package/commands/project/open.js +30 -25
  257. package/commands/project/profile/add.d.ts +1 -1
  258. package/commands/project/profile/add.js +73 -68
  259. package/commands/project/profile/delete.d.ts +1 -1
  260. package/commands/project/profile/delete.js +56 -51
  261. package/commands/project/profile.d.ts +1 -1
  262. package/commands/project/profile.js +14 -9
  263. package/commands/project/upload.d.ts +1 -1
  264. package/commands/project/upload.js +55 -50
  265. package/commands/project/validate.d.ts +1 -1
  266. package/commands/project/validate.js +40 -35
  267. package/commands/project/watch.d.ts +1 -1
  268. package/commands/project/watch.js +61 -59
  269. package/commands/project.d.ts +1 -1
  270. package/commands/project.js +43 -38
  271. package/commands/remove.d.ts +1 -1
  272. package/commands/remove.js +17 -15
  273. package/commands/sandbox/__tests__/create.test.js +20 -15
  274. package/commands/sandbox/__tests__/delete.test.js +20 -15
  275. package/commands/sandbox/create.d.ts +1 -1
  276. package/commands/sandbox/create.js +69 -67
  277. package/commands/sandbox/delete.d.ts +1 -1
  278. package/commands/sandbox/delete.js +96 -94
  279. package/commands/sandbox.d.ts +1 -1
  280. package/commands/sandbox.js +14 -9
  281. package/commands/secret/__tests__/addSecret.test.js +18 -13
  282. package/commands/secret/__tests__/deleteSecret.test.js +18 -13
  283. package/commands/secret/__tests__/listSecret.test.js +18 -13
  284. package/commands/secret/__tests__/updateSecret.test.js +18 -13
  285. package/commands/secret/addSecret.d.ts +1 -1
  286. package/commands/secret/addSecret.js +28 -26
  287. package/commands/secret/deleteSecret.d.ts +1 -1
  288. package/commands/secret/deleteSecret.js +29 -27
  289. package/commands/secret/listSecret.d.ts +1 -1
  290. package/commands/secret/listSecret.js +21 -19
  291. package/commands/secret/updateSecret.d.ts +1 -1
  292. package/commands/secret/updateSecret.js +27 -25
  293. package/commands/secret.d.ts +1 -1
  294. package/commands/secret.js +18 -13
  295. package/commands/testAccount/__tests__/create.test.js +22 -17
  296. package/commands/testAccount/__tests__/createConfig.test.js +11 -9
  297. package/commands/testAccount/__tests__/delete.test.js +20 -15
  298. package/commands/testAccount/create.d.ts +1 -1
  299. package/commands/testAccount/create.js +57 -62
  300. package/commands/testAccount/createConfig.d.ts +1 -3
  301. package/commands/testAccount/createConfig.js +47 -43
  302. package/commands/testAccount/delete.d.ts +1 -1
  303. package/commands/testAccount/delete.js +19 -17
  304. package/commands/testAccount.d.ts +1 -1
  305. package/commands/testAccount.js +15 -10
  306. package/commands/theme/__tests__/generate-selectors.test.js +12 -7
  307. package/commands/theme/__tests__/marketplace-validate.test.js +19 -14
  308. package/commands/theme/__tests__/preview.test.js +17 -12
  309. package/commands/theme/generate-selectors.d.ts +1 -1
  310. package/commands/theme/generate-selectors.js +28 -23
  311. package/commands/theme/marketplace-validate.d.ts +1 -1
  312. package/commands/theme/marketplace-validate.js +24 -19
  313. package/commands/theme/preview.d.ts +1 -1
  314. package/commands/theme/preview.js +65 -60
  315. package/commands/theme.d.ts +1 -1
  316. package/commands/theme.js +16 -11
  317. package/commands/upload.d.ts +1 -1
  318. package/commands/upload.js +82 -77
  319. package/commands/watch.d.ts +1 -1
  320. package/commands/watch.js +51 -45
  321. package/lang/en.d.ts +62 -23
  322. package/lang/en.js +434 -389
  323. package/lang/en.lyaml +0 -26
  324. package/lib/__tests__/accountTypes.test.js +22 -20
  325. package/lib/__tests__/buildAccount.test.js +90 -27
  326. package/lib/__tests__/commonOpts.test.js +22 -20
  327. package/lib/__tests__/dependencyManagement.test.js +51 -46
  328. package/lib/__tests__/developerTestAccounts.test.js +62 -27
  329. package/lib/__tests__/hasFeature.test.js +8 -6
  330. package/lib/__tests__/npm.test.js +20 -15
  331. package/lib/__tests__/oauth.test.js +28 -23
  332. package/lib/__tests__/parsing.test.js +20 -18
  333. package/lib/__tests__/polling.test.js +26 -24
  334. package/lib/__tests__/process.test.js +19 -14
  335. package/lib/__tests__/projectProfiles.test.js +39 -34
  336. package/lib/__tests__/sandboxSync.test.js +35 -30
  337. package/lib/__tests__/sandboxes.test.js +31 -29
  338. package/lib/__tests__/serverlessLogs.test.js +13 -8
  339. package/lib/__tests__/usageTracking.test.js +42 -47
  340. package/lib/__tests__/validation.test.js +20 -18
  341. package/lib/__tests__/yargsUtils.test.js +41 -6
  342. package/lib/accountTypes.js +34 -24
  343. package/lib/app/__tests__/migrate.test.js +99 -94
  344. package/lib/app/__tests__/migrate_legacy.test.js +31 -29
  345. package/lib/app/migrate.d.ts +3 -3
  346. package/lib/app/migrate.js +145 -127
  347. package/lib/app/migrate_legacy.d.ts +1 -1
  348. package/lib/app/migrate_legacy.js +78 -72
  349. package/lib/app/urls.js +9 -5
  350. package/lib/buildAccount.d.ts +8 -2
  351. package/lib/buildAccount.js +119 -61
  352. package/lib/commonOpts.d.ts +1 -1
  353. package/lib/commonOpts.js +59 -42
  354. package/lib/configMigrate.js +38 -34
  355. package/lib/configOptions.js +40 -34
  356. package/lib/constants.js +34 -31
  357. package/lib/customObject.js +6 -2
  358. package/lib/dependencyManagement.js +45 -37
  359. package/lib/developerTestAccounts.d.ts +1 -1
  360. package/lib/developerTestAccounts.js +39 -34
  361. package/lib/doctor/Diagnosis.d.ts +1 -1
  362. package/lib/doctor/Diagnosis.js +29 -25
  363. package/lib/doctor/DiagnosticInfoBuilder.d.ts +1 -1
  364. package/lib/doctor/DiagnosticInfoBuilder.js +37 -30
  365. package/lib/doctor/Doctor.d.ts +1 -1
  366. package/lib/doctor/Doctor.js +101 -94
  367. package/lib/doctor/__tests__/Diagnosis.test.js +14 -9
  368. package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.js +34 -29
  369. package/lib/doctor/__tests__/Doctor.test.js +26 -24
  370. package/lib/enums/exitCodes.js +4 -1
  371. package/lib/errorHandlers/index.js +41 -32
  372. package/lib/errorHandlers/suppressError.d.ts +1 -1
  373. package/lib/errorHandlers/suppressError.js +31 -28
  374. package/lib/filesystem.js +15 -8
  375. package/lib/generateSelectors.js +29 -18
  376. package/lib/hasFeature.d.ts +1 -1
  377. package/lib/hasFeature.js +6 -3
  378. package/lib/interpolation.js +18 -11
  379. package/lib/lang.d.ts +1 -1
  380. package/lib/lang.js +27 -22
  381. package/lib/links.js +24 -16
  382. package/lib/marketplaceValidate.js +39 -29
  383. package/lib/mcp/setup.js +105 -72
  384. package/lib/middleware/__test__/configMiddleware.test.js +55 -20
  385. package/lib/middleware/__test__/gitMiddleware.test.js +42 -7
  386. package/lib/middleware/__test__/notificationsMiddleware.test.js +4 -2
  387. package/lib/middleware/__test__/requestMiddleware.test.js +11 -6
  388. package/lib/middleware/__test__/utils.test.js +11 -9
  389. package/lib/middleware/__test__/yargsChecksMiddleware.test.js +44 -9
  390. package/lib/middleware/autoUpdateMiddleware.js +40 -33
  391. package/lib/middleware/configMiddleware.js +42 -36
  392. package/lib/middleware/fireAlarmMiddleware.js +18 -12
  393. package/lib/middleware/gitMiddleware.js +8 -5
  394. package/lib/middleware/notificationsMiddleware.js +23 -16
  395. package/lib/middleware/requestMiddleware.js +10 -4
  396. package/lib/middleware/utils.js +4 -1
  397. package/lib/middleware/yargsChecksMiddleware.js +13 -10
  398. package/lib/npm.js +23 -14
  399. package/lib/oauth.js +35 -29
  400. package/lib/parsing.js +6 -3
  401. package/lib/polling.js +15 -11
  402. package/lib/process.js +19 -11
  403. package/lib/projectProfiles.d.ts +2 -2
  404. package/lib/projectProfiles.js +42 -32
  405. package/lib/projects/ProjectLogsManager.js +21 -18
  406. package/lib/projects/__tests__/AppDevModeInterface.test.js +145 -140
  407. package/lib/projects/__tests__/LocalDevProcess.test.js +73 -68
  408. package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +37 -32
  409. package/lib/projects/__tests__/ProjectLogsManager.test.js +58 -56
  410. package/lib/projects/__tests__/buildAndDeploy.test.js +9 -7
  411. package/lib/projects/__tests__/components.test.js +14 -9
  412. package/lib/projects/__tests__/projects.test.js +40 -35
  413. package/lib/projects/__tests__/structure.test.js +81 -43
  414. package/lib/projects/add/__tests__/legacyAddComponent.test.js +28 -26
  415. package/lib/projects/add/__tests__/v3AddComponent.test.js +30 -25
  416. package/lib/projects/add/legacyAddComponent.d.ts +1 -1
  417. package/lib/projects/add/legacyAddComponent.js +30 -24
  418. package/lib/projects/add/v3AddComponent.d.ts +1 -1
  419. package/lib/projects/add/v3AddComponent.js +42 -36
  420. package/lib/projects/buildAndDeploy.d.ts +1 -1
  421. package/lib/projects/buildAndDeploy.js +97 -88
  422. package/lib/projects/components.js +25 -19
  423. package/lib/projects/config.d.ts +1 -1
  424. package/lib/projects/config.js +41 -32
  425. package/lib/projects/create/__tests__/legacy.test.js +57 -22
  426. package/lib/projects/create/__tests__/v3.test.js +7 -5
  427. package/lib/projects/create/index.d.ts +3 -3
  428. package/lib/projects/create/index.js +22 -19
  429. package/lib/projects/create/legacy.d.ts +1 -1
  430. package/lib/projects/create/legacy.js +31 -25
  431. package/lib/projects/create/v3.d.ts +3 -3
  432. package/lib/projects/create/v3.js +59 -49
  433. package/lib/projects/ensureProjectExists.js +37 -31
  434. package/lib/projects/localDev/AppDevModeInterface.d.ts +3 -3
  435. package/lib/projects/localDev/AppDevModeInterface.js +60 -58
  436. package/lib/projects/localDev/DevServerManager.d.ts +1 -1
  437. package/lib/projects/localDev/DevServerManager.js +24 -24
  438. package/lib/projects/localDev/DevServerManagerV2.d.ts +2 -2
  439. package/lib/projects/localDev/DevServerManagerV2.js +20 -17
  440. package/lib/projects/localDev/LocalDevLogger.d.ts +1 -1
  441. package/lib/projects/localDev/LocalDevLogger.js +64 -59
  442. package/lib/projects/localDev/LocalDevManager.d.ts +1 -1
  443. package/lib/projects/localDev/LocalDevManager.js +111 -106
  444. package/lib/projects/localDev/LocalDevProcess.d.ts +4 -4
  445. package/lib/projects/localDev/LocalDevProcess.js +30 -25
  446. package/lib/projects/localDev/LocalDevState.d.ts +3 -3
  447. package/lib/projects/localDev/LocalDevState.js +5 -3
  448. package/lib/projects/localDev/LocalDevWatcher.d.ts +1 -1
  449. package/lib/projects/localDev/LocalDevWatcher.js +11 -6
  450. package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +1 -1
  451. package/lib/projects/localDev/LocalDevWebsocketServer.js +27 -25
  452. package/lib/projects/localDev/helpers.d.ts +4 -4
  453. package/lib/projects/localDev/helpers.js +174 -156
  454. package/lib/projects/structure.d.ts +4 -4
  455. package/lib/projects/structure.js +78 -32
  456. package/lib/projects/ui.js +13 -10
  457. package/lib/projects/upload.d.ts +3 -2
  458. package/lib/projects/upload.js +65 -55
  459. package/lib/projects/urls.js +24 -14
  460. package/lib/projects/watch.d.ts +1 -1
  461. package/lib/projects/watch.js +54 -48
  462. package/lib/prompts/__tests__/downloadProjectPrompt.test.js +11 -9
  463. package/lib/prompts/__tests__/projectsLogsPrompt.test.js +16 -11
  464. package/lib/prompts/accountNamePrompt.d.ts +1 -1
  465. package/lib/prompts/accountNamePrompt.js +31 -26
  466. package/lib/prompts/accountsPrompt.js +15 -12
  467. package/lib/prompts/cmsFieldPrompt.js +19 -13
  468. package/lib/prompts/createApiSamplePrompt.d.ts +1 -1
  469. package/lib/prompts/createApiSamplePrompt.js +12 -9
  470. package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +11 -10
  471. package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +88 -43
  472. package/lib/prompts/createFunctionPrompt.js +20 -17
  473. package/lib/prompts/createModulePrompt.js +15 -12
  474. package/lib/prompts/createTemplatePrompt.js +8 -5
  475. package/lib/prompts/downloadProjectPrompt.js +20 -17
  476. package/lib/prompts/installAppPrompt.js +26 -19
  477. package/lib/prompts/personalAccessKeyPrompt.d.ts +2 -2
  478. package/lib/prompts/personalAccessKeyPrompt.js +47 -40
  479. package/lib/prompts/previewPrompt.js +22 -15
  480. package/lib/prompts/projectAddPrompt.d.ts +1 -1
  481. package/lib/prompts/projectAddPrompt.js +18 -14
  482. package/lib/prompts/projectDevTargetAccountPrompt.d.ts +1 -1
  483. package/lib/prompts/projectDevTargetAccountPrompt.js +54 -48
  484. package/lib/prompts/projectNameAndDestPrompt.d.ts +1 -1
  485. package/lib/prompts/projectNameAndDestPrompt.js +29 -22
  486. package/lib/prompts/projectNamePrompt.js +14 -11
  487. package/lib/prompts/projectsLogsPrompt.js +8 -5
  488. package/lib/prompts/promptUtils.d.ts +1 -1
  489. package/lib/prompts/promptUtils.js +87 -70
  490. package/lib/prompts/sandboxesPrompt.d.ts +1 -1
  491. package/lib/prompts/sandboxesPrompt.js +30 -26
  492. package/lib/prompts/secretPrompt.js +15 -10
  493. package/lib/prompts/selectAppPrompt.js +14 -11
  494. package/lib/prompts/selectHubDBTablePrompt.js +30 -24
  495. package/lib/prompts/selectProjectTemplatePrompt.d.ts +1 -1
  496. package/lib/prompts/selectProjectTemplatePrompt.js +13 -10
  497. package/lib/prompts/selectPublicAppForMigrationPrompt.js +25 -22
  498. package/lib/prompts/setAsDefaultAccountPrompt.js +16 -13
  499. package/lib/prompts/uploadPrompt.js +17 -11
  500. package/lib/sandboxSync.d.ts +1 -1
  501. package/lib/sandboxSync.js +65 -58
  502. package/lib/sandboxes.d.ts +1 -1
  503. package/lib/sandboxes.js +76 -68
  504. package/lib/schema.js +23 -12
  505. package/lib/serverlessLogs.js +52 -45
  506. package/lib/testUtils.js +8 -4
  507. package/lib/ui/SpinniesManager.d.ts +1 -1
  508. package/lib/ui/SpinniesManager.js +34 -29
  509. package/lib/ui/boxen.js +14 -11
  510. package/lib/ui/git.js +20 -14
  511. package/lib/ui/index.js +74 -56
  512. package/lib/ui/logger.js +13 -10
  513. package/lib/ui/serverlessFunctionLogs.js +20 -14
  514. package/lib/ui/spinniesUtils.js +39 -24
  515. package/lib/ui/supportHyperlinks.js +6 -3
  516. package/lib/ui/supportsColor.js +17 -11
  517. package/lib/ui/table.js +13 -6
  518. package/lib/upload.js +21 -15
  519. package/lib/usageTracking.d.ts +11 -0
  520. package/lib/usageTracking.js +95 -95
  521. package/lib/utils/hasFlag.js +8 -2
  522. package/lib/validation.js +87 -48
  523. package/lib/yargsUtils.d.ts +1 -1
  524. package/lib/yargsUtils.js +16 -13
  525. package/mcp-server/server.js +8 -6
  526. package/mcp-server/tools/index.js +16 -13
  527. package/mcp-server/tools/project/AddFeatureToProject.d.ts +1 -1
  528. package/mcp-server/tools/project/AddFeatureToProject.js +41 -34
  529. package/mcp-server/tools/project/CreateProjectTool.d.ts +3 -3
  530. package/mcp-server/tools/project/CreateProjectTool.js +52 -45
  531. package/mcp-server/tools/project/DeployProject.d.ts +1 -1
  532. package/mcp-server/tools/project/DeployProject.js +24 -17
  533. package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +1 -1
  534. package/mcp-server/tools/project/GuidedWalkthroughTool.js +27 -20
  535. package/mcp-server/tools/project/UploadProjectTools.d.ts +1 -1
  536. package/mcp-server/tools/project/UploadProjectTools.js +21 -11
  537. package/mcp-server/tools/project/ValidateProjectTool.d.ts +1 -1
  538. package/mcp-server/tools/project/ValidateProjectTool.js +19 -12
  539. package/mcp-server/tools/project/__tests__/AddFeatureToProject.test.js +15 -12
  540. package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +16 -13
  541. package/mcp-server/tools/project/__tests__/DeployProject.test.js +9 -6
  542. package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.js +7 -4
  543. package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +7 -4
  544. package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.js +7 -4
  545. package/mcp-server/tools/project/constants.js +9 -3
  546. package/mcp-server/types.js +5 -1
  547. package/mcp-server/utils/__tests__/command.test.js +11 -9
  548. package/mcp-server/utils/__tests__/project.test.js +26 -18
  549. package/mcp-server/utils/command.d.ts +1 -1
  550. package/mcp-server/utils/command.js +11 -4
  551. package/mcp-server/utils/content.d.ts +1 -1
  552. package/mcp-server/utils/content.js +6 -2
  553. package/mcp-server/utils/project.js +17 -8
  554. package/mcp-server/utils/toolUsageTracking.d.ts +1 -0
  555. package/mcp-server/utils/toolUsageTracking.js +25 -0
  556. package/package.json +13 -17
  557. package/types/{cms.d.ts → Cms.d.ts} +1 -1
  558. package/types/Cms.js +2 -0
  559. package/types/LocalDev.d.ts +4 -4
  560. package/types/LocalDev.js +2 -1
  561. package/types/ProjectComponents.d.ts +2 -2
  562. package/types/ProjectComponents.js +2 -1
  563. package/types/Projects.d.ts +1 -1
  564. package/types/Projects.js +5 -2
  565. package/types/Prompts.js +2 -1
  566. package/types/Sandboxes.js +2 -0
  567. package/types/Yargs.js +2 -1
  568. package/types/sandboxes.js +0 -1
  569. /package/{types/cms.js → commands/app/__tests__/install.test.d.ts} +0 -0
  570. /package/types/{sandboxes.d.ts → Sandboxes.d.ts} +0 -0
@@ -1,18 +1,23 @@
1
- import { logger } from '@hubspot/local-dev-lib/logger';
2
- import { getCwd, sanitizeFileName } from '@hubspot/local-dev-lib/path';
3
- import { extractZipArchive } from '@hubspot/local-dev-lib/archive';
4
- import { validateUid } from '@hubspot/project-parsing-lib';
5
- import { UNMIGRATABLE_REASONS } from '@hubspot/local-dev-lib/constants/projects';
6
- import { MIGRATION_STATUS } from '@hubspot/local-dev-lib/types/Migration';
7
- import { downloadProject } from '@hubspot/local-dev-lib/api/projects';
8
- import fs from 'fs';
9
- import { confirmPrompt, inputPrompt, listPrompt, } from '../../prompts/promptUtils.js';
10
- import { ensureProjectExists } from '../../projects/ensureProjectExists.js';
11
- import { poll } from '../../polling.js';
12
- import { CLI_UNMIGRATABLE_REASONS, continueMigration, initializeMigration, listAppsForMigration, } from '../../../api/migrate.js';
13
- import { lib } from '../../../lang/en.js';
14
- import { hasFeature } from '../../hasFeature.js';
15
- import { getUnmigratableReason, generateFilterAppsByProjectNameFunction, buildErrorMessageFromMigrationStatus, fetchMigrationApps, promptForAppToMigrate, selectAppToMigrate, handleMigrationSetup, beginMigration, pollMigrationStatus, finalizeMigration, downloadProjectFiles, migrateApp2025_2, logInvalidAccountError, } from '../migrate.js';
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 logger_1 = require("@hubspot/local-dev-lib/logger");
7
+ const path_1 = require("@hubspot/local-dev-lib/path");
8
+ const archive_1 = require("@hubspot/local-dev-lib/archive");
9
+ const project_parsing_lib_1 = require("@hubspot/project-parsing-lib");
10
+ const projects_1 = require("@hubspot/local-dev-lib/constants/projects");
11
+ const Migration_1 = require("@hubspot/local-dev-lib/types/Migration");
12
+ const projects_2 = require("@hubspot/local-dev-lib/api/projects");
13
+ const fs_1 = __importDefault(require("fs"));
14
+ const promptUtils_1 = require("../../prompts/promptUtils");
15
+ const ensureProjectExists_1 = require("../../projects/ensureProjectExists");
16
+ const polling_1 = require("../../polling");
17
+ const migrate_1 = require("../../../api/migrate");
18
+ const en_1 = require("../../../lang/en");
19
+ const hasFeature_1 = require("../../hasFeature");
20
+ const migrate_2 = require("../migrate");
16
21
  vi.mock('@hubspot/local-dev-lib/logger');
17
22
  vi.mock('@hubspot/local-dev-lib/path');
18
23
  vi.mock('@hubspot/local-dev-lib/archive');
@@ -28,22 +33,22 @@ vi.mock('../../../api/migrate');
28
33
  vi.mock('../../hasFeature');
29
34
  vi.mock('../../projects/urls');
30
35
  vi.mock('fs');
31
- const mockedLogger = logger;
32
- const mockedGetCwd = getCwd;
33
- const mockedSanitizeFileName = sanitizeFileName;
34
- const mockedExtractZipArchive = extractZipArchive;
35
- const mockedValidateUid = validateUid;
36
- const mockedDownloadProject = downloadProject;
37
- const mockedConfirmPrompt = confirmPrompt;
38
- const mockedInputPrompt = inputPrompt;
39
- const mockedListPrompt = listPrompt;
40
- const mockedEnsureProjectExists = ensureProjectExists;
41
- const mockedPoll = poll;
42
- const mockedListAppsForMigration = listAppsForMigration;
43
- const mockedInitializeMigration = initializeMigration;
44
- const mockedContinueMigration = continueMigration;
45
- const mockedHasFeature = hasFeature;
46
- const mockedFs = fs;
36
+ const mockedLogger = logger_1.logger;
37
+ const mockedGetCwd = path_1.getCwd;
38
+ const mockedSanitizeFileName = path_1.sanitizeFileName;
39
+ const mockedExtractZipArchive = archive_1.extractZipArchive;
40
+ const mockedValidateUid = project_parsing_lib_1.validateUid;
41
+ const mockedDownloadProject = projects_2.downloadProject;
42
+ const mockedConfirmPrompt = promptUtils_1.confirmPrompt;
43
+ const mockedInputPrompt = promptUtils_1.inputPrompt;
44
+ const mockedListPrompt = promptUtils_1.listPrompt;
45
+ const mockedEnsureProjectExists = ensureProjectExists_1.ensureProjectExists;
46
+ const mockedPoll = polling_1.poll;
47
+ const mockedListAppsForMigration = migrate_1.listAppsForMigration;
48
+ const mockedInitializeMigration = migrate_1.initializeMigration;
49
+ const mockedContinueMigration = migrate_1.continueMigration;
50
+ const mockedHasFeature = hasFeature_1.hasFeature;
51
+ const mockedFs = fs_1.default;
47
52
  const createMockMigratableApp = (id, name, projectName) => ({
48
53
  appId: id,
49
54
  appName: name,
@@ -73,8 +78,8 @@ const PROJECT_DEST = '/mock/dest';
73
78
  const MOCK_CWD = '/mock/cwd';
74
79
  const MOCK_PROJECT_DIR = '/mock/project/dir';
75
80
  const mockUnmigratableApps = [
76
- createMockUnmigratableApp(3, 'App 3', UNMIGRATABLE_REASONS.UP_TO_DATE),
77
- createMockUnmigratableApp(4, 'App 4', UNMIGRATABLE_REASONS.IS_A_PRIVATE_APP),
81
+ createMockUnmigratableApp(3, 'App 3', projects_1.UNMIGRATABLE_REASONS.UP_TO_DATE),
82
+ createMockUnmigratableApp(4, 'App 4', projects_1.UNMIGRATABLE_REASONS.IS_A_PRIVATE_APP),
78
83
  ];
79
84
  describe('lib/app/migrate', () => {
80
85
  beforeEach(() => {
@@ -88,38 +93,38 @@ describe('lib/app/migrate', () => {
88
93
  const testCases = [
89
94
  {
90
95
  name: 'UP_TO_DATE',
91
- reason: UNMIGRATABLE_REASONS.UP_TO_DATE,
92
- expected: lib.migrate.errors.unmigratableReasons.upToDate,
96
+ reason: projects_1.UNMIGRATABLE_REASONS.UP_TO_DATE,
97
+ expected: en_1.lib.migrate.errors.unmigratableReasons.upToDate,
93
98
  },
94
99
  {
95
100
  name: 'IS_A_PRIVATE_APP',
96
- reason: UNMIGRATABLE_REASONS.IS_A_PRIVATE_APP,
97
- expected: lib.migrate.errors.unmigratableReasons.isPrivateApp,
101
+ reason: projects_1.UNMIGRATABLE_REASONS.IS_A_PRIVATE_APP,
102
+ expected: en_1.lib.migrate.errors.unmigratableReasons.isPrivateApp,
98
103
  },
99
104
  {
100
105
  name: 'LISTED_IN_MARKETPLACE',
101
- reason: UNMIGRATABLE_REASONS.LISTED_IN_MARKETPLACE,
102
- expected: lib.migrate.errors.unmigratableReasons.listedInMarketplace,
106
+ reason: projects_1.UNMIGRATABLE_REASONS.LISTED_IN_MARKETPLACE,
107
+ expected: en_1.lib.migrate.errors.unmigratableReasons.listedInMarketplace,
103
108
  },
104
109
  {
105
110
  name: 'PROJECT_CONNECTED_TO_GITHUB',
106
- reason: UNMIGRATABLE_REASONS.PROJECT_CONNECTED_TO_GITHUB,
107
- expected: lib.migrate.errors.unmigratableReasons.projectConnectedToGitHub(PROJECT_NAME, ACCOUNT_ID),
111
+ reason: projects_1.UNMIGRATABLE_REASONS.PROJECT_CONNECTED_TO_GITHUB,
112
+ expected: en_1.lib.migrate.errors.unmigratableReasons.projectConnectedToGitHub(PROJECT_NAME, ACCOUNT_ID),
108
113
  },
109
114
  {
110
115
  name: 'PART_OF_PROJECT_ALREADY',
111
- reason: CLI_UNMIGRATABLE_REASONS.PART_OF_PROJECT_ALREADY,
112
- expected: lib.migrate.errors.unmigratableReasons.partOfProjectAlready,
116
+ reason: migrate_1.CLI_UNMIGRATABLE_REASONS.PART_OF_PROJECT_ALREADY,
117
+ expected: en_1.lib.migrate.errors.unmigratableReasons.partOfProjectAlready,
113
118
  },
114
119
  {
115
120
  name: 'UNKNOWN_REASON',
116
121
  reason: 'UNKNOWN_REASON',
117
- expected: lib.migrate.errors.unmigratableReasons.generic('UNKNOWN_REASON'),
122
+ expected: en_1.lib.migrate.errors.unmigratableReasons.generic('UNKNOWN_REASON'),
118
123
  },
119
124
  ];
120
125
  testCases.forEach(testCase => {
121
126
  it(`should return the correct message for ${testCase.name}`, () => {
122
- const result = getUnmigratableReason(testCase.reason, PROJECT_NAME, ACCOUNT_ID);
127
+ const result = (0, migrate_2.getUnmigratableReason)(testCase.reason, PROJECT_NAME, ACCOUNT_ID);
123
128
  expect(result).toBe(testCase.expected);
124
129
  });
125
130
  });
@@ -127,14 +132,14 @@ describe('lib/app/migrate', () => {
127
132
  describe('generateFilterAppsByProjectNameFunction', () => {
128
133
  it('should return a function that filters by project name when projectConfig is provided', () => {
129
134
  const projectConfig = createLoadedProjectConfig(PROJECT_NAME);
130
- const filterFn = generateFilterAppsByProjectNameFunction(projectConfig);
135
+ const filterFn = (0, migrate_2.generateFilterAppsByProjectNameFunction)(projectConfig);
131
136
  const matchingApp = createMockMigratableApp(1, 'App 1', PROJECT_NAME);
132
137
  const nonMatchingApp = createMockMigratableApp(2, 'App 2', 'Other Project');
133
138
  expect(filterFn(matchingApp)).toBe(true);
134
139
  expect(filterFn(nonMatchingApp)).toBe(false);
135
140
  });
136
141
  it('should return a function that always returns true when projectConfig is not provided', () => {
137
- const filterFn = generateFilterAppsByProjectNameFunction(undefined);
142
+ const filterFn = (0, migrate_2.generateFilterAppsByProjectNameFunction)(undefined);
138
143
  const app1 = createMockMigratableApp(1, 'App 1', PROJECT_NAME);
139
144
  const app2 = createMockMigratableApp(2, 'App 2', 'Other Project');
140
145
  expect(filterFn(app1)).toBe(true);
@@ -145,17 +150,17 @@ describe('lib/app/migrate', () => {
145
150
  it('should return projectErrorDetail when there are no component errors', () => {
146
151
  const error = {
147
152
  id: 123,
148
- status: MIGRATION_STATUS.FAILURE,
153
+ status: Migration_1.MIGRATION_STATUS.FAILURE,
149
154
  projectErrorDetail: 'Project error',
150
155
  componentErrors: [],
151
156
  };
152
- const result = buildErrorMessageFromMigrationStatus(error);
157
+ const result = (0, migrate_2.buildErrorMessageFromMigrationStatus)(error);
153
158
  expect(result).toBe('Project error');
154
159
  });
155
160
  it('should return formatted error message with component errors', () => {
156
161
  const error = {
157
162
  id: 123,
158
- status: MIGRATION_STATUS.FAILURE,
163
+ status: Migration_1.MIGRATION_STATUS.FAILURE,
159
164
  projectErrorDetail: 'Project error',
160
165
  componentErrors: [
161
166
  {
@@ -169,7 +174,7 @@ describe('lib/app/migrate', () => {
169
174
  },
170
175
  ],
171
176
  };
172
- const result = buildErrorMessageFromMigrationStatus(error);
177
+ const result = (0, migrate_2.buildErrorMessageFromMigrationStatus)(error);
173
178
  expect(result).toBe('Project error: \n\t- CARD (card1): Card error\n\t- FUNCTION: Function error');
174
179
  });
175
180
  });
@@ -187,18 +192,18 @@ describe('lib/app/migrate', () => {
187
192
  setupMockApps([
188
193
  createMockMigratableApp(1, 'App 1', PROJECT_NAME),
189
194
  createMockMigratableApp(2, 'App 2', PROJECT_NAME),
190
- ], [createMockUnmigratableApp(3, 'App 3', UNMIGRATABLE_REASONS.UP_TO_DATE)]);
195
+ ], [createMockUnmigratableApp(3, 'App 3', projects_1.UNMIGRATABLE_REASONS.UP_TO_DATE)]);
191
196
  });
192
197
  it('should return all apps when no projectConfig is provided', async () => {
193
198
  setupMockApps([createMockMigratableApp(1, 'App 1')]);
194
- const result = await fetchMigrationApps(undefined, ACCOUNT_ID, PLATFORM_VERSION);
199
+ const result = await (0, migrate_2.fetchMigrationApps)(undefined, ACCOUNT_ID, PLATFORM_VERSION);
195
200
  expect(result).toHaveLength(1);
196
201
  expect(result[0].appId).toBe(1);
197
202
  });
198
203
  it('should filter apps by project name when projectConfig is provided', async () => {
199
204
  const projectConfig = createLoadedProjectConfig(PROJECT_NAME);
200
205
  setupMockApps([createMockMigratableApp(1, 'App 1', PROJECT_NAME)]);
201
- const result = await fetchMigrationApps(undefined, ACCOUNT_ID, PLATFORM_VERSION, projectConfig);
206
+ const result = await (0, migrate_2.fetchMigrationApps)(undefined, ACCOUNT_ID, PLATFORM_VERSION, projectConfig);
202
207
  expect(result).toHaveLength(1);
203
208
  expect(result[0].projectName).toBe(PROJECT_NAME);
204
209
  });
@@ -208,36 +213,36 @@ describe('lib/app/migrate', () => {
208
213
  createMockMigratableApp(1, 'App 1', PROJECT_NAME),
209
214
  createMockMigratableApp(2, 'App 2', PROJECT_NAME),
210
215
  ]);
211
- await expect(fetchMigrationApps(undefined, ACCOUNT_ID, PLATFORM_VERSION, projectConfig)).rejects.toThrow(lib.migrate.errors.project.multipleApps);
216
+ await expect((0, migrate_2.fetchMigrationApps)(undefined, ACCOUNT_ID, PLATFORM_VERSION, projectConfig)).rejects.toThrow(en_1.lib.migrate.errors.project.multipleApps);
212
217
  });
213
218
  it('should throw an error when no apps are found for a project', async () => {
214
219
  const projectConfig = createLoadedProjectConfig(PROJECT_NAME);
215
220
  setupMockApps([], []);
216
- await expect(fetchMigrationApps(undefined, ACCOUNT_ID, PLATFORM_VERSION, projectConfig)).rejects.toThrow(lib.migrate.errors.noAppsForProject(PROJECT_NAME));
221
+ await expect((0, migrate_2.fetchMigrationApps)(undefined, ACCOUNT_ID, PLATFORM_VERSION, projectConfig)).rejects.toThrow(en_1.lib.migrate.errors.noAppsForProject(PROJECT_NAME));
217
222
  });
218
223
  it('should throw an error when no migratable apps are found', async () => {
219
224
  setupMockApps([], mockUnmigratableApps);
220
- await expect(fetchMigrationApps(undefined, ACCOUNT_ID, PLATFORM_VERSION)).rejects.toThrow(/No apps in account/);
225
+ await expect((0, migrate_2.fetchMigrationApps)(undefined, ACCOUNT_ID, PLATFORM_VERSION)).rejects.toThrow(/No apps in account/);
221
226
  });
222
227
  it('should throw an error when appId is provided but not found', async () => {
223
- await expect(fetchMigrationApps(999, ACCOUNT_ID, PLATFORM_VERSION)).rejects.toThrow(/No apps in account/);
228
+ await expect((0, migrate_2.fetchMigrationApps)(999, ACCOUNT_ID, PLATFORM_VERSION)).rejects.toThrow(/No apps in account/);
224
229
  });
225
230
  });
226
231
  describe('promptForAppToMigrate', () => {
227
232
  const mockApps = [
228
233
  createMockMigratableApp(1, 'App 1'),
229
- createMockUnmigratableApp(2, 'App 2', UNMIGRATABLE_REASONS.UP_TO_DATE),
234
+ createMockUnmigratableApp(2, 'App 2', projects_1.UNMIGRATABLE_REASONS.UP_TO_DATE),
230
235
  ];
231
236
  beforeEach(() => {
232
237
  mockedListPrompt.mockResolvedValue(mockApps[0]);
233
238
  });
234
239
  it('should prompt the user to select an app', async () => {
235
- await promptForAppToMigrate(mockApps, ACCOUNT_ID);
236
- expect(mockedListPrompt).toHaveBeenCalledWith(lib.migrate.prompt.chooseApp, expect.any(Object));
240
+ await (0, migrate_2.promptForAppToMigrate)(mockApps, ACCOUNT_ID);
241
+ expect(mockedListPrompt).toHaveBeenCalledWith(en_1.lib.migrate.prompt.chooseApp, expect.any(Object));
237
242
  });
238
243
  it('should return the selected app', async () => {
239
244
  mockedListPrompt.mockResolvedValue({ appId: mockApps[0].appId });
240
- const result = await promptForAppToMigrate(mockApps, ACCOUNT_ID);
245
+ const result = await (0, migrate_2.promptForAppToMigrate)(mockApps, ACCOUNT_ID);
241
246
  expect(result).toBe(mockApps[0].appId);
242
247
  });
243
248
  });
@@ -252,26 +257,26 @@ describe('lib/app/migrate', () => {
252
257
  { id: '2', componentType: 'FUNCTION', isSupported: false },
253
258
  ],
254
259
  },
255
- createMockUnmigratableApp(2, 'App 2', UNMIGRATABLE_REASONS.UP_TO_DATE),
260
+ createMockUnmigratableApp(2, 'App 2', projects_1.UNMIGRATABLE_REASONS.UP_TO_DATE),
256
261
  ];
257
262
  beforeEach(() => {
258
263
  mockedListPrompt.mockResolvedValue({ appId: 1 });
259
264
  mockedConfirmPrompt.mockResolvedValue(true);
260
265
  });
261
266
  it('should throw an error when appId is provided but not found', async () => {
262
- await expect(selectAppToMigrate(mockApps, ACCOUNT_ID, 999)).rejects.toThrow(lib.migrate.errors.appWithAppIdNotFound(999));
267
+ await expect((0, migrate_2.selectAppToMigrate)(mockApps, ACCOUNT_ID, 999)).rejects.toThrow(en_1.lib.migrate.errors.appWithAppIdNotFound(999));
263
268
  });
264
269
  it('should call listPrompt when appId is not provided', async () => {
265
- await selectAppToMigrate(mockApps, ACCOUNT_ID);
266
- expect(mockedListPrompt).toHaveBeenCalledWith(lib.migrate.prompt.chooseApp, expect.any(Object));
270
+ await (0, migrate_2.selectAppToMigrate)(mockApps, ACCOUNT_ID);
271
+ expect(mockedListPrompt).toHaveBeenCalledWith(en_1.lib.migrate.prompt.chooseApp, expect.any(Object));
267
272
  });
268
273
  it('should return proceed: false and appIdToMigrate when user cancels', async () => {
269
274
  mockedConfirmPrompt.mockResolvedValue(false);
270
- const result = await selectAppToMigrate(mockApps, ACCOUNT_ID);
275
+ const result = await (0, migrate_2.selectAppToMigrate)(mockApps, ACCOUNT_ID);
271
276
  expect(result).toEqual({ proceed: false, appIdToMigrate: 1 });
272
277
  });
273
278
  it('should return proceed: true and appIdToMigrate when user confirms', async () => {
274
- const result = await selectAppToMigrate(mockApps, ACCOUNT_ID);
279
+ const result = await (0, migrate_2.selectAppToMigrate)(mockApps, ACCOUNT_ID);
275
280
  expect(result).toEqual({ proceed: true, appIdToMigrate: 1 });
276
281
  });
277
282
  });
@@ -300,7 +305,7 @@ describe('lib/app/migrate', () => {
300
305
  }
301
306
  it('should return early when user cancels', async () => {
302
307
  mockedConfirmPrompt.mockResolvedValueOnce(false);
303
- const result = await handleMigrationSetup(ACCOUNT_ID, defaultOptions);
308
+ const result = await (0, migrate_2.handleMigrationSetup)(ACCOUNT_ID, defaultOptions);
304
309
  expect(result).toEqual({});
305
310
  });
306
311
  it('should return project details when projectConfig is provided', async () => {
@@ -312,7 +317,7 @@ describe('lib/app/migrate', () => {
312
317
  unmigratableApps: [],
313
318
  },
314
319
  });
315
- const result = await handleMigrationSetup(ACCOUNT_ID, defaultOptions, projectConfig);
320
+ const result = await (0, migrate_2.handleMigrationSetup)(ACCOUNT_ID, defaultOptions, projectConfig);
316
321
  expect(result).toEqual({
317
322
  appIdToMigrate: 1,
318
323
  projectName: PROJECT_NAME,
@@ -322,18 +327,18 @@ describe('lib/app/migrate', () => {
322
327
  it('should prompt for project name when not provided', async () => {
323
328
  const optionsWithoutName = { ...defaultOptions, name: undefined };
324
329
  mockedInputPrompt.mockResolvedValue('New Project');
325
- await handleMigrationSetup(ACCOUNT_ID, optionsWithoutName);
326
- expect(mockedInputPrompt).toHaveBeenCalledWith(lib.migrate.prompt.inputName, expect.any(Object));
330
+ await (0, migrate_2.handleMigrationSetup)(ACCOUNT_ID, optionsWithoutName);
331
+ expect(mockedInputPrompt).toHaveBeenCalledWith(en_1.lib.migrate.prompt.inputName, expect.any(Object));
327
332
  });
328
333
  it('should prompt for project destination when not provided', async () => {
329
334
  const optionsWithoutDest = { ...defaultOptions, dest: undefined };
330
335
  mockedInputPrompt.mockResolvedValue('/mock/new/dest');
331
- await handleMigrationSetup(ACCOUNT_ID, optionsWithoutDest);
332
- expect(mockedInputPrompt).toHaveBeenCalledWith(lib.migrate.prompt.inputDest, expect.any(Object));
336
+ await (0, migrate_2.handleMigrationSetup)(ACCOUNT_ID, optionsWithoutDest);
337
+ expect(mockedInputPrompt).toHaveBeenCalledWith(en_1.lib.migrate.prompt.inputDest, expect.any(Object));
333
338
  });
334
339
  it('should throw an error when project already exists', async () => {
335
340
  mockedEnsureProjectExists.mockResolvedValue({ projectExists: true });
336
- await expect(handleMigrationSetup(ACCOUNT_ID, defaultOptions)).rejects.toThrow(lib.migrate.errors.project.alreadyExists(PROJECT_NAME));
341
+ await expect((0, migrate_2.handleMigrationSetup)(ACCOUNT_ID, defaultOptions)).rejects.toThrow(en_1.lib.migrate.errors.project.alreadyExists(PROJECT_NAME));
337
342
  });
338
343
  });
339
344
  describe('beginMigration', () => {
@@ -343,14 +348,14 @@ describe('lib/app/migrate', () => {
343
348
  data: { migrationId: MIGRATION_ID },
344
349
  });
345
350
  mockedPoll.mockResolvedValue({
346
- status: MIGRATION_STATUS.INPUT_REQUIRED,
351
+ status: Migration_1.MIGRATION_STATUS.INPUT_REQUIRED,
347
352
  // @ts-expect-error
348
353
  componentsRequiringUids: {},
349
354
  });
350
355
  mockedInputPrompt.mockResolvedValue('test-uid');
351
356
  });
352
357
  it('should initialize migration and return migrationId and uidMap', async () => {
353
- const result = await beginMigration(ACCOUNT_ID, APP_ID, PLATFORM_VERSION);
358
+ const result = await (0, migrate_2.beginMigration)(ACCOUNT_ID, APP_ID, PLATFORM_VERSION);
354
359
  expect(result).toEqual({
355
360
  migrationId: MIGRATION_ID,
356
361
  uidMap: {},
@@ -359,7 +364,7 @@ describe('lib/app/migrate', () => {
359
364
  it('should prompt for UIDs when components require them', async () => {
360
365
  const componentHint = 'test-card';
361
366
  mockedPoll.mockResolvedValue({
362
- status: MIGRATION_STATUS.INPUT_REQUIRED,
367
+ status: Migration_1.MIGRATION_STATUS.INPUT_REQUIRED,
363
368
  // @ts-expect-error
364
369
  componentsRequiringUids: {
365
370
  '1': {
@@ -368,26 +373,26 @@ describe('lib/app/migrate', () => {
368
373
  },
369
374
  },
370
375
  });
371
- await beginMigration(ACCOUNT_ID, APP_ID, PLATFORM_VERSION);
372
- expect(mockedInputPrompt).toHaveBeenCalledWith(lib.migrate.prompt.uidForComponent("card 'test-card' (ID: 1)"), {
376
+ await (0, migrate_2.beginMigration)(ACCOUNT_ID, APP_ID, PLATFORM_VERSION);
377
+ expect(mockedInputPrompt).toHaveBeenCalledWith(en_1.lib.migrate.prompt.uidForComponent("card 'test-card' (ID: 1)"), {
373
378
  defaultAnswer: componentHint,
374
379
  validate: expect.any(Function),
375
380
  });
376
381
  });
377
382
  it('should throw an error when migration fails', async () => {
378
383
  mockedPoll.mockRejectedValue(new Error('Failed'));
379
- await expect(beginMigration(ACCOUNT_ID, APP_ID, PLATFORM_VERSION)).rejects.toThrow(/Migration Failed/);
384
+ await expect((0, migrate_2.beginMigration)(ACCOUNT_ID, APP_ID, PLATFORM_VERSION)).rejects.toThrow(/Migration Failed/);
380
385
  });
381
386
  });
382
387
  describe('pollMigrationStatus', () => {
383
388
  it('should call poll with checkMigrationStatusV2', async () => {
384
389
  const mockStatus = {
385
390
  id: MIGRATION_ID,
386
- status: MIGRATION_STATUS.SUCCESS,
391
+ status: Migration_1.MIGRATION_STATUS.SUCCESS,
387
392
  buildId: BUILD_ID,
388
393
  };
389
394
  mockedPoll.mockResolvedValue(mockStatus);
390
- const result = await pollMigrationStatus(ACCOUNT_ID, MIGRATION_ID);
395
+ const result = await (0, migrate_2.pollMigrationStatus)(ACCOUNT_ID, MIGRATION_ID);
391
396
  expect(mockedPoll).toHaveBeenCalledWith(expect.any(Function), expect.any(Object));
392
397
  expect(result).toBe(mockStatus);
393
398
  });
@@ -400,18 +405,18 @@ describe('lib/app/migrate', () => {
400
405
  data: { migrationId: MIGRATION_ID },
401
406
  });
402
407
  mockedPoll.mockResolvedValue({
403
- status: MIGRATION_STATUS.SUCCESS,
408
+ status: Migration_1.MIGRATION_STATUS.SUCCESS,
404
409
  // @ts-expect-error
405
410
  buildId: BUILD_ID,
406
411
  });
407
412
  });
408
413
  it('should continue migration and return buildId', async () => {
409
- const result = await finalizeMigration(ACCOUNT_ID, MIGRATION_ID, uidMap, PROJECT_NAME);
414
+ const result = await (0, migrate_2.finalizeMigration)(ACCOUNT_ID, MIGRATION_ID, uidMap, PROJECT_NAME);
410
415
  expect(result).toBe(BUILD_ID);
411
416
  });
412
417
  it('should throw an error when migration fails', async () => {
413
418
  mockedPoll.mockRejectedValue(new Error('Test error'));
414
- await expect(finalizeMigration(ACCOUNT_ID, MIGRATION_ID, uidMap, PROJECT_NAME)).rejects.toThrow(/Migration Failed/);
419
+ await expect((0, migrate_2.finalizeMigration)(ACCOUNT_ID, MIGRATION_ID, uidMap, PROJECT_NAME)).rejects.toThrow(/Migration Failed/);
415
420
  });
416
421
  });
417
422
  describe('downloadProjectFiles', () => {
@@ -425,7 +430,7 @@ describe('lib/app/migrate', () => {
425
430
  mockedSanitizeFileName.mockReturnValue(PROJECT_NAME);
426
431
  });
427
432
  it('should download and extract project files', async () => {
428
- await downloadProjectFiles(ACCOUNT_ID, PROJECT_NAME, BUILD_ID, PROJECT_DEST);
433
+ await (0, migrate_2.downloadProjectFiles)(ACCOUNT_ID, PROJECT_NAME, BUILD_ID, PROJECT_DEST);
429
434
  expect(mockedDownloadProject).toHaveBeenCalledWith(ACCOUNT_ID, PROJECT_NAME, BUILD_ID);
430
435
  expect(mockedExtractZipArchive).toHaveBeenCalledWith(expect.any(Buffer), PROJECT_NAME, expect.stringContaining(PROJECT_DEST), {
431
436
  includesRootDir: true,
@@ -437,7 +442,7 @@ describe('lib/app/migrate', () => {
437
442
  projectConfig: { name: PROJECT_NAME, srcDir: 'src' },
438
443
  projectDir: MOCK_PROJECT_DIR,
439
444
  };
440
- await downloadProjectFiles(ACCOUNT_ID, PROJECT_NAME, BUILD_ID, PROJECT_DEST, projectConfig);
445
+ await (0, migrate_2.downloadProjectFiles)(ACCOUNT_ID, PROJECT_NAME, BUILD_ID, PROJECT_DEST, projectConfig);
441
446
  expect(mockedFs.renameSync).toHaveBeenCalledWith(`${MOCK_PROJECT_DIR}/src`, `${MOCK_PROJECT_DIR}/archive`);
442
447
  expect(mockedExtractZipArchive).toHaveBeenCalledWith(expect.any(Buffer), PROJECT_NAME, MOCK_PROJECT_DIR, {
443
448
  includesRootDir: true,
@@ -447,7 +452,7 @@ describe('lib/app/migrate', () => {
447
452
  it('should throw an error when download fails', async () => {
448
453
  const error = new Error('Download failed');
449
454
  mockedDownloadProject.mockRejectedValue(error);
450
- await expect(downloadProjectFiles(ACCOUNT_ID, PROJECT_NAME, BUILD_ID, PROJECT_DEST)).rejects.toThrow(error);
455
+ await expect((0, migrate_2.downloadProjectFiles)(ACCOUNT_ID, PROJECT_NAME, BUILD_ID, PROJECT_DEST)).rejects.toThrow(error);
451
456
  });
452
457
  });
453
458
  describe('migrateApp2025_2', () => {
@@ -463,27 +468,27 @@ describe('lib/app/migrate', () => {
463
468
  });
464
469
  it('should throw an error when account is not ungated for unified apps', async () => {
465
470
  mockedHasFeature.mockResolvedValueOnce(false);
466
- await expect(migrateApp2025_2(ACCOUNT_ID, options)).rejects.toThrowError(/isn't enrolled in the required product beta to access this command./);
471
+ await expect((0, migrate_2.migrateApp2025_2)(ACCOUNT_ID, options)).rejects.toThrowError(/isn't enrolled in the required product beta to access this command./);
467
472
  });
468
473
  it('should throw an error when projectConfig is invalid', async () => {
469
474
  const invalidProjectConfig = {
470
475
  projectConfig: undefined,
471
476
  projectDir: '/mock/project/dir',
472
477
  };
473
- await expect(migrateApp2025_2(ACCOUNT_ID, options, invalidProjectConfig)).rejects.toThrow(/The project configuration file is invalid/);
478
+ await expect((0, migrate_2.migrateApp2025_2)(ACCOUNT_ID, options, invalidProjectConfig)).rejects.toThrow(/The project configuration file is invalid/);
474
479
  });
475
480
  it('should throw an error when project does not exist', async () => {
476
481
  const projectConfig = createLoadedProjectConfig(PROJECT_NAME);
477
482
  mockedEnsureProjectExists.mockResolvedValueOnce({
478
483
  projectExists: false,
479
484
  });
480
- await expect(migrateApp2025_2(ACCOUNT_ID, options, projectConfig)).rejects.toThrow(/Migrations are only supported for existing projects/);
485
+ await expect((0, migrate_2.migrateApp2025_2)(ACCOUNT_ID, options, projectConfig)).rejects.toThrow(/Migrations are only supported for existing projects/);
481
486
  });
482
487
  });
483
488
  describe('logInvalidAccountError', () => {
484
489
  it('should log the invalid account error message', () => {
485
- logInvalidAccountError();
486
- expect(mockedLogger.error).toHaveBeenCalledWith(lib.migrate.errors.invalidAccountTypeTitle);
490
+ (0, migrate_2.logInvalidAccountError)();
491
+ expect(mockedLogger.error).toHaveBeenCalledWith(en_1.lib.migrate.errors.invalidAccountTypeTitle);
487
492
  expect(mockedLogger.log).toHaveBeenCalledWith(expect.stringContaining('Only public apps created in a developer account can be converted to a project component'));
488
493
  });
489
494
  });
@@ -1,14 +1,16 @@
1
- import { fetchPublicAppMetadata as _fetchPublicAppMetadata } from '@hubspot/local-dev-lib/api/appsDev';
2
- import { downloadProject as _downloadProject, migrateApp as _migrateNonProjectApp_v2023_2, } from '@hubspot/local-dev-lib/api/projects';
3
- import { extractZipArchive } from '@hubspot/local-dev-lib/archive';
4
- import { promptUser as _promptUser } from '../../prompts/promptUtils.js';
5
- import { EXIT_CODES } from '../../enums/exitCodes.js';
6
- import { isAppDeveloperAccount as _isAppDeveloperAccount, isUnifiedAccount as _isUnifiedAccount, } from '../../accountTypes.js';
7
- import { selectPublicAppForMigrationPrompt as _selectPublicAppForMigrationPrompt } from '../../prompts/selectPublicAppForMigrationPrompt.js';
8
- import { projectNameAndDestPrompt as _projectNameAndDestPrompt } from '../../prompts/projectNameAndDestPrompt.js';
9
- import { ensureProjectExists as _ensureProjectExists } from '../../projects/ensureProjectExists.js';
10
- import { poll as _poll } from '../../polling.js';
11
- import { migrateApp2023_2 } from '../migrate_legacy.js';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const appsDev_1 = require("@hubspot/local-dev-lib/api/appsDev");
4
+ const projects_1 = require("@hubspot/local-dev-lib/api/projects");
5
+ const archive_1 = require("@hubspot/local-dev-lib/archive");
6
+ const promptUtils_1 = require("../../prompts/promptUtils");
7
+ const exitCodes_1 = require("../../enums/exitCodes");
8
+ const accountTypes_1 = require("../../accountTypes");
9
+ const selectPublicAppForMigrationPrompt_1 = require("../../prompts/selectPublicAppForMigrationPrompt");
10
+ const projectNameAndDestPrompt_1 = require("../../prompts/projectNameAndDestPrompt");
11
+ const ensureProjectExists_1 = require("../../projects/ensureProjectExists");
12
+ const polling_1 = require("../../polling");
13
+ const migrate_legacy_1 = require("../migrate_legacy");
12
14
  // Mock all external dependencies
13
15
  vi.mock('@hubspot/local-dev-lib/api/appsDev');
14
16
  vi.mock('@hubspot/local-dev-lib/logger');
@@ -26,16 +28,16 @@ vi.mock('../../usageTracking');
26
28
  vi.mock('../../ui/SpinniesManager');
27
29
  vi.mock('../../process');
28
30
  vi.mock('../../polling');
29
- const isAppDeveloperAccount = _isAppDeveloperAccount;
30
- const isUnifiedAccount = _isUnifiedAccount;
31
- const selectPublicAppForMigrationPrompt = _selectPublicAppForMigrationPrompt;
32
- const projectNameAndDestPrompt = _projectNameAndDestPrompt;
33
- const ensureProjectExists = _ensureProjectExists;
34
- const poll = _poll;
35
- const fetchPublicAppMetadata = _fetchPublicAppMetadata;
36
- const migrateNonProjectApp_v2023_2 = _migrateNonProjectApp_v2023_2;
37
- const downloadProject = _downloadProject;
38
- const promptUser = _promptUser;
31
+ const isAppDeveloperAccount = accountTypes_1.isAppDeveloperAccount;
32
+ const isUnifiedAccount = accountTypes_1.isUnifiedAccount;
33
+ const selectPublicAppForMigrationPrompt = selectPublicAppForMigrationPrompt_1.selectPublicAppForMigrationPrompt;
34
+ const projectNameAndDestPrompt = projectNameAndDestPrompt_1.projectNameAndDestPrompt;
35
+ const ensureProjectExists = ensureProjectExists_1.ensureProjectExists;
36
+ const poll = polling_1.poll;
37
+ const fetchPublicAppMetadata = appsDev_1.fetchPublicAppMetadata;
38
+ const migrateNonProjectApp_v2023_2 = projects_1.migrateApp;
39
+ const downloadProject = projects_1.downloadProject;
40
+ const promptUser = promptUtils_1.promptUser;
39
41
  describe('migrateApp2023_2', () => {
40
42
  const mockDerivedAccountId = 123;
41
43
  const mockOptions = {
@@ -94,12 +96,12 @@ describe('migrateApp2023_2', () => {
94
96
  });
95
97
  it('should exit if account is not an app developer account and not unified', async () => {
96
98
  isAppDeveloperAccount.mockReturnValue(false);
97
- await migrateApp2023_2(mockDerivedAccountId, mockOptions, mockAccountConfig);
99
+ await (0, migrate_legacy_1.migrateApp2023_2)(mockDerivedAccountId, mockOptions, mockAccountConfig);
98
100
  expect(migrateNonProjectApp_v2023_2).not.toHaveBeenCalled();
99
- expect(process.exit).toHaveBeenCalledWith(EXIT_CODES.SUCCESS);
101
+ expect(process.exit).toHaveBeenCalledWith(exitCodes_1.EXIT_CODES.SUCCESS);
100
102
  });
101
103
  it('should proceed with migration for valid app developer account', async () => {
102
- await migrateApp2023_2(mockDerivedAccountId, mockOptions, mockAccountConfig);
104
+ await (0, migrate_legacy_1.migrateApp2023_2)(mockDerivedAccountId, mockOptions, mockAccountConfig);
103
105
  expect(selectPublicAppForMigrationPrompt).toHaveBeenCalled();
104
106
  expect(fetchPublicAppMetadata).toHaveBeenCalledWith(appId, mockDerivedAccountId);
105
107
  expect(projectNameAndDestPrompt).toHaveBeenCalled();
@@ -107,12 +109,12 @@ describe('migrateApp2023_2', () => {
107
109
  expect(migrateNonProjectApp_v2023_2).toHaveBeenCalled();
108
110
  expect(poll).toHaveBeenCalled();
109
111
  expect(downloadProject).toHaveBeenCalled();
110
- expect(extractZipArchive).toHaveBeenCalled();
112
+ expect(archive_1.extractZipArchive).toHaveBeenCalled();
111
113
  });
112
114
  it('should handle migration failure gracefully', async () => {
113
115
  const errorMessage = 'Migration failed';
114
116
  migrateNonProjectApp_v2023_2.mockRejectedValue(new Error(errorMessage));
115
- await expect(migrateApp2023_2(mockDerivedAccountId, mockOptions, mockAccountConfig)).rejects.toThrow(errorMessage);
117
+ await expect((0, migrate_legacy_1.migrateApp2023_2)(mockDerivedAccountId, mockOptions, mockAccountConfig)).rejects.toThrow(errorMessage);
116
118
  });
117
119
  it('should handle non-migratable apps', async () => {
118
120
  fetchPublicAppMetadata.mockResolvedValue({
@@ -122,13 +124,13 @@ describe('migrateApp2023_2', () => {
122
124
  listingInfo: { someInfo: 'test' },
123
125
  },
124
126
  });
125
- await migrateApp2023_2(mockDerivedAccountId, mockOptions, mockAccountConfig);
126
- expect(process.exit).toHaveBeenCalledWith(EXIT_CODES.ERROR);
127
+ await (0, migrate_legacy_1.migrateApp2023_2)(mockDerivedAccountId, mockOptions, mockAccountConfig);
128
+ expect(process.exit).toHaveBeenCalledWith(exitCodes_1.EXIT_CODES.ERROR);
127
129
  });
128
130
  it('should handle existing project error', async () => {
129
131
  ensureProjectExists.mockResolvedValue({
130
132
  projectExists: true,
131
133
  });
132
- await expect(migrateApp2023_2(mockDerivedAccountId, mockOptions, mockAccountConfig)).rejects.toThrow('A project with name test-project already exists');
134
+ await expect((0, migrate_legacy_1.migrateApp2023_2)(mockDerivedAccountId, mockOptions, mockAccountConfig)).rejects.toThrow('A project with name test-project already exists');
133
135
  });
134
136
  });
@@ -1,7 +1,7 @@
1
1
  import { ArgumentsCamelCase } from 'yargs';
2
- import { LoadedProjectConfig } from '../projects/config.js';
3
- import { MigrationApp, MigrationFailed, MigrationStatus } from '../../api/migrate.js';
4
- import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs } from '../../types/Yargs.js';
2
+ import { LoadedProjectConfig } from '../projects/config';
3
+ import { MigrationApp, MigrationFailed, MigrationStatus } from '../../api/migrate';
4
+ import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs } from '../../types/Yargs';
5
5
  export type MigrateAppArgs = CommonArgs & AccountArgs & EnvironmentArgs & ConfigArgs & {
6
6
  name?: string;
7
7
  dest?: string;