@hubspot/cli 8.0.10-experimental.7 → 8.0.11-experimental.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/__tests__/migrate.test.d.ts +1 -0
- package/api/__tests__/migrate.test.js +199 -0
- package/commands/__tests__/account.test.d.ts +1 -0
- package/commands/__tests__/account.test.js +69 -0
- package/commands/__tests__/auth.test.d.ts +1 -0
- package/commands/__tests__/auth.test.js +43 -0
- package/commands/__tests__/cms.test.d.ts +1 -0
- package/commands/__tests__/cms.test.js +87 -0
- package/commands/__tests__/config.test.d.ts +1 -0
- package/commands/__tests__/config.test.js +44 -0
- package/commands/__tests__/customObject.test.d.ts +1 -0
- package/commands/__tests__/customObject.test.js +68 -0
- package/commands/__tests__/doctor.test.d.ts +1 -0
- package/commands/__tests__/doctor.test.js +132 -0
- package/commands/__tests__/feedback.test.d.ts +1 -0
- package/commands/__tests__/feedback.test.js +24 -0
- package/commands/__tests__/filemanager.test.d.ts +1 -0
- package/commands/__tests__/filemanager.test.js +45 -0
- package/commands/__tests__/getStarted.test.d.ts +1 -0
- package/commands/__tests__/getStarted.test.js +173 -0
- package/commands/__tests__/hubdb.test.d.ts +1 -0
- package/commands/__tests__/hubdb.test.js +50 -0
- package/commands/__tests__/init.test.d.ts +1 -0
- package/commands/__tests__/init.test.js +42 -0
- package/commands/__tests__/mcp.test.d.ts +1 -0
- package/commands/__tests__/mcp.test.js +46 -0
- package/commands/__tests__/open.test.d.ts +1 -0
- package/commands/__tests__/open.test.js +58 -0
- package/commands/__tests__/project.test.d.ts +1 -0
- package/commands/__tests__/project.test.js +125 -0
- package/commands/__tests__/sandbox.test.d.ts +1 -0
- package/commands/__tests__/sandbox.test.js +44 -0
- package/commands/__tests__/secret.test.d.ts +1 -0
- package/commands/__tests__/secret.test.js +49 -0
- package/commands/__tests__/testAccount.test.d.ts +1 -0
- package/commands/__tests__/testAccount.test.js +57 -0
- package/commands/__tests__/upgrade.test.d.ts +1 -0
- package/commands/__tests__/upgrade.test.js +309 -0
- package/commands/account/__tests__/auth.test.d.ts +1 -0
- package/commands/account/__tests__/auth.test.js +206 -0
- package/commands/account/__tests__/clean.test.d.ts +1 -0
- package/commands/account/__tests__/clean.test.js +28 -0
- package/commands/account/__tests__/createOverride.test.d.ts +1 -0
- package/commands/account/__tests__/createOverride.test.js +32 -0
- package/commands/account/__tests__/info.test.d.ts +1 -0
- package/commands/account/__tests__/info.test.js +28 -0
- package/commands/account/__tests__/list.test.d.ts +1 -0
- package/commands/account/__tests__/list.test.js +153 -0
- package/commands/account/__tests__/remove.test.d.ts +1 -0
- package/commands/account/__tests__/remove.test.js +36 -0
- package/commands/account/__tests__/removeOverride.d.ts +1 -0
- package/commands/account/__tests__/removeOverride.js +25 -0
- package/commands/account/__tests__/rename.test.d.ts +1 -0
- package/commands/account/__tests__/rename.test.js +82 -0
- package/commands/account/__tests__/use.test.d.ts +1 -0
- package/commands/account/__tests__/use.test.js +170 -0
- package/commands/app/__tests__/migrate.test.d.ts +1 -0
- package/commands/app/__tests__/migrate.test.js +111 -0
- package/commands/app/secret/__tests__/add.test.d.ts +1 -0
- package/commands/app/secret/__tests__/add.test.js +140 -0
- package/commands/app/secret/__tests__/delete.test.d.ts +1 -0
- package/commands/app/secret/__tests__/delete.test.js +28 -0
- package/commands/app/secret/__tests__/list.test.d.ts +1 -0
- package/commands/app/secret/__tests__/list.test.js +25 -0
- package/commands/app/secret/__tests__/update.test.d.ts +1 -0
- package/commands/app/secret/__tests__/update.test.js +28 -0
- package/commands/cms/__tests__/delete.test.d.ts +1 -0
- package/commands/cms/__tests__/delete.test.js +39 -0
- package/commands/cms/__tests__/fetch.test.d.ts +1 -0
- package/commands/cms/__tests__/fetch.test.js +156 -0
- package/commands/cms/__tests__/function.test.d.ts +1 -0
- package/commands/cms/__tests__/function.test.js +50 -0
- package/commands/cms/__tests__/lint.test.d.ts +1 -0
- package/commands/cms/__tests__/lint.test.js +33 -0
- package/commands/cms/__tests__/list.test.d.ts +1 -0
- package/commands/cms/__tests__/list.test.js +42 -0
- package/commands/cms/__tests__/module.test.d.ts +1 -0
- package/commands/cms/__tests__/module.test.js +45 -0
- package/commands/cms/__tests__/mv.test.d.ts +1 -0
- package/commands/cms/__tests__/mv.test.js +46 -0
- package/commands/cms/__tests__/theme.test.d.ts +1 -0
- package/commands/cms/__tests__/theme.test.js +54 -0
- package/commands/cms/__tests__/upload.test.d.ts +1 -0
- package/commands/cms/__tests__/upload.test.js +312 -0
- package/commands/cms/__tests__/watch.test.d.ts +1 -0
- package/commands/cms/__tests__/watch.test.js +204 -0
- package/commands/cms/function/__tests__/logs.test.d.ts +1 -0
- package/commands/cms/function/__tests__/logs.test.js +70 -0
- package/commands/cms/theme/__tests__/generate-selectors.test.d.ts +1 -0
- package/commands/cms/theme/__tests__/generate-selectors.test.js +28 -0
- package/commands/cms/theme/__tests__/marketplace-validate.test.d.ts +1 -0
- package/commands/cms/theme/__tests__/marketplace-validate.test.js +36 -0
- package/commands/cms/theme/__tests__/preview.test.d.ts +1 -0
- package/commands/cms/theme/__tests__/preview.test.js +54 -0
- package/commands/customObject/__tests__/create.test.d.ts +1 -0
- package/commands/customObject/__tests__/create.test.js +40 -0
- package/commands/customObject/__tests__/createSchema.test.d.ts +1 -0
- package/commands/customObject/__tests__/createSchema.test.js +28 -0
- package/commands/customObject/__tests__/deleteSchema.test.d.ts +1 -0
- package/commands/customObject/__tests__/deleteSchema.test.js +42 -0
- package/commands/customObject/__tests__/fetch-all-schemas.test.d.ts +1 -0
- package/commands/customObject/__tests__/fetch-all-schemas.test.js +41 -0
- package/commands/customObject/__tests__/fetchSchema.test.d.ts +1 -0
- package/commands/customObject/__tests__/fetchSchema.test.js +45 -0
- package/commands/customObject/__tests__/listSchemas.test.d.ts +1 -0
- package/commands/customObject/__tests__/listSchemas.test.js +29 -0
- package/commands/customObject/__tests__/updateSchema.test.d.ts +1 -0
- package/commands/customObject/__tests__/updateSchema.test.js +40 -0
- package/commands/filemanager/__tests__/fetch.test.d.ts +1 -0
- package/commands/filemanager/__tests__/fetch.test.js +32 -0
- package/commands/filemanager/__tests__/upload.test.d.ts +1 -0
- package/commands/filemanager/__tests__/upload.test.js +191 -0
- package/commands/hubdb/__tests__/clear.test.d.ts +1 -0
- package/commands/hubdb/__tests__/clear.test.js +28 -0
- package/commands/hubdb/__tests__/create.test.d.ts +1 -0
- package/commands/hubdb/__tests__/create.test.js +28 -0
- package/commands/hubdb/__tests__/delete.test.d.ts +1 -0
- package/commands/hubdb/__tests__/delete.test.js +28 -0
- package/commands/hubdb/__tests__/fetch.test.d.ts +1 -0
- package/commands/hubdb/__tests__/fetch.test.js +28 -0
- package/commands/hubdb/__tests__/list.test.d.ts +1 -0
- package/commands/hubdb/__tests__/list.test.js +88 -0
- package/commands/mcp/__tests__/setup.test.d.ts +1 -0
- package/commands/mcp/__tests__/setup.test.js +26 -0
- package/commands/mcp/__tests__/start.test.d.ts +1 -0
- package/commands/mcp/__tests__/start.test.js +144 -0
- package/commands/project/__tests__/add.test.d.ts +1 -0
- package/commands/project/__tests__/add.test.js +107 -0
- package/commands/project/__tests__/create.test.d.ts +1 -0
- package/commands/project/__tests__/create.test.js +97 -0
- package/commands/project/__tests__/deploy.test.d.ts +1 -0
- package/commands/project/__tests__/deploy.test.js +307 -0
- package/commands/project/__tests__/dev.test.d.ts +1 -0
- package/commands/project/__tests__/dev.test.js +273 -0
- package/commands/project/__tests__/devUnifiedFlow.test.d.ts +1 -0
- package/commands/project/__tests__/devUnifiedFlow.test.js +434 -0
- package/commands/project/__tests__/download.test.d.ts +1 -0
- package/commands/project/__tests__/download.test.js +39 -0
- package/commands/project/__tests__/info.test.d.ts +1 -0
- package/commands/project/__tests__/info.test.js +145 -0
- package/commands/project/__tests__/installDeps.test.d.ts +1 -0
- package/commands/project/__tests__/installDeps.test.js +140 -0
- package/commands/project/__tests__/lint.test.d.ts +1 -0
- package/commands/project/__tests__/lint.test.js +704 -0
- package/commands/project/__tests__/list.test.d.ts +1 -0
- package/commands/project/__tests__/list.test.js +31 -0
- package/commands/project/__tests__/listBuilds.test.d.ts +1 -0
- package/commands/project/__tests__/listBuilds.test.js +38 -0
- package/commands/project/__tests__/logs.test.d.ts +1 -0
- package/commands/project/__tests__/logs.test.js +202 -0
- package/commands/project/__tests__/migrate.test.d.ts +1 -0
- package/commands/project/__tests__/migrate.test.js +106 -0
- package/commands/project/__tests__/open.test.d.ts +1 -0
- package/commands/project/__tests__/open.test.js +39 -0
- package/commands/project/__tests__/profile.test.d.ts +1 -0
- package/commands/project/__tests__/profile.test.js +42 -0
- package/commands/project/__tests__/updateDeps.test.d.ts +1 -0
- package/commands/project/__tests__/updateDeps.test.js +140 -0
- package/commands/project/__tests__/upload.test.d.ts +1 -0
- package/commands/project/__tests__/upload.test.js +234 -0
- package/commands/project/__tests__/validate.test.d.ts +1 -0
- package/commands/project/__tests__/validate.test.js +381 -0
- package/commands/project/__tests__/watch.test.d.ts +1 -0
- package/commands/project/__tests__/watch.test.js +35 -0
- package/commands/project/info.d.ts +4 -0
- package/commands/project/info.js +67 -0
- package/commands/project.js +2 -0
- package/commands/sandbox/__tests__/create.test.d.ts +1 -0
- package/commands/sandbox/__tests__/create.test.js +198 -0
- package/commands/sandbox/__tests__/delete.test.d.ts +1 -0
- package/commands/sandbox/__tests__/delete.test.js +31 -0
- package/commands/secret/__tests__/addSecret.test.d.ts +1 -0
- package/commands/secret/__tests__/addSecret.test.js +162 -0
- package/commands/secret/__tests__/deleteSecret.test.d.ts +1 -0
- package/commands/secret/__tests__/deleteSecret.test.js +41 -0
- package/commands/secret/__tests__/listSecret.test.d.ts +1 -0
- package/commands/secret/__tests__/listSecret.test.js +29 -0
- package/commands/secret/__tests__/updateSecret.test.d.ts +1 -0
- package/commands/secret/__tests__/updateSecret.test.js +29 -0
- package/commands/testAccount/__tests__/create.test.d.ts +1 -0
- package/commands/testAccount/__tests__/create.test.js +106 -0
- package/commands/testAccount/__tests__/createConfig.test.d.ts +1 -0
- package/commands/testAccount/__tests__/createConfig.test.js +32 -0
- package/commands/testAccount/__tests__/delete.test.d.ts +1 -0
- package/commands/testAccount/__tests__/delete.test.js +29 -0
- package/commands/testAccount/__tests__/importData.test.d.ts +1 -0
- package/commands/testAccount/__tests__/importData.test.js +92 -0
- package/lang/en.d.ts +31 -0
- package/lang/en.js +31 -0
- package/lib/__tests__/CLIWebSocketServer.test.d.ts +1 -0
- package/lib/__tests__/CLIWebSocketServer.test.js +252 -0
- package/lib/__tests__/accountAuth.test.d.ts +1 -0
- package/lib/__tests__/accountAuth.test.js +258 -0
- package/lib/__tests__/accountTypes.test.d.ts +1 -0
- package/lib/__tests__/accountTypes.test.js +98 -0
- package/lib/__tests__/buildAccount.test.d.ts +1 -0
- package/lib/__tests__/buildAccount.test.js +211 -0
- package/lib/__tests__/cliUpgradeUtils.test.d.ts +1 -0
- package/lib/__tests__/cliUpgradeUtils.test.js +131 -0
- package/lib/__tests__/commandSuggestion.test.d.ts +1 -0
- package/lib/__tests__/commandSuggestion.test.js +121 -0
- package/lib/__tests__/commonOpts.test.d.ts +1 -0
- package/lib/__tests__/commonOpts.test.js +80 -0
- package/lib/__tests__/dependencyManagement.test.d.ts +1 -0
- package/lib/__tests__/dependencyManagement.test.js +1067 -0
- package/lib/__tests__/developerTestAccounts.test.d.ts +1 -0
- package/lib/__tests__/developerTestAccounts.test.js +156 -0
- package/lib/__tests__/hasFeature.test.d.ts +1 -0
- package/lib/__tests__/hasFeature.test.js +167 -0
- package/lib/__tests__/http.test.d.ts +1 -0
- package/lib/__tests__/http.test.js +40 -0
- package/lib/__tests__/importData.test.d.ts +1 -0
- package/lib/__tests__/importData.test.js +98 -0
- package/lib/__tests__/npmCli.test.d.ts +1 -0
- package/lib/__tests__/npmCli.test.js +84 -0
- package/lib/__tests__/oauth.test.d.ts +1 -0
- package/lib/__tests__/oauth.test.js +109 -0
- package/lib/__tests__/parsing.test.d.ts +1 -0
- package/lib/__tests__/parsing.test.js +34 -0
- package/lib/__tests__/polling.test.d.ts +1 -0
- package/lib/__tests__/polling.test.js +76 -0
- package/lib/__tests__/process.test.d.ts +1 -0
- package/lib/__tests__/process.test.js +89 -0
- package/lib/__tests__/sandboxes.test.d.ts +1 -0
- package/lib/__tests__/sandboxes.test.js +128 -0
- package/lib/__tests__/serverlessLogs.test.d.ts +1 -0
- package/lib/__tests__/serverlessLogs.test.js +163 -0
- package/lib/__tests__/usageTracking.test.d.ts +1 -0
- package/lib/__tests__/usageTracking.test.js +197 -0
- package/lib/__tests__/validation.test.d.ts +1 -0
- package/lib/__tests__/validation.test.js +143 -0
- package/lib/__tests__/yargsUtils.test.d.ts +1 -0
- package/lib/__tests__/yargsUtils.test.js +124 -0
- package/lib/app/__tests__/migrate.test.d.ts +1 -0
- package/lib/app/__tests__/migrate.test.js +638 -0
- package/lib/doctor/__tests__/Diagnosis.test.d.ts +1 -0
- package/lib/doctor/__tests__/Diagnosis.test.js +84 -0
- package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.d.ts +1 -0
- package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.js +177 -0
- package/lib/doctor/__tests__/Doctor.test.d.ts +1 -0
- package/lib/doctor/__tests__/Doctor.test.js +560 -0
- package/lib/errorHandlers/__tests__/index.test.d.ts +1 -0
- package/lib/errorHandlers/__tests__/index.test.js +278 -0
- package/lib/mcp/__tests__/setup.test.d.ts +1 -0
- package/lib/mcp/__tests__/setup.test.js +523 -0
- package/lib/middleware/__tests__/commandTargetingUtils.test.d.ts +1 -0
- package/lib/middleware/__tests__/commandTargetingUtils.test.js +99 -0
- package/lib/middleware/__tests__/configMiddleware.test.d.ts +1 -0
- package/lib/middleware/__tests__/configMiddleware.test.js +118 -0
- package/lib/middleware/__tests__/gitMiddleware.test.d.ts +1 -0
- package/lib/middleware/__tests__/gitMiddleware.test.js +43 -0
- package/lib/middleware/__tests__/requestMiddleware.test.d.ts +1 -0
- package/lib/middleware/__tests__/requestMiddleware.test.js +15 -0
- package/lib/middleware/__tests__/usageTrackingMiddleware.test.d.ts +1 -0
- package/lib/middleware/__tests__/usageTrackingMiddleware.test.js +44 -0
- package/lib/middleware/__tests__/yargsChecksMiddleware.test.d.ts +1 -0
- package/lib/middleware/__tests__/yargsChecksMiddleware.test.js +39 -0
- package/lib/projects/__tests__/AppDevModeInterface.test.d.ts +1 -0
- package/lib/projects/__tests__/AppDevModeInterface.test.js +541 -0
- package/lib/projects/__tests__/DevServerManager.test.d.ts +1 -0
- package/lib/projects/__tests__/DevServerManager.test.js +185 -0
- package/lib/projects/__tests__/DevSessionManager.test.d.ts +1 -0
- package/lib/projects/__tests__/DevSessionManager.test.js +250 -0
- package/lib/projects/__tests__/LocalDevProcess.test.d.ts +1 -0
- package/lib/projects/__tests__/LocalDevProcess.test.js +481 -0
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.d.ts +1 -0
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +231 -0
- package/lib/projects/__tests__/ProjectLogsManager.test.d.ts +1 -0
- package/lib/projects/__tests__/ProjectLogsManager.test.js +302 -0
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.d.ts +1 -0
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.js +160 -0
- package/lib/projects/__tests__/components.test.d.ts +1 -0
- package/lib/projects/__tests__/components.test.js +440 -0
- package/lib/projects/__tests__/deploy.test.d.ts +1 -0
- package/lib/projects/__tests__/deploy.test.js +231 -0
- package/lib/projects/__tests__/localDevProjectHelpers.test.d.ts +1 -0
- package/lib/projects/__tests__/localDevProjectHelpers.test.js +120 -0
- package/lib/projects/__tests__/platformVersion.test.d.ts +1 -0
- package/lib/projects/__tests__/platformVersion.test.js +63 -0
- package/lib/projects/__tests__/pollProjectBuildAndDeploy.test.d.ts +1 -0
- package/lib/projects/__tests__/pollProjectBuildAndDeploy.test.js +328 -0
- package/lib/projects/__tests__/projectInfo.test.d.ts +1 -0
- package/lib/projects/__tests__/projectInfo.test.js +114 -0
- package/lib/projects/__tests__/projectProfiles.test.d.ts +1 -0
- package/lib/projects/__tests__/projectProfiles.test.js +441 -0
- package/lib/projects/__tests__/projects.test.d.ts +1 -0
- package/lib/projects/__tests__/projects.test.js +58 -0
- package/lib/projects/__tests__/structure.test.d.ts +1 -0
- package/lib/projects/__tests__/structure.test.js +210 -0
- package/lib/projects/__tests__/uieLinting.test.d.ts +1 -0
- package/lib/projects/__tests__/uieLinting.test.js +631 -0
- package/lib/projects/__tests__/upload.test.d.ts +1 -0
- package/lib/projects/__tests__/upload.test.js +183 -0
- package/lib/projects/add/__tests__/legacyAddComponent.test.d.ts +1 -0
- package/lib/projects/add/__tests__/legacyAddComponent.test.js +245 -0
- package/lib/projects/add/__tests__/v2AddComponent.test.d.ts +1 -0
- package/lib/projects/add/__tests__/v2AddComponent.test.js +343 -0
- package/lib/projects/create/__tests__/legacy.test.d.ts +1 -0
- package/lib/projects/create/__tests__/legacy.test.js +72 -0
- package/lib/projects/create/__tests__/v2.test.d.ts +1 -0
- package/lib/projects/create/__tests__/v2.test.js +257 -0
- package/lib/projects/projectInfo.d.ts +22 -0
- package/lib/projects/projectInfo.js +104 -0
- package/lib/prompts/__tests__/createDeveloperTestAccountConfigPrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/createDeveloperTestAccountConfigPrompt.test.js +157 -0
- package/lib/prompts/__tests__/createFunctionPrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/createFunctionPrompt.test.js +129 -0
- package/lib/prompts/__tests__/createModulePrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/createModulePrompt.test.js +187 -0
- package/lib/prompts/__tests__/createTemplatePrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/createTemplatePrompt.test.js +102 -0
- package/lib/prompts/__tests__/downloadProjectPrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/downloadProjectPrompt.test.js +31 -0
- package/lib/prompts/__tests__/projectAddPrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/projectAddPrompt.test.js +143 -0
- package/lib/prompts/__tests__/projectsLogsPrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/projectsLogsPrompt.test.js +37 -0
- package/lib/prompts/__tests__/selectProjectTemplatePrompt.test.d.ts +1 -0
- package/lib/prompts/__tests__/selectProjectTemplatePrompt.test.js +160 -0
- package/lib/theme/__tests__/migrate.test.d.ts +1 -0
- package/lib/theme/__tests__/migrate.test.js +247 -0
- package/lib/ui/__tests__/SpinniesManager.test.d.ts +1 -0
- package/lib/ui/__tests__/SpinniesManager.test.js +488 -0
- package/lib/ui/__tests__/removeAnsiCodes.test.d.ts +1 -0
- package/lib/ui/__tests__/removeAnsiCodes.test.js +84 -0
- package/mcp-server/tools/cms/HsCreateTemplateTool.d.ts +1 -1
- package/mcp-server/tools/cms/__tests__/HsCreateFunctionTool.test.d.ts +1 -0
- package/mcp-server/tools/cms/__tests__/HsCreateFunctionTool.test.js +254 -0
- package/mcp-server/tools/cms/__tests__/HsCreateModuleTool.test.d.ts +1 -0
- package/mcp-server/tools/cms/__tests__/HsCreateModuleTool.test.js +227 -0
- package/mcp-server/tools/cms/__tests__/HsCreateTemplateTool.test.d.ts +1 -0
- package/mcp-server/tools/cms/__tests__/HsCreateTemplateTool.test.js +208 -0
- package/mcp-server/tools/cms/__tests__/HsFunctionLogsTool.test.d.ts +1 -0
- package/mcp-server/tools/cms/__tests__/HsFunctionLogsTool.test.js +186 -0
- package/mcp-server/tools/cms/__tests__/HsListFunctionsTool.test.d.ts +1 -0
- package/mcp-server/tools/cms/__tests__/HsListFunctionsTool.test.js +124 -0
- package/mcp-server/tools/cms/__tests__/HsListTool.test.d.ts +1 -0
- package/mcp-server/tools/cms/__tests__/HsListTool.test.js +124 -0
- package/mcp-server/tools/project/__tests__/AddFeatureToProjectTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/AddFeatureToProjectTool.test.js +157 -0
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +131 -0
- package/mcp-server/tools/project/__tests__/CreateTestAccountTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/CreateTestAccountTool.test.js +461 -0
- package/mcp-server/tools/project/__tests__/DeployProjectTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/DeployProjectTool.test.js +125 -0
- package/mcp-server/tools/project/__tests__/DocFetchTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/DocFetchTool.test.js +125 -0
- package/mcp-server/tools/project/__tests__/DocsSearchTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/DocsSearchTool.test.js +210 -0
- package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.js +146 -0
- package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.js +124 -0
- package/mcp-server/tools/project/__tests__/GetBuildLogsTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetBuildLogsTool.test.js +307 -0
- package/mcp-server/tools/project/__tests__/GetBuildStatusTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetBuildStatusTool.test.js +242 -0
- package/mcp-server/tools/project/__tests__/GetConfigValuesTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetConfigValuesTool.test.js +209 -0
- package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.js +158 -0
- package/mcp-server/tools/project/__tests__/UploadProjectTools.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +187 -0
- package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.js +118 -0
- package/mcp-server/utils/__tests__/command.test.d.ts +1 -0
- package/mcp-server/utils/__tests__/command.test.js +275 -0
- package/mcp-server/utils/__tests__/content.test.d.ts +1 -0
- package/mcp-server/utils/__tests__/content.test.js +164 -0
- package/mcp-server/utils/__tests__/feedbackTracking.test.d.ts +1 -0
- package/mcp-server/utils/__tests__/feedbackTracking.test.js +69 -0
- package/package.json +2 -6
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import accountCreateOverrideCommand from '../createOverride.js';
|
|
3
|
+
const positionalSpy = vi
|
|
4
|
+
.spyOn(yargs, 'positional')
|
|
5
|
+
.mockReturnValue(yargs);
|
|
6
|
+
const exampleSpy = vi
|
|
7
|
+
.spyOn(yargs, 'example')
|
|
8
|
+
.mockReturnValue(yargs);
|
|
9
|
+
describe('commands/account/createOverride', () => {
|
|
10
|
+
const yargsMock = yargs;
|
|
11
|
+
describe('command', () => {
|
|
12
|
+
it('should have the correct command structure', () => {
|
|
13
|
+
expect(accountCreateOverrideCommand.command).toEqual('create-override [account]');
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
describe('describe', () => {
|
|
17
|
+
it('should provide a description', () => {
|
|
18
|
+
expect(accountCreateOverrideCommand.describe).toBeDefined();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe('builder', () => {
|
|
22
|
+
it('should support the correct options', () => {
|
|
23
|
+
accountCreateOverrideCommand.builder(yargsMock);
|
|
24
|
+
expect(exampleSpy).toHaveBeenCalledTimes(1);
|
|
25
|
+
expect(positionalSpy).toHaveBeenCalledTimes(1);
|
|
26
|
+
expect(positionalSpy).toHaveBeenCalledWith('account', {
|
|
27
|
+
describe: expect.any(String),
|
|
28
|
+
type: 'string',
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import { addConfigOptions } from '../../../lib/commonOpts.js';
|
|
3
|
+
import accountInfoCommand from '../info.js';
|
|
4
|
+
vi.mock('../../../lib/commonOpts');
|
|
5
|
+
const exampleSpy = vi
|
|
6
|
+
.spyOn(yargs, 'example')
|
|
7
|
+
.mockReturnValue(yargs);
|
|
8
|
+
describe('commands/account/info', () => {
|
|
9
|
+
const yargsMock = yargs;
|
|
10
|
+
describe('command', () => {
|
|
11
|
+
it('should have the correct command structure', () => {
|
|
12
|
+
expect(accountInfoCommand.command).toEqual('info [account]');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
describe('describe', () => {
|
|
16
|
+
it('should provide a description', () => {
|
|
17
|
+
expect(accountInfoCommand.describe).toBeDefined();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
describe('builder', () => {
|
|
21
|
+
it('should support the correct options', () => {
|
|
22
|
+
accountInfoCommand.builder(yargsMock);
|
|
23
|
+
expect(exampleSpy).toHaveBeenCalledTimes(1);
|
|
24
|
+
expect(addConfigOptions).toHaveBeenCalledTimes(1);
|
|
25
|
+
expect(addConfigOptions).toHaveBeenCalledWith(yargsMock);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import yargs from 'yargs';
|
|
3
|
+
import * as configLib from '@hubspot/local-dev-lib/config';
|
|
4
|
+
import * as defaultAccountOverrideLib from '@hubspot/local-dev-lib/config/defaultAccountOverride';
|
|
5
|
+
import { HUBSPOT_ACCOUNT_TYPES } from '@hubspot/local-dev-lib/constants/config';
|
|
6
|
+
import * as commonOpts from '../../../lib/commonOpts.js';
|
|
7
|
+
import * as usageTrackingLib from '../../../lib/usageTracking.js';
|
|
8
|
+
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
9
|
+
import accountListCommand from '../list.js';
|
|
10
|
+
vi.mock('../../../lib/commonOpts');
|
|
11
|
+
vi.mock('@hubspot/local-dev-lib/config');
|
|
12
|
+
vi.mock('@hubspot/local-dev-lib/config/defaultAccountOverride');
|
|
13
|
+
vi.mock('../../../lib/ui/index.js');
|
|
14
|
+
vi.mock('../../../lib/ui/table.js');
|
|
15
|
+
const getConfigFilePathSpy = vi.spyOn(configLib, 'getConfigFilePath');
|
|
16
|
+
const getAllConfigAccountsSpy = vi.spyOn(configLib, 'getAllConfigAccounts');
|
|
17
|
+
const getConfigDefaultAccountIfExistsSpy = vi.spyOn(configLib, 'getConfigDefaultAccountIfExists');
|
|
18
|
+
const getDefaultAccountOverrideFilePathSpy = vi.spyOn(defaultAccountOverrideLib, 'getDefaultAccountOverrideFilePath');
|
|
19
|
+
const trackCommandUsageSpy = vi.spyOn(usageTrackingLib, 'trackCommandUsage');
|
|
20
|
+
const exampleSpy = vi
|
|
21
|
+
.spyOn(yargs, 'example')
|
|
22
|
+
.mockReturnValue(yargs);
|
|
23
|
+
describe('commands/account/list', () => {
|
|
24
|
+
const yargsMock = yargs;
|
|
25
|
+
beforeEach(() => {
|
|
26
|
+
getConfigFilePathSpy.mockReturnValue('/test/.hscli.config.yaml');
|
|
27
|
+
getAllConfigAccountsSpy.mockReturnValue([]);
|
|
28
|
+
getConfigDefaultAccountIfExistsSpy.mockReturnValue(undefined);
|
|
29
|
+
getDefaultAccountOverrideFilePathSpy.mockReturnValue(null);
|
|
30
|
+
trackCommandUsageSpy.mockImplementation(async () => { });
|
|
31
|
+
});
|
|
32
|
+
describe('command', () => {
|
|
33
|
+
it('should have the correct command structure', () => {
|
|
34
|
+
expect(accountListCommand.command).toEqual(['list', 'ls']);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
describe('describe', () => {
|
|
38
|
+
it('should provide a description', () => {
|
|
39
|
+
expect(accountListCommand.describe).toBeDefined();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
describe('builder', () => {
|
|
43
|
+
it('should support the correct options', () => {
|
|
44
|
+
accountListCommand.builder(yargsMock);
|
|
45
|
+
expect(exampleSpy).toHaveBeenCalledTimes(1);
|
|
46
|
+
expect(commonOpts.addConfigOptions).toHaveBeenCalledTimes(1);
|
|
47
|
+
expect(commonOpts.addConfigOptions).toHaveBeenCalledWith(yargsMock);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
describe('handler', () => {
|
|
51
|
+
let args;
|
|
52
|
+
beforeEach(() => {
|
|
53
|
+
args = {
|
|
54
|
+
derivedAccountId: 123456,
|
|
55
|
+
d: false,
|
|
56
|
+
debug: false,
|
|
57
|
+
_: [],
|
|
58
|
+
$0: '',
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
it('should track command usage', async () => {
|
|
62
|
+
await accountListCommand.handler(args);
|
|
63
|
+
expect(trackCommandUsageSpy).toHaveBeenCalledWith('accounts-list', undefined, 123456);
|
|
64
|
+
});
|
|
65
|
+
it('should display accounts list when no default account', async () => {
|
|
66
|
+
const accounts = [
|
|
67
|
+
{
|
|
68
|
+
accountId: 111111,
|
|
69
|
+
name: 'Test Account 1',
|
|
70
|
+
authType: 'personalaccesskey',
|
|
71
|
+
accountType: HUBSPOT_ACCOUNT_TYPES.STANDARD,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
accountId: 222222,
|
|
75
|
+
name: 'Test Account 2',
|
|
76
|
+
authType: 'oauth2',
|
|
77
|
+
accountType: HUBSPOT_ACCOUNT_TYPES.STANDARD,
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
getAllConfigAccountsSpy.mockReturnValue(accounts);
|
|
81
|
+
await accountListCommand.handler(args);
|
|
82
|
+
expect(getAllConfigAccountsSpy).toHaveBeenCalled();
|
|
83
|
+
expect(uiLogger.log).toHaveBeenCalledWith(expect.stringContaining('Accounts'));
|
|
84
|
+
});
|
|
85
|
+
it('should display default account when present', async () => {
|
|
86
|
+
getConfigDefaultAccountIfExistsSpy.mockReturnValue({
|
|
87
|
+
accountId: 123456,
|
|
88
|
+
name: 'Default Account',
|
|
89
|
+
});
|
|
90
|
+
await accountListCommand.handler(args);
|
|
91
|
+
expect(getConfigDefaultAccountIfExistsSpy).toHaveBeenCalled();
|
|
92
|
+
expect(uiLogger.log).toHaveBeenCalled();
|
|
93
|
+
});
|
|
94
|
+
it('should display config file path when default account present', async () => {
|
|
95
|
+
getConfigDefaultAccountIfExistsSpy.mockReturnValue({
|
|
96
|
+
accountId: 123456,
|
|
97
|
+
});
|
|
98
|
+
await accountListCommand.handler(args);
|
|
99
|
+
expect(getConfigFilePathSpy).toHaveBeenCalled();
|
|
100
|
+
expect(uiLogger.log).toHaveBeenCalled();
|
|
101
|
+
});
|
|
102
|
+
it('should display override file path when present', async () => {
|
|
103
|
+
getConfigDefaultAccountIfExistsSpy.mockReturnValue({
|
|
104
|
+
accountId: 123456,
|
|
105
|
+
});
|
|
106
|
+
getDefaultAccountOverrideFilePathSpy.mockReturnValue('/test/override.yaml');
|
|
107
|
+
await accountListCommand.handler(args);
|
|
108
|
+
expect(getDefaultAccountOverrideFilePathSpy).toHaveBeenCalled();
|
|
109
|
+
expect(uiLogger.log).toHaveBeenCalled();
|
|
110
|
+
});
|
|
111
|
+
it('should group sandbox accounts under parent', async () => {
|
|
112
|
+
const accounts = [
|
|
113
|
+
{
|
|
114
|
+
accountId: 111111,
|
|
115
|
+
name: 'Parent Account',
|
|
116
|
+
authType: 'personalaccesskey',
|
|
117
|
+
accountType: HUBSPOT_ACCOUNT_TYPES.STANDARD,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
accountId: 222222,
|
|
121
|
+
name: 'Sandbox Account',
|
|
122
|
+
authType: 'personalaccesskey',
|
|
123
|
+
accountType: HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX,
|
|
124
|
+
parentAccountId: 111111,
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
getAllConfigAccountsSpy.mockReturnValue(accounts);
|
|
128
|
+
await accountListCommand.handler(args);
|
|
129
|
+
expect(getAllConfigAccountsSpy).toHaveBeenCalled();
|
|
130
|
+
expect(uiLogger.log).toHaveBeenCalled();
|
|
131
|
+
});
|
|
132
|
+
it('should display app developer accounts', async () => {
|
|
133
|
+
const accounts = [
|
|
134
|
+
{
|
|
135
|
+
accountId: 333333,
|
|
136
|
+
name: 'App Developer Account',
|
|
137
|
+
authType: 'personalaccesskey',
|
|
138
|
+
accountType: HUBSPOT_ACCOUNT_TYPES.APP_DEVELOPER,
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
getAllConfigAccountsSpy.mockReturnValue(accounts);
|
|
142
|
+
await accountListCommand.handler(args);
|
|
143
|
+
expect(getAllConfigAccountsSpy).toHaveBeenCalled();
|
|
144
|
+
expect(uiLogger.log).toHaveBeenCalled();
|
|
145
|
+
});
|
|
146
|
+
it('should handle empty accounts list', async () => {
|
|
147
|
+
getAllConfigAccountsSpy.mockReturnValue([]);
|
|
148
|
+
await accountListCommand.handler(args);
|
|
149
|
+
expect(getAllConfigAccountsSpy).toHaveBeenCalled();
|
|
150
|
+
expect(uiLogger.log).toHaveBeenCalled();
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import { addConfigOptions } from '../../../lib/commonOpts.js';
|
|
3
|
+
import accountRemoveCommand from '../remove.js';
|
|
4
|
+
vi.mock('../../../lib/commonOpts');
|
|
5
|
+
const positionalSpy = vi
|
|
6
|
+
.spyOn(yargs, 'positional')
|
|
7
|
+
.mockReturnValue(yargs);
|
|
8
|
+
const exampleSpy = vi
|
|
9
|
+
.spyOn(yargs, 'example')
|
|
10
|
+
.mockReturnValue(yargs);
|
|
11
|
+
describe('commands/account/remove', () => {
|
|
12
|
+
const yargsMock = yargs;
|
|
13
|
+
describe('command', () => {
|
|
14
|
+
it('should have the correct command structure', () => {
|
|
15
|
+
expect(accountRemoveCommand.command).toEqual('remove [account]');
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
describe('describe', () => {
|
|
19
|
+
it('should provide a description', () => {
|
|
20
|
+
expect(accountRemoveCommand.describe).toBeDefined();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe('builder', () => {
|
|
24
|
+
it('should support the correct options', () => {
|
|
25
|
+
accountRemoveCommand.builder(yargsMock);
|
|
26
|
+
expect(exampleSpy).toHaveBeenCalledTimes(1);
|
|
27
|
+
expect(positionalSpy).toHaveBeenCalledTimes(1);
|
|
28
|
+
expect(positionalSpy).toHaveBeenCalledWith('account', {
|
|
29
|
+
describe: expect.any(String),
|
|
30
|
+
type: 'string',
|
|
31
|
+
});
|
|
32
|
+
expect(addConfigOptions).toHaveBeenCalledTimes(1);
|
|
33
|
+
expect(addConfigOptions).toHaveBeenCalledWith(yargsMock);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import accountRemoveOverrideCommand from '../removeOverride.js';
|
|
3
|
+
vi.mock('yargs');
|
|
4
|
+
const optionsSpy = vi
|
|
5
|
+
.spyOn(yargs, 'options')
|
|
6
|
+
.mockReturnValue(yargs);
|
|
7
|
+
describe('commands/account/removeOverride', () => {
|
|
8
|
+
const yargsMock = yargs;
|
|
9
|
+
describe('command', () => {
|
|
10
|
+
it('should have the correct command structure', () => {
|
|
11
|
+
expect(accountRemoveOverrideCommand.command).toEqual('remove-override');
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
describe('describe', () => {
|
|
15
|
+
it('should provide a description', () => {
|
|
16
|
+
expect(accountRemoveOverrideCommand.describe).toBeDefined();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
describe('builder', () => {
|
|
20
|
+
it('should support the correct options', () => {
|
|
21
|
+
accountRemoveOverrideCommand.builder(yargsMock);
|
|
22
|
+
expect(optionsSpy).toHaveBeenCalledTimes(1);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import { addConfigOptions, addAccountOptions, } from '../../../lib/commonOpts.js';
|
|
3
|
+
import accountRenameCommand from '../rename.js';
|
|
4
|
+
import * as config from '@hubspot/local-dev-lib/config';
|
|
5
|
+
import { logError } from '../../../lib/errorHandlers/index.js';
|
|
6
|
+
import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
|
|
7
|
+
import * as usageTracking from '../../../lib/usageTracking.js';
|
|
8
|
+
vi.mock('../../../lib/commonOpts');
|
|
9
|
+
vi.mock('@hubspot/local-dev-lib/config');
|
|
10
|
+
vi.mock('../../../lib/errorHandlers/index.js');
|
|
11
|
+
const positionalSpy = vi
|
|
12
|
+
.spyOn(yargs, 'positional')
|
|
13
|
+
.mockReturnValue(yargs);
|
|
14
|
+
const exampleSpy = vi
|
|
15
|
+
.spyOn(yargs, 'example')
|
|
16
|
+
.mockReturnValue(yargs);
|
|
17
|
+
const renameAccountSpy = vi.spyOn(config, 'renameConfigAccount');
|
|
18
|
+
const processExitSpy = vi.spyOn(process, 'exit');
|
|
19
|
+
const trackCommandUsageSpy = vi.spyOn(usageTracking, 'trackCommandUsage');
|
|
20
|
+
describe('commands/account/rename', () => {
|
|
21
|
+
const yargsMock = yargs;
|
|
22
|
+
describe('command', () => {
|
|
23
|
+
it('should have the correct command structure', () => {
|
|
24
|
+
expect(accountRenameCommand.command).toEqual('rename <account-name> <new-name>');
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe('describe', () => {
|
|
28
|
+
it('should provide a description', () => {
|
|
29
|
+
expect(accountRenameCommand.describe).toBeDefined();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
describe('handler', () => {
|
|
33
|
+
let args;
|
|
34
|
+
beforeEach(() => {
|
|
35
|
+
renameAccountSpy.mockReturnValue(undefined);
|
|
36
|
+
processExitSpy.mockImplementation(() => {
|
|
37
|
+
throw new Error('process.exit called');
|
|
38
|
+
});
|
|
39
|
+
args = {
|
|
40
|
+
accountName: 'myExistingAccountName',
|
|
41
|
+
newName: 'myNewAccountName',
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
it('should rename the account', async () => {
|
|
45
|
+
await expect(accountRenameCommand.handler(args)).rejects.toThrow('process.exit called');
|
|
46
|
+
expect(trackCommandUsageSpy).toHaveBeenCalledWith('accounts-rename', undefined, undefined);
|
|
47
|
+
expect(renameAccountSpy).toHaveBeenCalledWith('myExistingAccountName', 'my-new-account-name');
|
|
48
|
+
expect(processExitSpy).toHaveBeenCalledWith(EXIT_CODES.SUCCESS);
|
|
49
|
+
});
|
|
50
|
+
it('should handle errors when renameAccount throws', async () => {
|
|
51
|
+
const error = new Error('Failed to rename account');
|
|
52
|
+
renameAccountSpy.mockImplementation(() => {
|
|
53
|
+
throw error;
|
|
54
|
+
});
|
|
55
|
+
await expect(accountRenameCommand.handler(args)).rejects.toThrow('process.exit called');
|
|
56
|
+
expect(trackCommandUsageSpy).toHaveBeenCalledWith('accounts-rename', undefined, undefined);
|
|
57
|
+
expect(renameAccountSpy).toHaveBeenCalledWith('myExistingAccountName', 'my-new-account-name');
|
|
58
|
+
expect(logError).toHaveBeenCalledTimes(1);
|
|
59
|
+
expect(logError).toHaveBeenCalledWith(error);
|
|
60
|
+
expect(processExitSpy).toHaveBeenCalledWith(EXIT_CODES.ERROR);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
describe('builder', () => {
|
|
64
|
+
it('should support the correct options', () => {
|
|
65
|
+
accountRenameCommand.builder(yargsMock);
|
|
66
|
+
expect(exampleSpy).toHaveBeenCalledTimes(1);
|
|
67
|
+
expect(positionalSpy).toHaveBeenCalledTimes(2);
|
|
68
|
+
expect(positionalSpy).toHaveBeenCalledWith('account-name', {
|
|
69
|
+
describe: expect.any(String),
|
|
70
|
+
type: 'string',
|
|
71
|
+
});
|
|
72
|
+
expect(positionalSpy).toHaveBeenCalledWith('new-name', {
|
|
73
|
+
describe: expect.any(String),
|
|
74
|
+
type: 'string',
|
|
75
|
+
});
|
|
76
|
+
expect(addConfigOptions).toHaveBeenCalledTimes(1);
|
|
77
|
+
expect(addConfigOptions).toHaveBeenCalledWith(yargsMock);
|
|
78
|
+
expect(addAccountOptions).toHaveBeenCalledTimes(1);
|
|
79
|
+
expect(addAccountOptions).toHaveBeenCalledWith(yargsMock);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import yargs from 'yargs';
|
|
3
|
+
import * as configLib from '@hubspot/local-dev-lib/config';
|
|
4
|
+
import * as defaultAccountOverrideLib from '@hubspot/local-dev-lib/config/defaultAccountOverride';
|
|
5
|
+
import * as usageTrackingLib from '../../../lib/usageTracking.js';
|
|
6
|
+
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
7
|
+
vi.mock('@hubspot/local-dev-lib/config');
|
|
8
|
+
vi.mock('@hubspot/local-dev-lib/config/defaultAccountOverride');
|
|
9
|
+
vi.mock('../../../lib/prompts/accountsPrompt.js');
|
|
10
|
+
// Import after mocks
|
|
11
|
+
import * as accountsPromptLib from '../../../lib/prompts/accountsPrompt.js';
|
|
12
|
+
import accountUseCommand from '../use.js';
|
|
13
|
+
const getConfigFilePathSpy = vi.spyOn(configLib, 'getConfigFilePath');
|
|
14
|
+
const getConfigAccountIfExistsSpy = vi.spyOn(configLib, 'getConfigAccountIfExists');
|
|
15
|
+
const getConfigAccountByNameSpy = vi.spyOn(configLib, 'getConfigAccountByName');
|
|
16
|
+
const getConfigAccountByIdSpy = vi.spyOn(configLib, 'getConfigAccountById');
|
|
17
|
+
const getAllConfigAccountsSpy = vi.spyOn(configLib, 'getAllConfigAccounts');
|
|
18
|
+
const setConfigAccountAsDefaultSpy = vi.spyOn(configLib, 'setConfigAccountAsDefault');
|
|
19
|
+
const getDefaultAccountOverrideAccountIdSpy = vi.spyOn(defaultAccountOverrideLib, 'getDefaultAccountOverrideAccountId');
|
|
20
|
+
const getDefaultAccountOverrideFilePathSpy = vi.spyOn(defaultAccountOverrideLib, 'getDefaultAccountOverrideFilePath');
|
|
21
|
+
const selectAccountFromConfigSpy = vi.spyOn(accountsPromptLib, 'selectAccountFromConfig');
|
|
22
|
+
const trackCommandUsageSpy = vi.spyOn(usageTrackingLib, 'trackCommandUsage');
|
|
23
|
+
const positionalSpy = vi
|
|
24
|
+
.spyOn(yargs, 'positional')
|
|
25
|
+
.mockReturnValue(yargs);
|
|
26
|
+
const exampleSpy = vi
|
|
27
|
+
.spyOn(yargs, 'example')
|
|
28
|
+
.mockReturnValue(yargs);
|
|
29
|
+
describe('commands/account/use', () => {
|
|
30
|
+
const yargsMock = yargs;
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
getConfigFilePathSpy.mockReturnValue('/test/.hscli.config.yaml');
|
|
33
|
+
getAllConfigAccountsSpy.mockReturnValue([]);
|
|
34
|
+
getDefaultAccountOverrideAccountIdSpy.mockReturnValue(null);
|
|
35
|
+
getDefaultAccountOverrideFilePathSpy.mockReturnValue(null);
|
|
36
|
+
trackCommandUsageSpy.mockImplementation(async () => { });
|
|
37
|
+
setConfigAccountAsDefaultSpy.mockImplementation(() => { });
|
|
38
|
+
});
|
|
39
|
+
describe('command', () => {
|
|
40
|
+
it('should have the correct command structure', () => {
|
|
41
|
+
expect(accountUseCommand.command).toEqual('use [account]');
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
describe('describe', () => {
|
|
45
|
+
it('should provide a description', () => {
|
|
46
|
+
expect(accountUseCommand.describe).toBeDefined();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
describe('builder', () => {
|
|
50
|
+
it('should support the correct options', () => {
|
|
51
|
+
accountUseCommand.builder(yargsMock);
|
|
52
|
+
expect(exampleSpy).toHaveBeenCalledTimes(1);
|
|
53
|
+
expect(positionalSpy).toHaveBeenCalledTimes(1);
|
|
54
|
+
expect(positionalSpy).toHaveBeenCalledWith('account', {
|
|
55
|
+
describe: expect.any(String),
|
|
56
|
+
type: 'string',
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
describe('handler', () => {
|
|
61
|
+
let args;
|
|
62
|
+
beforeEach(() => {
|
|
63
|
+
args = {
|
|
64
|
+
derivedAccountId: 0,
|
|
65
|
+
d: false,
|
|
66
|
+
debug: false,
|
|
67
|
+
_: [],
|
|
68
|
+
$0: '',
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
describe('with account ID', () => {
|
|
72
|
+
it('should set account by ID', async () => {
|
|
73
|
+
args.account = '123456';
|
|
74
|
+
const account = {
|
|
75
|
+
accountId: 123456,
|
|
76
|
+
name: 'Test Account',
|
|
77
|
+
};
|
|
78
|
+
getConfigAccountIfExistsSpy.mockReturnValue(account);
|
|
79
|
+
getConfigAccountByIdSpy.mockReturnValue(account);
|
|
80
|
+
await accountUseCommand.handler(args);
|
|
81
|
+
expect(getConfigAccountByIdSpy).toHaveBeenCalledWith(123456);
|
|
82
|
+
expect(setConfigAccountAsDefaultSpy).toHaveBeenCalledWith('123456');
|
|
83
|
+
expect(uiLogger.success).toHaveBeenCalled();
|
|
84
|
+
});
|
|
85
|
+
it('should track command usage', async () => {
|
|
86
|
+
args.account = '123456';
|
|
87
|
+
const account = {
|
|
88
|
+
accountId: 123456,
|
|
89
|
+
name: 'Test Account',
|
|
90
|
+
};
|
|
91
|
+
getConfigAccountIfExistsSpy.mockReturnValue(account);
|
|
92
|
+
getConfigAccountByIdSpy.mockReturnValue(account);
|
|
93
|
+
await accountUseCommand.handler(args);
|
|
94
|
+
expect(trackCommandUsageSpy).toHaveBeenCalledWith('accounts-use', undefined, 123456);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
describe('with account name', () => {
|
|
98
|
+
it('should set account by name', async () => {
|
|
99
|
+
args.account = 'MyAccount';
|
|
100
|
+
const account = {
|
|
101
|
+
accountId: 123456,
|
|
102
|
+
name: 'MyAccount',
|
|
103
|
+
};
|
|
104
|
+
getConfigAccountIfExistsSpy.mockReturnValue(account);
|
|
105
|
+
getConfigAccountByNameSpy.mockReturnValue(account);
|
|
106
|
+
await accountUseCommand.handler(args);
|
|
107
|
+
expect(getConfigAccountByNameSpy).toHaveBeenCalledWith('MyAccount');
|
|
108
|
+
expect(setConfigAccountAsDefaultSpy).toHaveBeenCalledWith('MyAccount');
|
|
109
|
+
expect(uiLogger.success).toHaveBeenCalled();
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
describe('account not found', () => {
|
|
113
|
+
it('should prompt when account not found', async () => {
|
|
114
|
+
args.account = 'InvalidAccount';
|
|
115
|
+
const account = {
|
|
116
|
+
accountId: 999999,
|
|
117
|
+
name: 'Selected Account',
|
|
118
|
+
};
|
|
119
|
+
getConfigAccountIfExistsSpy.mockReturnValue(undefined);
|
|
120
|
+
selectAccountFromConfigSpy.mockResolvedValue(999999);
|
|
121
|
+
getConfigAccountByIdSpy.mockReturnValue(account);
|
|
122
|
+
await accountUseCommand.handler(args);
|
|
123
|
+
expect(uiLogger.error).toHaveBeenCalled();
|
|
124
|
+
expect(selectAccountFromConfigSpy).toHaveBeenCalled();
|
|
125
|
+
expect(setConfigAccountAsDefaultSpy).toHaveBeenCalledWith('999999');
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
describe('without account argument', () => {
|
|
129
|
+
it('should prompt for account selection', async () => {
|
|
130
|
+
const account = {
|
|
131
|
+
accountId: 888888,
|
|
132
|
+
name: 'Prompted Account',
|
|
133
|
+
};
|
|
134
|
+
selectAccountFromConfigSpy.mockResolvedValue(888888);
|
|
135
|
+
getConfigAccountByIdSpy.mockReturnValue(account);
|
|
136
|
+
await accountUseCommand.handler(args);
|
|
137
|
+
expect(selectAccountFromConfigSpy).toHaveBeenCalled();
|
|
138
|
+
expect(setConfigAccountAsDefaultSpy).toHaveBeenCalledWith('888888');
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
describe('account override', () => {
|
|
142
|
+
it('should warn when account override is present', async () => {
|
|
143
|
+
args.account = '123456';
|
|
144
|
+
const account = {
|
|
145
|
+
accountId: 123456,
|
|
146
|
+
name: 'Test Account',
|
|
147
|
+
};
|
|
148
|
+
getConfigAccountIfExistsSpy.mockReturnValue(account);
|
|
149
|
+
getConfigAccountByIdSpy.mockReturnValue(account);
|
|
150
|
+
getDefaultAccountOverrideAccountIdSpy.mockReturnValue(777777);
|
|
151
|
+
getDefaultAccountOverrideFilePathSpy.mockReturnValue('/test/override.yaml');
|
|
152
|
+
getAllConfigAccountsSpy.mockReturnValue([account]);
|
|
153
|
+
await accountUseCommand.handler(args);
|
|
154
|
+
expect(getDefaultAccountOverrideAccountIdSpy).toHaveBeenCalled();
|
|
155
|
+
expect(uiLogger.warn).toHaveBeenCalled();
|
|
156
|
+
});
|
|
157
|
+
it('should not warn when no account override', async () => {
|
|
158
|
+
args.account = '123456';
|
|
159
|
+
const account = {
|
|
160
|
+
accountId: 123456,
|
|
161
|
+
name: 'Test Account',
|
|
162
|
+
};
|
|
163
|
+
getConfigAccountIfExistsSpy.mockReturnValue(account);
|
|
164
|
+
getConfigAccountByIdSpy.mockReturnValue(account);
|
|
165
|
+
await accountUseCommand.handler(args);
|
|
166
|
+
expect(uiLogger.warn).not.toHaveBeenCalled();
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
import { PLATFORM_VERSIONS } from '@hubspot/local-dev-lib/constants/projects';
|
|
3
|
+
import { uiLogger } from '../../../lib/ui/logger.js';
|
|
4
|
+
import { getConfigAccountById } from '@hubspot/local-dev-lib/config';
|
|
5
|
+
import { migrateApp } from '../../../lib/app/migrate.js';
|
|
6
|
+
import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
|
|
7
|
+
import migrateCommand from '../migrate.js';
|
|
8
|
+
vi.mock('@hubspot/local-dev-lib/config');
|
|
9
|
+
vi.mock('../../../lib/app/migrate');
|
|
10
|
+
vi.mock('../../../lib/projects/config.js');
|
|
11
|
+
const mockYargs = yargs;
|
|
12
|
+
const mockedGetConfigAccountById = getConfigAccountById;
|
|
13
|
+
const mockedmigrateApp = migrateApp;
|
|
14
|
+
const mockedUiLogger = uiLogger;
|
|
15
|
+
const optionsSpy = vi.spyOn(mockYargs, 'options');
|
|
16
|
+
const exampleSpy = vi.spyOn(mockYargs, 'example');
|
|
17
|
+
const exitSpy = vi
|
|
18
|
+
.spyOn(process, 'exit')
|
|
19
|
+
.mockImplementation(() => undefined);
|
|
20
|
+
describe('commands/app/migrate', () => {
|
|
21
|
+
const mockAccountId = 123;
|
|
22
|
+
const mockAccountConfig = {
|
|
23
|
+
accountId: mockAccountId,
|
|
24
|
+
name: 'Test Account',
|
|
25
|
+
env: 'prod',
|
|
26
|
+
authType: 'personalaccesskey',
|
|
27
|
+
personalAccessKey: 'test-key',
|
|
28
|
+
};
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
mockedGetConfigAccountById.mockReturnValue(mockAccountConfig);
|
|
31
|
+
exitSpy.mockClear();
|
|
32
|
+
});
|
|
33
|
+
afterEach(() => {
|
|
34
|
+
exitSpy.mockClear();
|
|
35
|
+
});
|
|
36
|
+
describe('handler', () => {
|
|
37
|
+
it('should exit with error when no account config is found', async () => {
|
|
38
|
+
mockedGetConfigAccountById.mockReturnValue(null);
|
|
39
|
+
await migrateCommand.handler({
|
|
40
|
+
derivedAccountId: mockAccountId,
|
|
41
|
+
});
|
|
42
|
+
expect(mockedUiLogger.error).toHaveBeenCalled();
|
|
43
|
+
expect(exitSpy).toHaveBeenCalledWith(EXIT_CODES.ERROR);
|
|
44
|
+
});
|
|
45
|
+
it('should call migrateApp for platform version 2025.2', async () => {
|
|
46
|
+
const options = {
|
|
47
|
+
derivedAccountId: mockAccountId,
|
|
48
|
+
platformVersion: PLATFORM_VERSIONS.v2025_2,
|
|
49
|
+
};
|
|
50
|
+
await migrateCommand.handler(options);
|
|
51
|
+
expect(mockedmigrateApp).toHaveBeenCalledWith(mockAccountId, options);
|
|
52
|
+
expect(exitSpy).toHaveBeenCalledWith(EXIT_CODES.SUCCESS);
|
|
53
|
+
});
|
|
54
|
+
it('should call migrateApp when unstable is true', async () => {
|
|
55
|
+
const options = {
|
|
56
|
+
derivedAccountId: mockAccountId,
|
|
57
|
+
unstable: true,
|
|
58
|
+
};
|
|
59
|
+
await migrateCommand.handler(options);
|
|
60
|
+
expect(mockedmigrateApp).toHaveBeenCalledWith(mockAccountId, options);
|
|
61
|
+
expect(exitSpy).toHaveBeenCalledWith(EXIT_CODES.SUCCESS);
|
|
62
|
+
});
|
|
63
|
+
it('should handle errors during migration', async () => {
|
|
64
|
+
const mockError = new Error('Migration failed');
|
|
65
|
+
mockedmigrateApp.mockRejectedValue(mockError);
|
|
66
|
+
await migrateCommand.handler({
|
|
67
|
+
derivedAccountId: mockAccountId,
|
|
68
|
+
platformVersion: PLATFORM_VERSIONS.v2025_2,
|
|
69
|
+
});
|
|
70
|
+
expect(mockedUiLogger.error).toHaveBeenCalled();
|
|
71
|
+
expect(exitSpy).toHaveBeenCalledWith(EXIT_CODES.ERROR);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
describe('builder', () => {
|
|
75
|
+
it('should add required options', async () => {
|
|
76
|
+
await migrateCommand.builder(mockYargs);
|
|
77
|
+
expect(optionsSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
78
|
+
name: expect.objectContaining({
|
|
79
|
+
type: 'string',
|
|
80
|
+
describe: expect.any(String),
|
|
81
|
+
}),
|
|
82
|
+
dest: expect.objectContaining({
|
|
83
|
+
type: 'string',
|
|
84
|
+
describe: expect.any(String),
|
|
85
|
+
}),
|
|
86
|
+
'app-id': expect.objectContaining({
|
|
87
|
+
type: 'number',
|
|
88
|
+
describe: expect.any(String),
|
|
89
|
+
}),
|
|
90
|
+
'platform-version': expect.objectContaining({
|
|
91
|
+
type: 'string',
|
|
92
|
+
default: '2026.03',
|
|
93
|
+
}),
|
|
94
|
+
}));
|
|
95
|
+
});
|
|
96
|
+
it('should set default platform version to 2025.2', async () => {
|
|
97
|
+
await migrateCommand.builder(mockYargs);
|
|
98
|
+
expect(optionsSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
99
|
+
'platform-version': expect.objectContaining({
|
|
100
|
+
default: '2026.03',
|
|
101
|
+
}),
|
|
102
|
+
}));
|
|
103
|
+
});
|
|
104
|
+
it('should add example command', async () => {
|
|
105
|
+
await migrateCommand.builder(mockYargs);
|
|
106
|
+
expect(exampleSpy).toHaveBeenCalledWith([
|
|
107
|
+
['$0 app migrate', expect.any(String)],
|
|
108
|
+
]);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|