@hubspot/cli 7.5.11-experimental.0 → 7.6.0-beta.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 (352) hide show
  1. package/bin/cli.js +102 -95
  2. package/commands/account/auth.d.ts +5 -7
  3. package/commands/account/auth.js +74 -87
  4. package/commands/account/clean.d.ts +3 -7
  5. package/commands/account/clean.js +16 -9
  6. package/commands/account/createOverride.d.ts +3 -7
  7. package/commands/account/createOverride.js +23 -6
  8. package/commands/account/info.d.ts +3 -7
  9. package/commands/account/info.js +13 -5
  10. package/commands/account/list.d.ts +3 -7
  11. package/commands/account/list.js +15 -8
  12. package/commands/account/remove.d.ts +3 -7
  13. package/commands/account/remove.js +21 -9
  14. package/commands/account/removeOverride.d.ts +3 -7
  15. package/commands/account/removeOverride.js +23 -6
  16. package/commands/account/rename.d.ts +3 -7
  17. package/commands/account/rename.js +16 -9
  18. package/commands/account/use.d.ts +5 -9
  19. package/commands/account/use.js +14 -6
  20. package/commands/account.d.ts +3 -4
  21. package/commands/account.js +33 -58
  22. package/commands/app/migrate.d.ts +1 -2
  23. package/commands/app/migrate.js +7 -8
  24. package/commands/app/secret/add.d.ts +7 -0
  25. package/commands/app/secret/add.js +64 -0
  26. package/commands/app/secret/delete.d.ts +8 -0
  27. package/commands/app/secret/delete.js +87 -0
  28. package/commands/app/secret/list.d.ts +6 -0
  29. package/commands/app/secret/list.js +64 -0
  30. package/commands/app/secret/update.d.ts +7 -0
  31. package/commands/app/secret/update.js +77 -0
  32. package/commands/app/secret.d.ts +3 -0
  33. package/commands/app/secret.js +30 -0
  34. package/commands/app.d.ts +2 -5
  35. package/commands/app.js +10 -8
  36. package/commands/auth.d.ts +5 -7
  37. package/commands/auth.js +29 -28
  38. package/commands/cms/convertFields.d.ts +7 -1
  39. package/commands/cms/convertFields.js +57 -41
  40. package/commands/cms/getReactModule.d.ts +7 -1
  41. package/commands/cms/getReactModule.js +52 -34
  42. package/commands/cms/lighthouseScore.d.ts +8 -1
  43. package/commands/cms/lighthouseScore.js +129 -100
  44. package/commands/cms.d.ts +3 -1
  45. package/commands/cms.js +22 -15
  46. package/commands/completion.d.ts +3 -1
  47. package/commands/completion.js +23 -12
  48. package/commands/config/migrate.d.ts +3 -7
  49. package/commands/config/migrate.js +37 -46
  50. package/commands/config/set.d.ts +5 -6
  51. package/commands/config/set.js +38 -14
  52. package/commands/config.d.ts +3 -4
  53. package/commands/config.js +18 -44
  54. package/commands/create/api-sample.d.ts +3 -1
  55. package/commands/create/api-sample.js +34 -38
  56. package/commands/create/app.d.ts +3 -1
  57. package/commands/create/app.js +9 -7
  58. package/commands/create/function.d.ts +3 -1
  59. package/commands/create/function.js +11 -10
  60. package/commands/create/index.d.ts +5 -1
  61. package/commands/create/index.js +23 -11
  62. package/commands/create/module.d.ts +3 -1
  63. package/commands/create/module.js +14 -13
  64. package/commands/create/react-app.d.ts +3 -1
  65. package/commands/create/react-app.js +10 -7
  66. package/commands/create/template.d.ts +3 -1
  67. package/commands/create/template.js +14 -14
  68. package/commands/create/vue-app.d.ts +3 -1
  69. package/commands/create/vue-app.js +10 -7
  70. package/commands/create/webpack-serverless.d.ts +3 -1
  71. package/commands/create/webpack-serverless.js +10 -7
  72. package/commands/create/website-theme.d.ts +3 -1
  73. package/commands/create/website-theme.js +10 -9
  74. package/commands/create.d.ts +4 -24
  75. package/commands/create.js +62 -74
  76. package/commands/customObject/create.d.ts +4 -9
  77. package/commands/customObject/create.js +17 -10
  78. package/commands/customObject/schema/create.d.ts +4 -9
  79. package/commands/customObject/schema/create.js +18 -11
  80. package/commands/customObject/schema/delete.d.ts +4 -9
  81. package/commands/customObject/schema/delete.js +17 -10
  82. package/commands/customObject/schema/fetch-all.d.ts +4 -9
  83. package/commands/customObject/schema/fetch-all.js +17 -10
  84. package/commands/customObject/schema/fetch.d.ts +4 -9
  85. package/commands/customObject/schema/fetch.js +17 -10
  86. package/commands/customObject/schema/list.d.ts +4 -8
  87. package/commands/customObject/schema/list.js +17 -10
  88. package/commands/customObject/schema/update.d.ts +4 -9
  89. package/commands/customObject/schema/update.js +18 -11
  90. package/commands/customObject/schema.d.ts +3 -5
  91. package/commands/customObject/schema.js +27 -54
  92. package/commands/customObject.d.ts +3 -4
  93. package/commands/customObject.js +18 -45
  94. package/commands/doctor.d.ts +6 -8
  95. package/commands/doctor.js +30 -21
  96. package/commands/feedback.d.ts +4 -1
  97. package/commands/feedback.js +38 -47
  98. package/commands/fetch.d.ts +12 -1
  99. package/commands/fetch.js +49 -33
  100. package/commands/filemanager/fetch.d.ts +4 -9
  101. package/commands/filemanager/fetch.js +18 -11
  102. package/commands/filemanager/upload.d.ts +4 -9
  103. package/commands/filemanager/upload.js +17 -11
  104. package/commands/filemanager.d.ts +3 -4
  105. package/commands/filemanager.js +18 -41
  106. package/commands/function/deploy.d.ts +6 -1
  107. package/commands/function/deploy.js +70 -50
  108. package/commands/function/list.d.ts +6 -1
  109. package/commands/function/list.js +44 -32
  110. package/commands/function/server.d.ts +10 -1
  111. package/commands/function/server.js +49 -38
  112. package/commands/function.d.ts +5 -1
  113. package/commands/function.js +22 -10
  114. package/commands/getStarted.d.ts +9 -0
  115. package/commands/getStarted.js +227 -0
  116. package/commands/hubdb/clear.d.ts +4 -9
  117. package/commands/hubdb/clear.js +17 -10
  118. package/commands/hubdb/create.d.ts +4 -9
  119. package/commands/hubdb/create.js +17 -10
  120. package/commands/hubdb/delete.d.ts +4 -9
  121. package/commands/hubdb/delete.js +17 -10
  122. package/commands/hubdb/fetch.d.ts +4 -9
  123. package/commands/hubdb/fetch.js +17 -10
  124. package/commands/hubdb/list.d.ts +4 -0
  125. package/commands/hubdb/list.js +83 -0
  126. package/commands/hubdb.d.ts +3 -2
  127. package/commands/hubdb.js +23 -45
  128. package/commands/init.d.ts +3 -7
  129. package/commands/init.js +17 -8
  130. package/commands/lint.d.ts +6 -4
  131. package/commands/lint.js +42 -43
  132. package/commands/list.d.ts +3 -7
  133. package/commands/list.js +17 -11
  134. package/commands/logs.d.ts +10 -1
  135. package/commands/logs.js +53 -44
  136. package/commands/mcp/setup.d.ts +7 -0
  137. package/commands/mcp/setup.js +52 -0
  138. package/commands/mcp/start.d.ts +3 -0
  139. package/commands/mcp/start.js +77 -0
  140. package/commands/mcp.d.ts +3 -0
  141. package/commands/mcp.js +26 -0
  142. package/commands/module/marketplace-validate.d.ts +6 -1
  143. package/commands/module/marketplace-validate.js +39 -29
  144. package/commands/module.d.ts +3 -1
  145. package/commands/module.js +23 -10
  146. package/commands/mv.d.ts +3 -7
  147. package/commands/mv.js +17 -11
  148. package/commands/open.d.ts +3 -7
  149. package/commands/open.js +17 -11
  150. package/commands/project/add.d.ts +5 -2
  151. package/commands/project/add.js +43 -80
  152. package/commands/project/cloneApp.d.ts +1 -1
  153. package/commands/project/cloneApp.js +2 -2
  154. package/commands/project/create.d.ts +2 -8
  155. package/commands/project/create.js +84 -55
  156. package/commands/project/deploy.d.ts +2 -0
  157. package/commands/project/deploy.js +67 -13
  158. package/commands/project/dev/deprecatedFlow.d.ts +8 -2
  159. package/commands/project/dev/deprecatedFlow.js +9 -1
  160. package/commands/project/dev/index.d.ts +1 -4
  161. package/commands/project/dev/index.js +88 -31
  162. package/commands/project/dev/unifiedFlow.d.ts +11 -2
  163. package/commands/project/dev/unifiedFlow.js +81 -41
  164. package/commands/project/listBuilds.js +2 -5
  165. package/commands/project/migrate.d.ts +1 -0
  166. package/commands/project/profile/add.d.ts +7 -0
  167. package/commands/project/profile/add.js +209 -0
  168. package/commands/project/profile/delete.d.ts +6 -0
  169. package/commands/project/profile/delete.js +123 -0
  170. package/commands/project/profile.d.ts +3 -0
  171. package/commands/project/profile.js +25 -0
  172. package/commands/project/upload.d.ts +1 -0
  173. package/commands/project/upload.js +22 -8
  174. package/commands/project/validate.d.ts +6 -0
  175. package/commands/project/validate.js +82 -0
  176. package/commands/project.js +4 -2
  177. package/commands/remove.d.ts +3 -7
  178. package/commands/remove.js +22 -22
  179. package/commands/sandbox/create.d.ts +4 -9
  180. package/commands/sandbox/create.js +18 -11
  181. package/commands/sandbox/delete.d.ts +4 -9
  182. package/commands/sandbox/delete.js +18 -11
  183. package/commands/sandbox.d.ts +3 -4
  184. package/commands/sandbox.js +18 -43
  185. package/commands/secret/addSecret.d.ts +4 -9
  186. package/commands/secret/addSecret.js +17 -10
  187. package/commands/secret/deleteSecret.d.ts +4 -9
  188. package/commands/secret/deleteSecret.js +17 -10
  189. package/commands/secret/listSecret.d.ts +4 -9
  190. package/commands/secret/listSecret.js +17 -10
  191. package/commands/secret/updateSecret.d.ts +4 -9
  192. package/commands/secret/updateSecret.js +17 -10
  193. package/commands/secret.d.ts +3 -4
  194. package/commands/secret.js +23 -48
  195. package/commands/testAccount/create.d.ts +6 -0
  196. package/commands/testAccount/create.js +100 -0
  197. package/commands/testAccount/createConfig.d.ts +10 -0
  198. package/commands/testAccount/createConfig.js +98 -0
  199. package/commands/testAccount/delete.d.ts +6 -0
  200. package/commands/testAccount/delete.js +48 -0
  201. package/commands/testAccount.d.ts +3 -0
  202. package/commands/testAccount.js +28 -0
  203. package/commands/theme/generate-selectors.d.ts +3 -7
  204. package/commands/theme/generate-selectors.js +20 -15
  205. package/commands/theme/marketplace-validate.d.ts +4 -9
  206. package/commands/theme/marketplace-validate.js +22 -17
  207. package/commands/theme/preview.d.ts +4 -9
  208. package/commands/theme/preview.js +32 -26
  209. package/commands/theme.d.ts +3 -4
  210. package/commands/theme.js +22 -47
  211. package/commands/upload.d.ts +12 -1
  212. package/commands/upload.js +116 -134
  213. package/commands/watch.d.ts +14 -1
  214. package/commands/watch.js +74 -75
  215. package/lang/en.d.ts +1135 -660
  216. package/lang/en.js +935 -471
  217. package/lang/en.lyaml +30 -213
  218. package/lib/accountTypes.js +1 -2
  219. package/lib/app/migrate.d.ts +23 -0
  220. package/lib/app/migrate.js +29 -6
  221. package/lib/app/migrate_legacy.js +7 -7
  222. package/lib/app/urls.d.ts +16 -0
  223. package/lib/app/urls.js +16 -0
  224. package/lib/commonOpts.d.ts +1 -3
  225. package/lib/commonOpts.js +1 -1
  226. package/lib/configMigrate.d.ts +2 -2
  227. package/lib/configMigrate.js +34 -55
  228. package/lib/configOptions.d.ts +4 -0
  229. package/lib/configOptions.js +41 -46
  230. package/lib/constants.d.ts +29 -0
  231. package/lib/constants.js +30 -1
  232. package/lib/dependencyManagement.d.ts +0 -5
  233. package/lib/dependencyManagement.js +13 -39
  234. package/lib/doctor/Doctor.js +3 -2
  235. package/lib/errorHandlers/index.js +7 -0
  236. package/lib/filesystem.d.ts +1 -1
  237. package/lib/generateSelectors.js +3 -5
  238. package/lib/interpolation.d.ts +2 -3
  239. package/lib/lang.d.ts +2 -3
  240. package/lib/marketplaceValidate.d.ts +12 -2
  241. package/lib/marketplaceValidate.js +22 -29
  242. package/lib/mcp/setup.d.ts +21 -0
  243. package/lib/mcp/setup.js +218 -0
  244. package/lib/middleware/autoUpdateMiddleware.d.ts +1 -0
  245. package/lib/middleware/autoUpdateMiddleware.js +89 -0
  246. package/lib/middleware/configMiddleware.js +23 -0
  247. package/lib/middleware/fireAlarmMiddleware.d.ts +2 -2
  248. package/lib/middleware/fireAlarmMiddleware.js +5 -3
  249. package/lib/npm.d.ts +9 -0
  250. package/lib/npm.js +36 -0
  251. package/lib/projectProfiles.d.ts +7 -0
  252. package/lib/projectProfiles.js +83 -0
  253. package/lib/projects/add/legacyAddComponent.d.ts +5 -0
  254. package/lib/projects/add/legacyAddComponent.js +48 -0
  255. package/lib/projects/add/v3AddComponent.d.ts +8 -0
  256. package/lib/projects/add/v3AddComponent.js +85 -0
  257. package/lib/projects/buildAndDeploy.js +18 -3
  258. package/lib/projects/components.d.ts +2 -0
  259. package/lib/projects/components.js +82 -0
  260. package/lib/projects/create/index.d.ts +23 -0
  261. package/lib/projects/create/index.js +33 -0
  262. package/lib/projects/create/legacy.d.ts +6 -0
  263. package/lib/projects/{create.js → create/legacy.js} +20 -11
  264. package/lib/projects/create/v3.d.ts +27 -0
  265. package/lib/projects/create/v3.js +158 -0
  266. package/lib/projects/localDev/AppDevModeInterface.d.ts +30 -0
  267. package/lib/projects/localDev/AppDevModeInterface.js +215 -0
  268. package/lib/projects/localDev/DevServerManagerV2.d.ts +11 -22
  269. package/lib/projects/localDev/DevServerManagerV2.js +19 -15
  270. package/lib/projects/localDev/LocalDevLogger.d.ts +30 -0
  271. package/lib/projects/localDev/LocalDevLogger.js +159 -0
  272. package/lib/projects/localDev/LocalDevManager.js +12 -5
  273. package/lib/projects/localDev/LocalDevProcess.d.ts +34 -0
  274. package/lib/projects/localDev/LocalDevProcess.js +201 -0
  275. package/lib/projects/localDev/LocalDevState.d.ts +50 -0
  276. package/lib/projects/localDev/LocalDevState.js +119 -0
  277. package/lib/projects/localDev/LocalDevWatcher.d.ts +10 -0
  278. package/lib/projects/localDev/LocalDevWatcher.js +53 -0
  279. package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +20 -0
  280. package/lib/projects/localDev/LocalDevWebsocketServer.js +131 -0
  281. package/lib/projects/localDev/helpers.d.ts +3 -2
  282. package/lib/projects/localDev/helpers.js +32 -2
  283. package/lib/projects/upload.d.ts +5 -1
  284. package/lib/projects/upload.js +60 -20
  285. package/lib/projects/urls.d.ts +3 -0
  286. package/lib/projects/urls.js +17 -1
  287. package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
  288. package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +17 -0
  289. package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +96 -0
  290. package/lib/prompts/createProjectPrompt.d.ts +14 -5
  291. package/lib/prompts/createProjectPrompt.js +38 -13
  292. package/lib/prompts/createTemplatePrompt.d.ts +22 -4
  293. package/lib/prompts/installAppPrompt.d.ts +2 -0
  294. package/lib/prompts/installAppPrompt.js +45 -0
  295. package/lib/prompts/personalAccessKeyPrompt.js +35 -24
  296. package/lib/prompts/projectAddPrompt.d.ts +5 -1
  297. package/lib/prompts/projectAddPrompt.js +35 -7
  298. package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
  299. package/lib/prompts/projectDevTargetAccountPrompt.js +6 -6
  300. package/lib/prompts/promptUtils.d.ts +4 -1
  301. package/lib/prompts/promptUtils.js +5 -1
  302. package/lib/prompts/selectAppPrompt.d.ts +2 -0
  303. package/lib/prompts/selectAppPrompt.js +40 -0
  304. package/lib/prompts/{selectPublicAppPrompt.d.ts → selectPublicAppForMigrationPrompt.d.ts} +1 -1
  305. package/lib/prompts/{selectPublicAppPrompt.js → selectPublicAppForMigrationPrompt.js} +8 -8
  306. package/lib/prompts/setAsDefaultAccountPrompt.js +10 -0
  307. package/lib/testUtils.d.ts +3 -3
  308. package/lib/testUtils.js +8 -9
  309. package/lib/ui/index.js +4 -1
  310. package/lib/upload.d.ts +1 -1
  311. package/lib/validation.js +4 -5
  312. package/lib/yargsUtils.d.ts +4 -0
  313. package/lib/yargsUtils.js +6 -0
  314. package/mcp-server/server.d.ts +1 -0
  315. package/mcp-server/server.js +18 -0
  316. package/mcp-server/tools/index.d.ts +2 -0
  317. package/mcp-server/tools/index.js +19 -0
  318. package/mcp-server/tools/project/AddFeatureToProject.d.ts +29 -0
  319. package/mcp-server/tools/project/AddFeatureToProject.js +85 -0
  320. package/mcp-server/tools/project/CreateProjectTool.d.ts +35 -0
  321. package/mcp-server/tools/project/CreateProjectTool.js +104 -0
  322. package/mcp-server/tools/project/DeployProject.d.ts +20 -0
  323. package/mcp-server/tools/project/DeployProject.js +50 -0
  324. package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +17 -0
  325. package/mcp-server/tools/project/GuidedWalkthroughTool.js +58 -0
  326. package/mcp-server/tools/project/UploadProjectTools.d.ts +17 -0
  327. package/mcp-server/tools/project/UploadProjectTools.js +35 -0
  328. package/mcp-server/tools/project/ValidateProjectTool.d.ts +17 -0
  329. package/mcp-server/tools/project/ValidateProjectTool.js +35 -0
  330. package/mcp-server/tools/project/constants.d.ts +3 -0
  331. package/mcp-server/tools/project/constants.js +13 -0
  332. package/mcp-server/types.d.ts +14 -0
  333. package/mcp-server/types.js +17 -0
  334. package/mcp-server/utils/command.d.ts +3 -0
  335. package/mcp-server/utils/command.js +16 -0
  336. package/mcp-server/utils/content.d.ts +3 -0
  337. package/mcp-server/utils/content.js +21 -0
  338. package/mcp-server/utils/project.d.ts +5 -0
  339. package/mcp-server/utils/project.js +17 -0
  340. package/package.json +24 -16
  341. package/types/Cms.d.ts +30 -0
  342. package/types/Cms.js +2 -0
  343. package/types/LocalDev.d.ts +35 -0
  344. package/types/LocalDev.js +2 -0
  345. package/types/Projects.d.ts +19 -2
  346. package/types/Prompts.d.ts +0 -7
  347. package/types/Yargs.d.ts +10 -1
  348. package/lib/projects/create.d.ts +0 -5
  349. package/lib/projects/localDev/LocalDevManagerV2.d.ts +0 -64
  350. package/lib/projects/localDev/LocalDevManagerV2.js +0 -345
  351. package/lib/prompts/installPublicAppPrompt.d.ts +0 -1
  352. package/lib/prompts/installPublicAppPrompt.js +0 -41
package/lang/en.lyaml CHANGED
@@ -20,18 +20,6 @@ en:
20
20
  account:
21
21
  describe: "Commands for managing configured accounts."
22
22
  subcommands:
23
- auth:
24
- describe: "Configure authentication for your HubSpot account."
25
- options:
26
- account:
27
- describe: "HubSpot account to authenticate"
28
- errors:
29
- failedToUpdateConfig: "Failed to update the configuration file. Please try again."
30
- migrationNotConfirmed: "Did not migrate. Use the {{ authCommand }} command to update the deprecated config at {{ deprecatedConfigPath }}."
31
- mergeNotConfirmed: "Did not merge. When you are ready to merge the deprecated config file with the global config file, run the {{ authCommand }} or {{ migrateCommand }} command."
32
- success:
33
- configFileCreated: "Created config file \"{{ configPath }}\""
34
- configFileUpdated: "Connected account \"{{ account }}\" and set it as the default account"
35
23
  createOverride:
36
24
  describe: "Create a new default account override file ({{ hsAccountFileName }}) in the current working directory."
37
25
  success: "Default account override file created at {{ overrideFilePath }}"
@@ -39,6 +27,7 @@ en:
39
27
  prompts:
40
28
  replaceOverrideFile: "Replace existing account override file?"
41
29
  errors:
30
+ globalConfigNotFound: "This command is only compatible with our new global config. Run {{ authCommand }} to get started."
42
31
  accountNotFound: "The specified account could not be found in the config file {{ configPath }}"
43
32
  options:
44
33
  account:
@@ -54,6 +43,8 @@ en:
54
43
  deleteOverrideFile: "Delete account override file?"
55
44
  success: "Removed the default account override file."
56
45
  noOverrideFile: "No default account override file found in the current working directory. No action required."
46
+ errors:
47
+ globalConfigNotFound: "This command is only compatible with our new global config. Run {{ authCommand }} to get started."
57
48
  options:
58
49
  force:
59
50
  describe: "Skip confirmation prompt when removing the override file"
@@ -152,7 +143,7 @@ en:
152
143
  verboseDescribe: "Configure authentication for a HubSpot account. This will update the {{ configName }} file that stores your account information.\n\nThe recommended authentication method is {{#bold}}{{ authMethod }}{{/bold}}, which uses an access token tied to a specific user account."
153
144
  errors:
154
145
  unsupportedAuthType: "Unsupported auth type: {{ type }}. The only supported authentication protocols are {{ supportedProtocols }}."
155
- globalConfigFileExists: "A global config file exists at {{ configPath }}. To authorize an account, please use {{ authCommand }}."
146
+ globalConfigFileExists: "You are using our new global configuration for account management, which is not compatible with this command. Please use {{ accountAuthCommand }} instead."
156
147
  options:
157
148
  authType:
158
149
  describe: "Authentication method"
@@ -163,16 +154,6 @@ en:
163
154
  config:
164
155
  describe: "Commands for managing the CLI config file."
165
156
  subcommands:
166
- migrate:
167
- describe: "Migrate from the deprecated {{ deprecatedConfigPath }} file to the new global config file at {{ globalConfigPath }}."
168
- migrationAlreadyCompleted: "No {{ deprecatedConfigPath }} deprecated configuration file found. No migration necessary."
169
- errors:
170
- configNotFound: "A configuration file at {{ configPath }} could not be found. Please try again with a valid file path."
171
- options:
172
- force: "When merging a deprecated configuration file with an existing global configuration file, overwrite any conflicting values in the global config with the deprecated config values."
173
- examples:
174
- default: "Migrate from the deprecated {{ deprecatedConfigPath }} file to the new global config file at {{ globalConfigPath }}"
175
- configFlag: "Migrate a specific config file (specified with the config flag) to the new global config file at {{ globalConfigPath }}"
176
157
  set:
177
158
  describe: "Set various configuration options within the hubspot.config.yml file."
178
159
  promptMessage: "Select a config option to update"
@@ -527,7 +508,7 @@ en:
527
508
  updateConfig: "To update an existing config file, use the \"hs auth\" command."
528
509
  errors:
529
510
  configFileExists: "The config file {{ configPath }} already exists."
530
- globalConfigFileExists: "A global config file already exists at {{ configPath }}. To specify a new local config file, delete the existing one and try again."
511
+ globalConfigFileExists: "You are using our new global configuration for account management, which is not compatible with this command. Please use {{ accountAuthCommand }} instead."
531
512
  lint:
532
513
  issuesFound: "{{ count }} issues found."
533
514
  groupName: "Linting {{ path }}"
@@ -588,15 +569,21 @@ en:
588
569
  betaMessage: "HubSpot projects local development"
589
570
  placeholderAccountSelection: "Using default account as target account (for now)"
590
571
  learnMoreLocalDevServer: "Learn more about the projects local dev server"
572
+ accountTypeInformation: "Testing in a developer test account is strongly recommended, but you can use a sandbox account if your plan allows you to create one."
573
+ learnMoreMessage: "Visit our {{ learnMoreLink }} to learn more."
574
+ learnMoreLink: "docs on Developer Test and Sandbox accounts "
591
575
  errors:
592
576
  noProjectConfig: "No project detected. Please run this command again from a project directory."
593
577
  noAccount: "An error occurred while reading account {{ accountId }} from your config. Run {{ authCommand }} to re-auth this account."
594
578
  noAccountsInConfig: "No accounts found in your config. Run {{ authCommand }} to configure a HubSpot account with the CLI."
595
579
  invalidProjectComponents: "Projects cannot contain both private and public apps. Move your apps to separate projects before attempting local development."
596
580
  noRunnableComponents: "No supported components were found in this project. Run {{ command }} to see a list of available components and add one to your project."
597
- invalidUnifiedAppsAccount: "Local development of Unified Apps is currently only supported in standard and developer accounts. Target a standard or developer account with {{ authCommand }} and try again."
581
+ accountNotCombined: "Local development of Unified Apps is currently only compatible with accounts that are opted into the unified apps beta. Make sure that this account is opted in or switch accounts using {{ accountUseCommand }}."
598
582
  examples:
599
583
  default: "Start local dev for the current project"
584
+ options:
585
+ profile:
586
+ describe: "The profile to target during local dev"
600
587
  create:
601
588
  describe: "Create a new project."
602
589
  errors:
@@ -707,6 +694,7 @@ en:
707
694
  buildIdDoesNotExist: "Build {{ buildId }} does not exist for project {{ projectName }}. {{ linkToProject }}"
708
695
  buildAlreadyDeployed: "Build {{ buildId }} is already deployed. {{ linkToProject}}"
709
696
  viewProjectsBuilds: 'View project builds in HubSpot'
697
+ deployContainsRemovals: "- This deploy would remove the {{#bold}}{{ componentName }}{{/bold}} component. To proceed, run the deploy command with the {{ forceFlag }} flag"
710
698
  examples:
711
699
  default: "Deploy the latest build of the current project"
712
700
  withOptions: "Deploy build 5 of the project my-project"
@@ -715,6 +703,10 @@ en:
715
703
  describe: "Project build ID to be deployed"
716
704
  project:
717
705
  describe: "Project name"
706
+ profile:
707
+ describe: "The profile to target with this deploy"
708
+ force:
709
+ describe: "Skip warnings and force deploy. Use this carefully as it will bypass warnings for destructive actions."
718
710
  listBuilds:
719
711
  describe: "List the project's builds."
720
712
  continueOrExitPrompt: "Press <enter> to load more, or ctrl+c to exit"
@@ -782,6 +774,8 @@ en:
782
774
  describe: "Automatically create project if it does not exist"
783
775
  message:
784
776
  describe: "Add a message when you upload your project and create a build"
777
+ profile:
778
+ describe: "The profile to target with this upload"
785
779
  watch:
786
780
  describe: "Watch your local project for changes and automatically upload changed files to a new build in HubSpot."
787
781
  examples:
@@ -841,18 +835,10 @@ en:
841
835
  default: "Opens the projects page for the specified account"
842
836
  success: "Successfully opened \"{{ projectName }}\""
843
837
  feedback:
844
- describe: "Leave feedback on HubSpot projects or file a bug report."
845
- feedbackType:
846
- prompt: "What type of feedback would you like to leave?"
847
- bug: "[--bug] Report a bug"
848
- general: "[--general] Tell us about your experience with HubSpot's developer tools"
849
- openPrompt: "Create a Github issue in your browser?"
838
+ describe: "Leave feedback or file a bug report."
839
+ openPrompt: "Open the feedback form in your browser?"
850
840
  success: "We opened {{ url }} in your browser."
851
- options:
852
- bug:
853
- describe: "Open Github issues in your browser to report a bug."
854
- general:
855
- describe: "Open Github issues in your browser to give feedback."
841
+ error: "Navigate to {{ url }} to leave feedback."
856
842
  installDeps:
857
843
  help:
858
844
  describe: "Install the dependencies for your project, or add a dependency to a subcomponent of a project."
@@ -867,14 +853,6 @@ en:
867
853
  noProjectConfig: "No project detected. Run this command from a project directory."
868
854
  noPackageJsonInProject: "No dependencies to install. The project {{ projectName }} folder might be missing component or subcomponent files. {{ link }}"
869
855
  packageManagerNotInstalled: "This command depends on {{ packageManager }}, install {{#bold}}{{ link }}{{/bold}}"
870
- remove:
871
- describe: "Delete a file or folder from HubSpot."
872
- deleted: "Deleted \"{{ path }}\" from account {{ accountId }}"
873
- errors:
874
- deleteFailed: "Deleting \"{{ path }}\" from account {{ accountId }} failed"
875
- positionals:
876
- path:
877
- describe: "Remote hubspot path"
878
856
  sandbox:
879
857
  describe: "Commands for managing sandboxes."
880
858
  subcommands:
@@ -972,144 +950,6 @@ en:
972
950
  success:
973
951
  update: "The secret \"{{ secretName }}\" was updated in the HubSpot account: {{ accountIdentifier }}"
974
952
  updateExplanation: "Existing serverless functions will start using this new value within 10 seconds."
975
- theme:
976
- describe: "Commands for managing themes."
977
- subcommands:
978
- generateSelectors:
979
- describe: "Automatically generates an editor-preview.json file for the given theme. The selectors this command generates are not perfect, so please edit editor-preview.json after running."
980
- errors:
981
- invalidPath: "Could not find directory \"{{ themePath }}\""
982
- fieldsNotFound: "Unable to find theme's fields.json."
983
- noSelectorsFound: "No selectors found."
984
- success: "Selectors generated for {{ themePath }}, please double check the selectors generated at {{ selectorsPath }} before uploading the theme."
985
- positionals:
986
- path:
987
- describe: "The path of the theme you'd like to generate an editor-preview.json for."
988
- marketplaceValidate:
989
- describe: "Validate a theme for the marketplace."
990
- errors:
991
- invalidPath: "The path \"{{ path }}\" is not a path to a folder in the Design Manager"
992
- logs:
993
- validatingTheme: "Validating theme \"{{ path }}\" \n"
994
- results:
995
- required: "Required validation results:"
996
- recommended: "Recommended validation results:"
997
- warnings:
998
- file: "File: {{ file }}"
999
- lineNumber: "Line number: {{ line }}"
1000
- noErrors: "No errors"
1001
- positionals:
1002
- path:
1003
- describe: "Path to the theme within the Design Manager."
1004
- preview:
1005
- describe: "Upload and watch a theme directory on your computer for changes and start a local development server to preview theme changes on a site."
1006
- errors:
1007
- invalidPath: "The path \"{{ path }}\" is not a path to a directory"
1008
- noThemeComponents: "Your project has no theme components available to preview."
1009
- positionals:
1010
- src:
1011
- describe: "Path to the local directory your theme is in, relative to your current working directory"
1012
- dest:
1013
- describe: "Path in HubSpot Design Tools. Can be a net new path. If you wish to preview a site page using your theme changes it must match the path of the theme used by the site."
1014
- options:
1015
- notify:
1016
- describe: "Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file"
1017
- noSsl:
1018
- describe: "Disable HTTPS"
1019
- port:
1020
- describe: "The port on which to start the local server"
1021
- initialUploadProgressBar:
1022
- start: "Starting..."
1023
- uploading: "Uploading..."
1024
- finish: "Complete!"
1025
- logs:
1026
- processExited: "Stopping dev server..."
1027
- module:
1028
- describe: "Commands for working with modules, including marketplace validation with the marketplace-validate subcommand."
1029
- subcommands:
1030
- marketplaceValidate:
1031
- describe: "Validate a module for the marketplace. Make sure to include the suffix .module in the path to the module within the Design Manager."
1032
- errors:
1033
- invalidPath: "The path \"{{ path }}\" is not a path to a module within the Design Manager."
1034
- logs:
1035
- validatingModule: "Validating module \"{{ path }}\" \n"
1036
- options:
1037
- json:
1038
- describe: "Output raw json data"
1039
- results:
1040
- required: "Required validation results:"
1041
- recommended: "Recommended validation results:"
1042
- warnings:
1043
- file: "File: {{ file }}"
1044
- lineNumber: "Line number: {{ line }}"
1045
- noErrors: "No errors"
1046
- positionals:
1047
- src:
1048
- describe: "Path to the module within the Design Manager."
1049
- upload:
1050
- describe: "Upload a folder or file from your computer to the HubSpot CMS."
1051
- errors:
1052
- destinationRequired: "A destination path needs to be passed"
1053
- fileIgnored: "The file \"{{ path }}\" is being ignored via an .hsignore rule"
1054
- invalidPath: "The path \"{{ path }}\" is not a path to a file or folder"
1055
- uploadFailed: "Uploading file \"{{ src }}\" to \"{{ dest }}\" failed"
1056
- someFilesFailed: "One or more files failed to upload to \"{{ dest }}\" in the Design Manager"
1057
- deleteFailed: "Deleting \"{{ path }}\" from account {{ accountId }} failed"
1058
- options:
1059
- options:
1060
- describe: "Options to pass to javascript fields files"
1061
- saveOutput:
1062
- describe: "If true, saves all output from javascript fields files as 'fields.output.json'."
1063
- convertFields:
1064
- describe: "If true, converts any javascript fields files contained in module folder or project root."
1065
- clean:
1066
- describe: "Will delete the destination directory and its contents before uploading. This will also clear the global content associated with any global partial templates and modules."
1067
- force:
1068
- describe: "Skips confirmation prompts when doing a clean upload."
1069
- previewUrl: "To preview this theme, visit: {{ previewUrl }}"
1070
- positionals:
1071
- src:
1072
- describe: "Path to the local file, relative to your current working directory."
1073
- dest:
1074
- describe: "Path in HubSpot Design Tools, can be a net new path."
1075
- success:
1076
- fileUploaded: "Uploaded file from \"{{ src }}\" to \"{{ dest }}\" in the Design Manager of account {{ accountId }}"
1077
- uploadComplete: "Uploading files to \"{{ dest }}\" in the Design Manager is complete"
1078
- uploading: "Uploading files from \"{{ src }}\" to \"{{ dest }}\" in the Design Manager of account {{ accountId }}"
1079
- notUploaded: "There was an error processing \"{{ src }}\". The file has not been uploaded."
1080
- cleaning: "Removing \"{{ filePath }}\" from account {{ accountId }} and uploading local..."
1081
- confirmCleanUpload: "You are about to delete the directory \"{{ filePath }}\" and its contents on HubSpot account {{ accountId }} before uploading. This will also clear the global content associated with any global partial templates and modules. Are you sure you want to do this?"
1082
- watch:
1083
- describe: "Watch a directory on your computer for changes and upload the changed files to the HubSpot CMS."
1084
- errors:
1085
- folderFailed: "Initial uploading of folder \"{{ src }}\" to \"{{ dest }}\" in account {{ accountId }} had failures"
1086
- fileFailed: "Upload of file \"{{ file }}\" to \"{{ dest }}\" in account {{ accountId }} failed"
1087
- destinationRequired: "A destination directory needs to be passed"
1088
- invalidPath: "The \"{{ path }}\" is not a path to a directory"
1089
- options:
1090
- disableInitial:
1091
- describe: "Disable the initial upload when watching a directory (default)"
1092
- initialUpload:
1093
- describe: "Upload directory before watching for updates"
1094
- notify:
1095
- describe: "Log to specified file when a watch task is triggered and after workers have gone idle. Ex. --notify path/to/file"
1096
- remove:
1097
- describe: "Will cause watch to delete files in your HubSpot account that are not found locally."
1098
- convertFields:
1099
- describe: "If true, converts any javascript fields files contained in module folder or project root."
1100
- saveOutput:
1101
- describe: "If true, saves all output from javascript fields files as 'fields.output.json'."
1102
- options:
1103
- describe: "Options to pass to javascript fields files"
1104
- positionals:
1105
- src:
1106
- describe: "Path to the local directory your files are in, relative to your current working directory"
1107
- dest:
1108
- describe: "Path in HubSpot Design Tools. Can be a net new path"
1109
- warnings:
1110
- disableInitial: "Passing the \"--disable-initial\" option is no longer necessary. Running \"hs watch\" no longer uploads the watched directory by default."
1111
- initialUpload: "To upload the directory run \"hs upload\" beforehand or add the \"--initial-upload\" option when running \"hs watch\"."
1112
- notUploaded: "The \"hs watch\" command no longer uploads the watched directory when started. The directory \"{{ path }}\" was not uploaded."
1113
953
  convertFields:
1114
954
  describe: "Converts a specific JavaScript fields file of a module or theme to JSON."
1115
955
  positionals:
@@ -1196,7 +1036,7 @@ en:
1196
1036
  errors:
1197
1037
  noProjectsInConfig: "Unable to find any projects in the target repository's config.json file. Please ensure that there is a \"projects\" array in the config file."
1198
1038
  missingConfigFileTemplateSource: "Failed to fetch the config.json file from the target repository. Please ensure that there is a valid config.json file at the root of the repository and try again."
1199
- missingPropertiesInConfig: "Found misconfigured projects in the target repository's config.json file. Please ensure that each project in the target repository's config.json file contains the following properties: [\"name\", \"label\", \"path\", \"insertPath\"]."
1039
+ missingPropertiesInConfig: "Found misconfigured projects in the target repository's config.json file. Please ensure that each project in the target repository's config.json file contains the following properties: [\"name\", \"label\", \"path\"]."
1200
1040
  validateProjectConfig:
1201
1041
  configNotFound: "Unable to locate a project configuration file. Try running again from a project directory, or run {{ createCommand }} to create a new project."
1202
1042
  configMissingFields: "The project configuration file is missing required fields."
@@ -1212,19 +1052,6 @@ en:
1212
1052
  logFeedbackMessage:
1213
1053
  feedbackHeader: "We'd love to hear your feedback!"
1214
1054
  feedbackMessage: "How are you liking the new projects and developer tools? \n > Run `{{#yellow}}hs feedback{{/yellow}}` to let us know what you think!\n"
1215
- projectBuildAndDeploy:
1216
- makePollTaskStatusFunc:
1217
- componentCountSingular: "Found 1 component in this project"
1218
- componentCount: "Found {{ numComponents }} components in this project"
1219
- successStatusText: "DONE"
1220
- failedStatusText: "FAILED"
1221
- errorFetchingTaskStatus: "An error occurred while fetching the status of the current {{ taskType }}. For more information, view this project in HubSpot by running {{ openCommand }}."
1222
- pollBuildAutodeployStatusError: "Error fetching autodeploy status for build #{{ buildId }}"
1223
- pollProjectBuildAndDeploy:
1224
- buildSucceededAutomaticallyDeploying: "Build #{{ buildId }} succeeded. {{#bold}}Automatically deploying{{/bold}} to {{ accountIdentifier }}\n"
1225
- cleanedUpTempFile: "Cleaned up temporary file {{ path }}"
1226
- viewDeploys: "View all deploys for this project in HubSpot"
1227
- unableToFindAutodeployStatus: "Unable to find the auto deploy for build #{{ buildId }}. This deploy may have been skipped. {{ viewDeploysLink }}."
1228
1055
  projectUpload:
1229
1056
  uploadProjectFiles:
1230
1057
  add: "Uploading {{#bold}}{{ projectName }}{{/bold}} project files to {{ accountIdentifier }}"
@@ -1270,6 +1097,9 @@ en:
1270
1097
  feedbackCommand:
1271
1098
  command: "hs feedback"
1272
1099
  message: "Run {{ command }} to report a bug or leave feedback"
1100
+ getStartedCommand:
1101
+ command: "hs get-started"
1102
+ message: "Run {{ command }} to get started with HubSpot development"
1273
1103
  helpCommand:
1274
1104
  command: "hs help"
1275
1105
  message: "Run {{ command }} to see a list of available commands"
@@ -1287,7 +1117,7 @@ en:
1287
1117
  message: "Run {{ command }} to upload your project to your HubSpot account"
1288
1118
  projectDevCommand:
1289
1119
  command: "hs project dev"
1290
- message: "Run {{ command }} to set up your test environment and start local development"
1120
+ message: "Run {{ command }} from within your project directory to set up your test environment and start local development"
1291
1121
  projectInstallDepsCommand:
1292
1122
  command: "hs project install-deps"
1293
1123
  message: "Run {{ command }} to install dependencies for your project components"
@@ -1328,13 +1158,6 @@ en:
1328
1158
  describe: "Use environment variable config"
1329
1159
  debug:
1330
1160
  describe: "Set log level to debug"
1331
- configMigrate:
1332
- migrateConfigPrompt: "Migrate config?\n From deprecated config file: {{ deprecatedConfigPath }}\n To new global config file: {{ globalConfigPath }}\n (This action will delete the deprecated config file).\n"
1333
- mergeConfigConflictPrompt: "Change the {{ property }} property in the global config from {{ newValue }} to {{ oldValue }}?"
1334
- mergeConfigsPrompt: "Two config files detected. Merge them?\n Deprecated config file: {{ deprecatedConfigPath }}\n Global config: {{ globalConfigPath }}\n (This action will delete the deprecated config file).\n"
1335
- migrationSuccess: "The deprecated config file has been migrated to the new global config file at {{ globalConfigPath }}."
1336
- mergeSuccess: "The deprecated config file has been merged with the global config file at {{ globalConfigPath }}."
1337
- skippedExistingAccounts: "\nThe following accounts were not merged, because they already exist in the global config: {{ skippedAccountIds }}.\n"
1338
1161
  prompts:
1339
1162
  projectDevTargetAccountPrompt:
1340
1163
  createNewSandboxOption: "<Test on a new development sandbox>"
@@ -1423,7 +1246,7 @@ en:
1423
1246
  invalidCharacters: "The selected destination contains invalid characters. Please provide a new path and try again."
1424
1247
  invalidTemplate: "[--template] Could not find template \"{{ template }}\". Please choose an available template:"
1425
1248
  projectTemplateRequired: "Project template is required when projectTemplates is provided"
1426
- selectPublicAppPrompt:
1249
+ selectPublicAppForMigrationPrompt:
1427
1250
  selectAppIdMigrate: "[--appId] Choose an app under {{ accountName }} to migrate:"
1428
1251
  selectAppIdClone: "[--appId] Choose an app under {{ accountName }} to clone:"
1429
1252
  errors:
@@ -1446,8 +1269,8 @@ en:
1446
1269
  nameRequired: "A component name is required"
1447
1270
  invalidType: "[--type] Could not find type \"{{ type }}\". Please choose an available type:"
1448
1271
  secretPrompt:
1449
- enterValue: "Enter a value for your secret: "
1450
- enterName: "Enter a name for your secret: "
1272
+ enterValue: "Enter a value for the secret: "
1273
+ enterName: "Enter the name of the secret to add: "
1451
1274
  selectSecretUpdate: "Select the secret you want to update"
1452
1275
  selectSecretDelete: "Select the secret you want to delete"
1453
1276
  errors:
@@ -1478,12 +1301,6 @@ en:
1478
1301
  errors:
1479
1302
  srcRequired: "You must specify a source directory."
1480
1303
  destRequired: "You must specify a destination directory."
1481
- installPublicAppPrompt:
1482
- explanation: "Local development requires this app to be installed in the target test account"
1483
- reinstallExplanation: "This app's required scopes have been updated since it was last installed on the target test account. To avoid issues with local development, we recommend reinstalling the app with the updated scopes."
1484
- prompt: "Open HubSpot to install this app?"
1485
- reinstallPrompt: "Open HubSpot to reinstall this app?"
1486
- decline: "To continue local development of this app, install it in your target test account and re-run {{#bold}}`hs project dev`{{/bold}}"
1487
1304
  selectHubDBTablePrompt:
1488
1305
  selectTable: "Select a HubDB table:"
1489
1306
  enterDest: "Enter the destination path:"
@@ -39,6 +39,5 @@ async function isUnifiedAccount(account) {
39
39
  if (!accountId) {
40
40
  return false;
41
41
  }
42
- const isUngatedForUnifiedApps = await (0, hasFeature_1.hasFeature)(accountId, constants_1.FEATURES.UNIFIED_APPS);
43
- return isStandardAccount(account) && isUngatedForUnifiedApps;
42
+ return (0, hasFeature_1.hasFeature)(accountId, constants_1.FEATURES.UNIFIED_APPS);
44
43
  }
@@ -1,11 +1,34 @@
1
1
  import { ArgumentsCamelCase } from 'yargs';
2
2
  import { LoadedProjectConfig } from '../projects/config';
3
+ import { MigrationApp, MigrationFailed, MigrationStatus } from '../../api/migrate';
3
4
  import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs } from '../../types/Yargs';
4
5
  export type MigrateAppArgs = CommonArgs & AccountArgs & EnvironmentArgs & ConfigArgs & {
5
6
  name?: string;
6
7
  dest?: string;
7
8
  appId?: number;
8
9
  platformVersion: string;
10
+ unstable: boolean;
9
11
  };
12
+ export declare function getUnmigratableReason(reasonCode: string, projectName: string | undefined, accountId: number): string;
13
+ export declare function generateFilterAppsByProjectNameFunction(projectConfig?: LoadedProjectConfig): (app: MigrationApp) => boolean;
14
+ export declare function buildErrorMessageFromMigrationStatus(error: MigrationFailed): string;
15
+ export declare function fetchMigrationApps(appId: MigrateAppArgs['appId'], derivedAccountId: number, platformVersion: string, projectConfig?: LoadedProjectConfig): Promise<MigrationApp[]>;
16
+ export declare function promptForAppToMigrate(allApps: MigrationApp[], derivedAccountId: number): Promise<number>;
17
+ export declare function selectAppToMigrate(allApps: MigrationApp[], derivedAccountId: number, appId?: number): Promise<{
18
+ proceed: boolean;
19
+ appIdToMigrate?: number;
20
+ }>;
21
+ export declare function handleMigrationSetup(derivedAccountId: number, options: ArgumentsCamelCase<MigrateAppArgs>, projectConfig?: LoadedProjectConfig): Promise<{
22
+ appIdToMigrate?: number | undefined;
23
+ projectName?: string;
24
+ projectDest?: string;
25
+ }>;
26
+ export declare function beginMigration(derivedAccountId: number, appId: number, platformVersion: string): Promise<{
27
+ migrationId: number;
28
+ uidMap: Record<string, string>;
29
+ } | undefined>;
30
+ export declare function pollMigrationStatus(derivedAccountId: number, migrationId: number, successStates?: string[]): Promise<MigrationStatus>;
31
+ export declare function finalizeMigration(derivedAccountId: number, migrationId: number, uidMap: Record<string, string>, projectName: string): Promise<number>;
32
+ export declare function downloadProjectFiles(derivedAccountId: number, projectName: string, buildId: number, projectDest: string, projectConfig?: LoadedProjectConfig): Promise<void>;
10
33
  export declare function migrateApp2025_2(derivedAccountId: number, options: ArgumentsCamelCase<MigrateAppArgs>, projectConfig?: LoadedProjectConfig): Promise<void>;
11
34
  export declare function logInvalidAccountError(): void;
@@ -3,6 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getUnmigratableReason = getUnmigratableReason;
7
+ exports.generateFilterAppsByProjectNameFunction = generateFilterAppsByProjectNameFunction;
8
+ exports.buildErrorMessageFromMigrationStatus = buildErrorMessageFromMigrationStatus;
9
+ exports.fetchMigrationApps = fetchMigrationApps;
10
+ exports.promptForAppToMigrate = promptForAppToMigrate;
11
+ exports.selectAppToMigrate = selectAppToMigrate;
12
+ exports.handleMigrationSetup = handleMigrationSetup;
13
+ exports.beginMigration = beginMigration;
14
+ exports.pollMigrationStatus = pollMigrationStatus;
15
+ exports.finalizeMigration = finalizeMigration;
16
+ exports.downloadProjectFiles = downloadProjectFiles;
6
17
  exports.migrateApp2025_2 = migrateApp2025_2;
7
18
  exports.logInvalidAccountError = logInvalidAccountError;
8
19
  const path_1 = __importDefault(require("path"));
@@ -43,7 +54,7 @@ function getUnmigratableReason(reasonCode, projectName, accountId) {
43
54
  return en_1.lib.migrate.errors.unmigratableReasons.generic(reasonCode);
44
55
  }
45
56
  }
46
- function filterAppsByProjectName(projectConfig) {
57
+ function generateFilterAppsByProjectNameFunction(projectConfig) {
47
58
  return (app) => {
48
59
  if (projectConfig) {
49
60
  return app.projectName === projectConfig?.projectConfig?.name;
@@ -65,8 +76,8 @@ function buildErrorMessageFromMigrationStatus(error) {
65
76
  }
66
77
  async function fetchMigrationApps(appId, derivedAccountId, platformVersion, projectConfig) {
67
78
  const { data: { migratableApps, unmigratableApps }, } = await (0, migrate_1.listAppsForMigration)(derivedAccountId, platformVersion);
68
- const filteredMigratableApps = migratableApps.filter(filterAppsByProjectName(projectConfig));
69
- const filteredUnmigratableApps = unmigratableApps.filter(filterAppsByProjectName(projectConfig));
79
+ const filteredMigratableApps = migratableApps.filter(generateFilterAppsByProjectNameFunction(projectConfig));
80
+ const filteredUnmigratableApps = unmigratableApps.filter(generateFilterAppsByProjectNameFunction(projectConfig));
70
81
  const allApps = [...filteredMigratableApps, ...filteredUnmigratableApps];
71
82
  if (allApps.length > 1 && projectConfig) {
72
83
  throw new Error(en_1.lib.migrate.errors.project.multipleApps);
@@ -225,9 +236,21 @@ async function beginMigration(derivedAccountId, appId, platformVersion) {
225
236
  if (Object.values(componentsRequiringUids).length !== 0) {
226
237
  for (const [componentId, component] of Object.entries(componentsRequiringUids)) {
227
238
  const { componentHint, componentType } = component;
228
- uidMap[componentId] = await (0, promptUtils_1.inputPrompt)(en_1.lib.migrate.prompt.uidForComponent(componentHint
229
- ? `${(0, transform_1.mapToUserFacingType)(componentType)} '${componentHint}'`
230
- : (0, transform_1.mapToUserFacingType)(componentType)), {
239
+ // Extract the internal ID from the base64-encoded ComponentExternalId
240
+ let internalId;
241
+ try {
242
+ const decoded = Buffer.from(componentId, 'base64').toString('utf8');
243
+ const parts = decoded.split('$$');
244
+ internalId = parts[1] || componentId;
245
+ }
246
+ catch {
247
+ // If decoding fails, use the componentId as the internalId
248
+ internalId = componentId;
249
+ }
250
+ const promptText = componentHint
251
+ ? `${(0, transform_1.mapToUserFacingType)(componentType)} '${componentHint}' (ID: ${internalId})`
252
+ : `${(0, transform_1.mapToUserFacingType)(componentType)} (ID: ${internalId})`;
253
+ uidMap[componentId] = await (0, promptUtils_1.inputPrompt)(en_1.lib.migrate.prompt.uidForComponent(promptText), {
231
254
  validate: (uid) => {
232
255
  const result = (0, project_parsing_lib_1.validateUid)(uid);
233
256
  return result === undefined ? true : result;
@@ -17,7 +17,7 @@ const exitCodes_1 = require("../enums/exitCodes");
17
17
  const ui_1 = require("../ui");
18
18
  const lang_1 = require("../lang");
19
19
  const accountTypes_1 = require("../accountTypes");
20
- const selectPublicAppPrompt_1 = require("../prompts/selectPublicAppPrompt");
20
+ const selectPublicAppForMigrationPrompt_1 = require("../prompts/selectPublicAppForMigrationPrompt");
21
21
  const createProjectPrompt_1 = require("../prompts/createProjectPrompt");
22
22
  const ensureProjectExists_1 = require("../projects/ensureProjectExists");
23
23
  const usageTracking_1 = require("../usageTracking");
@@ -30,11 +30,11 @@ async function migrateApp2023_2(derivedAccountId, options, accountConfig) {
30
30
  const defaultAccountIsUnified = await (0, accountTypes_1.isUnifiedAccount)(accountConfig);
31
31
  if (!(0, accountTypes_1.isAppDeveloperAccount)(accountConfig) && !defaultAccountIsUnified) {
32
32
  (0, migrate_1.logInvalidAccountError)();
33
- process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
33
+ return process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
34
34
  }
35
35
  let appId = options.appId;
36
36
  if (!appId) {
37
- const { appId: selectAppId } = await (0, selectPublicAppPrompt_1.selectPublicAppPrompt)({
37
+ const { appId: selectAppId } = await (0, selectPublicAppForMigrationPrompt_1.selectPublicAppForMigrationPrompt)({
38
38
  accountId: derivedAccountId,
39
39
  accountName,
40
40
  isMigratingApp: true,
@@ -51,12 +51,12 @@ async function migrateApp2023_2(derivedAccountId, options, accountConfig) {
51
51
  logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.migrateApp.errors.invalidApp`, {
52
52
  appId,
53
53
  }));
54
- process.exit(exitCodes_1.EXIT_CODES.ERROR);
54
+ return process.exit(exitCodes_1.EXIT_CODES.ERROR);
55
55
  }
56
56
  }
57
57
  catch (error) {
58
58
  (0, errorHandlers_1.logError)(error, new errorHandlers_1.ApiErrorContext({ accountId: derivedAccountId }));
59
- process.exit(exitCodes_1.EXIT_CODES.ERROR);
59
+ return process.exit(exitCodes_1.EXIT_CODES.ERROR);
60
60
  }
61
61
  const createProjectPromptResponse = await (0, createProjectPrompt_1.createProjectPrompt)(options);
62
62
  const { name: projectName, dest: projectDest } = createProjectPromptResponse;
@@ -86,7 +86,7 @@ async function migrateApp2023_2(derivedAccountId, options, accountConfig) {
86
86
  });
87
87
  process.stdin.resume();
88
88
  if (!shouldCreateApp) {
89
- process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
89
+ return process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
90
90
  }
91
91
  try {
92
92
  SpinniesManager_1.default.init();
@@ -97,7 +97,7 @@ async function migrateApp2023_2(derivedAccountId, options, accountConfig) {
97
97
  if ((key.ctrl && key.name === 'c') || key.name === 'q') {
98
98
  SpinniesManager_1.default.remove('migrateApp');
99
99
  logger_1.logger.log((0, lang_1.i18n)(`commands.project.subcommands.migrateApp.migrationInterrupted`));
100
- process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
100
+ return process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
101
101
  }
102
102
  });
103
103
  const { data: migrateResponse } = await (0, projects_1.migrateApp)(derivedAccountId, appId, projectName);
@@ -0,0 +1,16 @@
1
+ import { Environment } from '@hubspot/local-dev-lib/types/Config';
2
+ type PrivateAppInstallUrlArgs = {
3
+ targetAccountId: number;
4
+ env: Environment;
5
+ appId: string;
6
+ };
7
+ type PublicAppInstallUrlArgs = {
8
+ targetAccountId: number;
9
+ env: Environment;
10
+ clientId: string;
11
+ scopes: string[];
12
+ redirectUrls: string[];
13
+ };
14
+ export declare function getOauthAppInstallUrl({ targetAccountId, env, clientId, scopes, redirectUrls, }: PublicAppInstallUrlArgs): string;
15
+ export declare function getStaticAuthAppInstallUrl({ targetAccountId, env, appId, }: PrivateAppInstallUrlArgs): string;
16
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOauthAppInstallUrl = getOauthAppInstallUrl;
4
+ exports.getStaticAuthAppInstallUrl = getStaticAuthAppInstallUrl;
5
+ const urls_1 = require("@hubspot/local-dev-lib/urls");
6
+ function getOauthAppInstallUrl({ targetAccountId, env, clientId, scopes, redirectUrls, }) {
7
+ const websiteOrigin = (0, urls_1.getHubSpotWebsiteOrigin)(env);
8
+ return (`${websiteOrigin}/oauth/${targetAccountId}/authorize` +
9
+ `?client_id=${encodeURIComponent(clientId)}` +
10
+ `&scope=${encodeURIComponent(scopes.join(' '))}` +
11
+ `&redirect_uri=${encodeURIComponent(redirectUrls[0])}`);
12
+ }
13
+ function getStaticAuthAppInstallUrl({ targetAccountId, env, appId, }) {
14
+ const websiteOrigin = (0, urls_1.getHubSpotWebsiteOrigin)(env);
15
+ return `${websiteOrigin}/static-token/${targetAccountId}/authorize?appId=${appId}`;
16
+ }
@@ -16,9 +16,7 @@ export declare function setLogLevel(options: Arguments<{
16
16
  debug?: boolean;
17
17
  networkDebug?: boolean;
18
18
  }>): void;
19
- export declare function getCommandName(argv: Arguments<{
20
- _?: string[];
21
- }>): string;
19
+ export declare function getCommandName(argv: Arguments): string;
22
20
  export declare function getCmsPublishMode(options: Arguments<{
23
21
  cmsPublishMode?: CmsPublishMode;
24
22
  derivedAccountId?: number;
package/lib/commonOpts.js CHANGED
@@ -138,7 +138,7 @@ function setLogLevel(options) {
138
138
  }
139
139
  }
140
140
  function getCommandName(argv) {
141
- return (argv && argv._ && argv._[0]) || '';
141
+ return String(argv && argv._ && argv._[0]) || '';
142
142
  }
143
143
  function getCmsPublishMode(options) {
144
144
  // 1. --cmsPublishMode
@@ -1,2 +1,2 @@
1
- export declare function handleMigration(accountId: number | undefined, configPath?: string): Promise<boolean>;
2
- export declare function handleMerge(accountId: number | undefined, configPath?: string, force?: boolean): Promise<boolean>;
1
+ export declare function handleMigration(deprecatedConfigPath?: string, hideWarning?: boolean): Promise<boolean>;
2
+ export declare function handleMerge(deprecatedConfigPath?: string, force?: boolean, hideWarning?: boolean): Promise<boolean>;