@hubspot/cli 8.0.10-experimental.5 → 8.0.10-experimental.7
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/commands/getStarted.js +1 -1
- package/lang/en.js +1 -1
- package/lib/app/migrate.js +10 -5
- package/lib/getStartedV2Actions.js +1 -1
- package/lib/projects/components.js +3 -2
- package/lib/projects/create/v2.js +1 -1
- package/lib/ui/SpinniesManager.js +2 -0
- package/package.json +6 -2
- package/api/__tests__/migrate.test.d.ts +0 -1
- package/api/__tests__/migrate.test.js +0 -199
- package/commands/__tests__/account.test.d.ts +0 -1
- package/commands/__tests__/account.test.js +0 -69
- package/commands/__tests__/auth.test.d.ts +0 -1
- package/commands/__tests__/auth.test.js +0 -43
- package/commands/__tests__/cms.test.d.ts +0 -1
- package/commands/__tests__/cms.test.js +0 -87
- package/commands/__tests__/config.test.d.ts +0 -1
- package/commands/__tests__/config.test.js +0 -44
- package/commands/__tests__/customObject.test.d.ts +0 -1
- package/commands/__tests__/customObject.test.js +0 -68
- package/commands/__tests__/doctor.test.d.ts +0 -1
- package/commands/__tests__/doctor.test.js +0 -132
- package/commands/__tests__/feedback.test.d.ts +0 -1
- package/commands/__tests__/feedback.test.js +0 -24
- package/commands/__tests__/filemanager.test.d.ts +0 -1
- package/commands/__tests__/filemanager.test.js +0 -45
- package/commands/__tests__/getStarted.test.d.ts +0 -1
- package/commands/__tests__/getStarted.test.js +0 -173
- package/commands/__tests__/hubdb.test.d.ts +0 -1
- package/commands/__tests__/hubdb.test.js +0 -50
- package/commands/__tests__/init.test.d.ts +0 -1
- package/commands/__tests__/init.test.js +0 -42
- package/commands/__tests__/mcp.test.d.ts +0 -1
- package/commands/__tests__/mcp.test.js +0 -46
- package/commands/__tests__/open.test.d.ts +0 -1
- package/commands/__tests__/open.test.js +0 -58
- package/commands/__tests__/project.test.d.ts +0 -1
- package/commands/__tests__/project.test.js +0 -125
- package/commands/__tests__/sandbox.test.d.ts +0 -1
- package/commands/__tests__/sandbox.test.js +0 -44
- package/commands/__tests__/secret.test.d.ts +0 -1
- package/commands/__tests__/secret.test.js +0 -49
- package/commands/__tests__/testAccount.test.d.ts +0 -1
- package/commands/__tests__/testAccount.test.js +0 -57
- package/commands/__tests__/upgrade.test.d.ts +0 -1
- package/commands/__tests__/upgrade.test.js +0 -309
- package/commands/account/__tests__/auth.test.d.ts +0 -1
- package/commands/account/__tests__/auth.test.js +0 -206
- package/commands/account/__tests__/clean.test.d.ts +0 -1
- package/commands/account/__tests__/clean.test.js +0 -28
- package/commands/account/__tests__/createOverride.test.d.ts +0 -1
- package/commands/account/__tests__/createOverride.test.js +0 -32
- package/commands/account/__tests__/info.test.d.ts +0 -1
- package/commands/account/__tests__/info.test.js +0 -28
- package/commands/account/__tests__/list.test.d.ts +0 -1
- package/commands/account/__tests__/list.test.js +0 -153
- package/commands/account/__tests__/remove.test.d.ts +0 -1
- package/commands/account/__tests__/remove.test.js +0 -36
- package/commands/account/__tests__/removeOverride.d.ts +0 -1
- package/commands/account/__tests__/removeOverride.js +0 -25
- package/commands/account/__tests__/rename.test.d.ts +0 -1
- package/commands/account/__tests__/rename.test.js +0 -82
- package/commands/account/__tests__/use.test.d.ts +0 -1
- package/commands/account/__tests__/use.test.js +0 -170
- package/commands/app/__tests__/migrate.test.d.ts +0 -1
- package/commands/app/__tests__/migrate.test.js +0 -111
- package/commands/app/secret/__tests__/add.test.d.ts +0 -1
- package/commands/app/secret/__tests__/add.test.js +0 -140
- package/commands/app/secret/__tests__/delete.test.d.ts +0 -1
- package/commands/app/secret/__tests__/delete.test.js +0 -28
- package/commands/app/secret/__tests__/list.test.d.ts +0 -1
- package/commands/app/secret/__tests__/list.test.js +0 -25
- package/commands/app/secret/__tests__/update.test.d.ts +0 -1
- package/commands/app/secret/__tests__/update.test.js +0 -28
- package/commands/cms/__tests__/delete.test.d.ts +0 -1
- package/commands/cms/__tests__/delete.test.js +0 -39
- package/commands/cms/__tests__/fetch.test.d.ts +0 -1
- package/commands/cms/__tests__/fetch.test.js +0 -156
- package/commands/cms/__tests__/function.test.d.ts +0 -1
- package/commands/cms/__tests__/function.test.js +0 -50
- package/commands/cms/__tests__/lint.test.d.ts +0 -1
- package/commands/cms/__tests__/lint.test.js +0 -33
- package/commands/cms/__tests__/list.test.d.ts +0 -1
- package/commands/cms/__tests__/list.test.js +0 -42
- package/commands/cms/__tests__/module.test.d.ts +0 -1
- package/commands/cms/__tests__/module.test.js +0 -45
- package/commands/cms/__tests__/mv.test.d.ts +0 -1
- package/commands/cms/__tests__/mv.test.js +0 -46
- package/commands/cms/__tests__/theme.test.d.ts +0 -1
- package/commands/cms/__tests__/theme.test.js +0 -54
- package/commands/cms/__tests__/upload.test.d.ts +0 -1
- package/commands/cms/__tests__/upload.test.js +0 -312
- package/commands/cms/__tests__/watch.test.d.ts +0 -1
- package/commands/cms/__tests__/watch.test.js +0 -204
- package/commands/cms/function/__tests__/logs.test.d.ts +0 -1
- package/commands/cms/function/__tests__/logs.test.js +0 -70
- package/commands/cms/theme/__tests__/generate-selectors.test.d.ts +0 -1
- package/commands/cms/theme/__tests__/generate-selectors.test.js +0 -28
- package/commands/cms/theme/__tests__/marketplace-validate.test.d.ts +0 -1
- package/commands/cms/theme/__tests__/marketplace-validate.test.js +0 -36
- package/commands/cms/theme/__tests__/preview.test.d.ts +0 -1
- package/commands/cms/theme/__tests__/preview.test.js +0 -54
- package/commands/customObject/__tests__/create.test.d.ts +0 -1
- package/commands/customObject/__tests__/create.test.js +0 -40
- package/commands/customObject/__tests__/createSchema.test.d.ts +0 -1
- package/commands/customObject/__tests__/createSchema.test.js +0 -28
- package/commands/customObject/__tests__/deleteSchema.test.d.ts +0 -1
- package/commands/customObject/__tests__/deleteSchema.test.js +0 -42
- package/commands/customObject/__tests__/fetch-all-schemas.test.d.ts +0 -1
- package/commands/customObject/__tests__/fetch-all-schemas.test.js +0 -41
- package/commands/customObject/__tests__/fetchSchema.test.d.ts +0 -1
- package/commands/customObject/__tests__/fetchSchema.test.js +0 -45
- package/commands/customObject/__tests__/listSchemas.test.d.ts +0 -1
- package/commands/customObject/__tests__/listSchemas.test.js +0 -29
- package/commands/customObject/__tests__/updateSchema.test.d.ts +0 -1
- package/commands/customObject/__tests__/updateSchema.test.js +0 -40
- package/commands/filemanager/__tests__/fetch.test.d.ts +0 -1
- package/commands/filemanager/__tests__/fetch.test.js +0 -32
- package/commands/filemanager/__tests__/upload.test.d.ts +0 -1
- package/commands/filemanager/__tests__/upload.test.js +0 -191
- package/commands/hubdb/__tests__/clear.test.d.ts +0 -1
- package/commands/hubdb/__tests__/clear.test.js +0 -28
- package/commands/hubdb/__tests__/create.test.d.ts +0 -1
- package/commands/hubdb/__tests__/create.test.js +0 -28
- package/commands/hubdb/__tests__/delete.test.d.ts +0 -1
- package/commands/hubdb/__tests__/delete.test.js +0 -28
- package/commands/hubdb/__tests__/fetch.test.d.ts +0 -1
- package/commands/hubdb/__tests__/fetch.test.js +0 -28
- package/commands/hubdb/__tests__/list.test.d.ts +0 -1
- package/commands/hubdb/__tests__/list.test.js +0 -88
- package/commands/mcp/__tests__/setup.test.d.ts +0 -1
- package/commands/mcp/__tests__/setup.test.js +0 -26
- package/commands/mcp/__tests__/start.test.d.ts +0 -1
- package/commands/mcp/__tests__/start.test.js +0 -144
- package/commands/project/__tests__/add.test.d.ts +0 -1
- package/commands/project/__tests__/add.test.js +0 -107
- package/commands/project/__tests__/create.test.d.ts +0 -1
- package/commands/project/__tests__/create.test.js +0 -97
- package/commands/project/__tests__/deploy.test.d.ts +0 -1
- package/commands/project/__tests__/deploy.test.js +0 -307
- package/commands/project/__tests__/dev.test.d.ts +0 -1
- package/commands/project/__tests__/dev.test.js +0 -273
- package/commands/project/__tests__/devUnifiedFlow.test.d.ts +0 -1
- package/commands/project/__tests__/devUnifiedFlow.test.js +0 -434
- package/commands/project/__tests__/download.test.d.ts +0 -1
- package/commands/project/__tests__/download.test.js +0 -39
- package/commands/project/__tests__/installDeps.test.d.ts +0 -1
- package/commands/project/__tests__/installDeps.test.js +0 -140
- package/commands/project/__tests__/lint.test.d.ts +0 -1
- package/commands/project/__tests__/lint.test.js +0 -704
- package/commands/project/__tests__/list.test.d.ts +0 -1
- package/commands/project/__tests__/list.test.js +0 -31
- package/commands/project/__tests__/listBuilds.test.d.ts +0 -1
- package/commands/project/__tests__/listBuilds.test.js +0 -38
- package/commands/project/__tests__/logs.test.d.ts +0 -1
- package/commands/project/__tests__/logs.test.js +0 -202
- package/commands/project/__tests__/migrate.test.d.ts +0 -1
- package/commands/project/__tests__/migrate.test.js +0 -106
- package/commands/project/__tests__/open.test.d.ts +0 -1
- package/commands/project/__tests__/open.test.js +0 -39
- package/commands/project/__tests__/profile.test.d.ts +0 -1
- package/commands/project/__tests__/profile.test.js +0 -42
- package/commands/project/__tests__/updateDeps.test.d.ts +0 -1
- package/commands/project/__tests__/updateDeps.test.js +0 -140
- package/commands/project/__tests__/upload.test.d.ts +0 -1
- package/commands/project/__tests__/upload.test.js +0 -234
- package/commands/project/__tests__/validate.test.d.ts +0 -1
- package/commands/project/__tests__/validate.test.js +0 -381
- package/commands/project/__tests__/watch.test.d.ts +0 -1
- package/commands/project/__tests__/watch.test.js +0 -35
- package/commands/sandbox/__tests__/create.test.d.ts +0 -1
- package/commands/sandbox/__tests__/create.test.js +0 -198
- package/commands/sandbox/__tests__/delete.test.d.ts +0 -1
- package/commands/sandbox/__tests__/delete.test.js +0 -31
- package/commands/secret/__tests__/addSecret.test.d.ts +0 -1
- package/commands/secret/__tests__/addSecret.test.js +0 -162
- package/commands/secret/__tests__/deleteSecret.test.d.ts +0 -1
- package/commands/secret/__tests__/deleteSecret.test.js +0 -41
- package/commands/secret/__tests__/listSecret.test.d.ts +0 -1
- package/commands/secret/__tests__/listSecret.test.js +0 -29
- package/commands/secret/__tests__/updateSecret.test.d.ts +0 -1
- package/commands/secret/__tests__/updateSecret.test.js +0 -29
- package/commands/testAccount/__tests__/create.test.d.ts +0 -1
- package/commands/testAccount/__tests__/create.test.js +0 -106
- package/commands/testAccount/__tests__/createConfig.test.d.ts +0 -1
- package/commands/testAccount/__tests__/createConfig.test.js +0 -32
- package/commands/testAccount/__tests__/delete.test.d.ts +0 -1
- package/commands/testAccount/__tests__/delete.test.js +0 -29
- package/commands/testAccount/__tests__/importData.test.d.ts +0 -1
- package/commands/testAccount/__tests__/importData.test.js +0 -92
- package/lib/__tests__/CLIWebSocketServer.test.d.ts +0 -1
- package/lib/__tests__/CLIWebSocketServer.test.js +0 -252
- package/lib/__tests__/accountAuth.test.d.ts +0 -1
- package/lib/__tests__/accountAuth.test.js +0 -258
- package/lib/__tests__/accountTypes.test.d.ts +0 -1
- package/lib/__tests__/accountTypes.test.js +0 -98
- package/lib/__tests__/buildAccount.test.d.ts +0 -1
- package/lib/__tests__/buildAccount.test.js +0 -211
- package/lib/__tests__/cliUpgradeUtils.test.d.ts +0 -1
- package/lib/__tests__/cliUpgradeUtils.test.js +0 -131
- package/lib/__tests__/commandSuggestion.test.d.ts +0 -1
- package/lib/__tests__/commandSuggestion.test.js +0 -121
- package/lib/__tests__/commonOpts.test.d.ts +0 -1
- package/lib/__tests__/commonOpts.test.js +0 -80
- package/lib/__tests__/dependencyManagement.test.d.ts +0 -1
- package/lib/__tests__/dependencyManagement.test.js +0 -1067
- package/lib/__tests__/developerTestAccounts.test.d.ts +0 -1
- package/lib/__tests__/developerTestAccounts.test.js +0 -156
- package/lib/__tests__/hasFeature.test.d.ts +0 -1
- package/lib/__tests__/hasFeature.test.js +0 -167
- package/lib/__tests__/http.test.d.ts +0 -1
- package/lib/__tests__/http.test.js +0 -40
- package/lib/__tests__/importData.test.d.ts +0 -1
- package/lib/__tests__/importData.test.js +0 -98
- package/lib/__tests__/npmCli.test.d.ts +0 -1
- package/lib/__tests__/npmCli.test.js +0 -84
- package/lib/__tests__/oauth.test.d.ts +0 -1
- package/lib/__tests__/oauth.test.js +0 -109
- package/lib/__tests__/parsing.test.d.ts +0 -1
- package/lib/__tests__/parsing.test.js +0 -34
- package/lib/__tests__/polling.test.d.ts +0 -1
- package/lib/__tests__/polling.test.js +0 -76
- package/lib/__tests__/process.test.d.ts +0 -1
- package/lib/__tests__/process.test.js +0 -89
- package/lib/__tests__/sandboxes.test.d.ts +0 -1
- package/lib/__tests__/sandboxes.test.js +0 -128
- package/lib/__tests__/serverlessLogs.test.d.ts +0 -1
- package/lib/__tests__/serverlessLogs.test.js +0 -163
- package/lib/__tests__/usageTracking.test.d.ts +0 -1
- package/lib/__tests__/usageTracking.test.js +0 -197
- package/lib/__tests__/validation.test.d.ts +0 -1
- package/lib/__tests__/validation.test.js +0 -143
- package/lib/__tests__/yargsUtils.test.d.ts +0 -1
- package/lib/__tests__/yargsUtils.test.js +0 -124
- package/lib/app/__tests__/migrate.test.d.ts +0 -1
- package/lib/app/__tests__/migrate.test.js +0 -638
- package/lib/doctor/__tests__/Diagnosis.test.d.ts +0 -1
- package/lib/doctor/__tests__/Diagnosis.test.js +0 -84
- package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.d.ts +0 -1
- package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.js +0 -177
- package/lib/doctor/__tests__/Doctor.test.d.ts +0 -1
- package/lib/doctor/__tests__/Doctor.test.js +0 -560
- package/lib/errorHandlers/__tests__/index.test.d.ts +0 -1
- package/lib/errorHandlers/__tests__/index.test.js +0 -278
- package/lib/mcp/__tests__/setup.test.d.ts +0 -1
- package/lib/mcp/__tests__/setup.test.js +0 -523
- package/lib/middleware/__tests__/commandTargetingUtils.test.d.ts +0 -1
- package/lib/middleware/__tests__/commandTargetingUtils.test.js +0 -99
- package/lib/middleware/__tests__/configMiddleware.test.d.ts +0 -1
- package/lib/middleware/__tests__/configMiddleware.test.js +0 -118
- package/lib/middleware/__tests__/gitMiddleware.test.d.ts +0 -1
- package/lib/middleware/__tests__/gitMiddleware.test.js +0 -43
- package/lib/middleware/__tests__/requestMiddleware.test.d.ts +0 -1
- package/lib/middleware/__tests__/requestMiddleware.test.js +0 -15
- package/lib/middleware/__tests__/usageTrackingMiddleware.test.d.ts +0 -1
- package/lib/middleware/__tests__/usageTrackingMiddleware.test.js +0 -44
- package/lib/middleware/__tests__/yargsChecksMiddleware.test.d.ts +0 -1
- package/lib/middleware/__tests__/yargsChecksMiddleware.test.js +0 -39
- package/lib/projects/__tests__/AppDevModeInterface.test.d.ts +0 -1
- package/lib/projects/__tests__/AppDevModeInterface.test.js +0 -541
- package/lib/projects/__tests__/DevServerManager.test.d.ts +0 -1
- package/lib/projects/__tests__/DevServerManager.test.js +0 -185
- package/lib/projects/__tests__/DevSessionManager.test.d.ts +0 -1
- package/lib/projects/__tests__/DevSessionManager.test.js +0 -250
- package/lib/projects/__tests__/LocalDevProcess.test.d.ts +0 -1
- package/lib/projects/__tests__/LocalDevProcess.test.js +0 -481
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.d.ts +0 -1
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +0 -231
- package/lib/projects/__tests__/ProjectLogsManager.test.d.ts +0 -1
- package/lib/projects/__tests__/ProjectLogsManager.test.js +0 -302
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.d.ts +0 -1
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.js +0 -160
- package/lib/projects/__tests__/components.test.d.ts +0 -1
- package/lib/projects/__tests__/components.test.js +0 -440
- package/lib/projects/__tests__/deploy.test.d.ts +0 -1
- package/lib/projects/__tests__/deploy.test.js +0 -231
- package/lib/projects/__tests__/localDevProjectHelpers.test.d.ts +0 -1
- package/lib/projects/__tests__/localDevProjectHelpers.test.js +0 -120
- package/lib/projects/__tests__/platformVersion.test.d.ts +0 -1
- package/lib/projects/__tests__/platformVersion.test.js +0 -63
- package/lib/projects/__tests__/pollProjectBuildAndDeploy.test.d.ts +0 -1
- package/lib/projects/__tests__/pollProjectBuildAndDeploy.test.js +0 -328
- package/lib/projects/__tests__/projectProfiles.test.d.ts +0 -1
- package/lib/projects/__tests__/projectProfiles.test.js +0 -441
- package/lib/projects/__tests__/projects.test.d.ts +0 -1
- package/lib/projects/__tests__/projects.test.js +0 -58
- package/lib/projects/__tests__/structure.test.d.ts +0 -1
- package/lib/projects/__tests__/structure.test.js +0 -210
- package/lib/projects/__tests__/uieLinting.test.d.ts +0 -1
- package/lib/projects/__tests__/uieLinting.test.js +0 -631
- package/lib/projects/__tests__/upload.test.d.ts +0 -1
- package/lib/projects/__tests__/upload.test.js +0 -183
- package/lib/projects/add/__tests__/legacyAddComponent.test.d.ts +0 -1
- package/lib/projects/add/__tests__/legacyAddComponent.test.js +0 -245
- package/lib/projects/add/__tests__/v2AddComponent.test.d.ts +0 -1
- package/lib/projects/add/__tests__/v2AddComponent.test.js +0 -343
- package/lib/projects/create/__tests__/legacy.test.d.ts +0 -1
- package/lib/projects/create/__tests__/legacy.test.js +0 -72
- package/lib/projects/create/__tests__/v2.test.d.ts +0 -1
- package/lib/projects/create/__tests__/v2.test.js +0 -257
- package/lib/prompts/__tests__/createDeveloperTestAccountConfigPrompt.test.d.ts +0 -1
- package/lib/prompts/__tests__/createDeveloperTestAccountConfigPrompt.test.js +0 -157
- package/lib/prompts/__tests__/createFunctionPrompt.test.d.ts +0 -1
- package/lib/prompts/__tests__/createFunctionPrompt.test.js +0 -129
- package/lib/prompts/__tests__/createModulePrompt.test.d.ts +0 -1
- package/lib/prompts/__tests__/createModulePrompt.test.js +0 -187
- package/lib/prompts/__tests__/createTemplatePrompt.test.d.ts +0 -1
- package/lib/prompts/__tests__/createTemplatePrompt.test.js +0 -102
- package/lib/prompts/__tests__/downloadProjectPrompt.test.d.ts +0 -1
- package/lib/prompts/__tests__/downloadProjectPrompt.test.js +0 -31
- package/lib/prompts/__tests__/projectAddPrompt.test.d.ts +0 -1
- package/lib/prompts/__tests__/projectAddPrompt.test.js +0 -143
- package/lib/prompts/__tests__/projectsLogsPrompt.test.d.ts +0 -1
- package/lib/prompts/__tests__/projectsLogsPrompt.test.js +0 -37
- package/lib/prompts/__tests__/selectProjectTemplatePrompt.test.d.ts +0 -1
- package/lib/prompts/__tests__/selectProjectTemplatePrompt.test.js +0 -160
- package/lib/theme/__tests__/migrate.test.d.ts +0 -1
- package/lib/theme/__tests__/migrate.test.js +0 -247
- package/lib/ui/__tests__/SpinniesManager.test.d.ts +0 -1
- package/lib/ui/__tests__/SpinniesManager.test.js +0 -488
- package/lib/ui/__tests__/removeAnsiCodes.test.d.ts +0 -1
- package/lib/ui/__tests__/removeAnsiCodes.test.js +0 -84
- package/mcp-server/tools/cms/__tests__/HsCreateFunctionTool.test.d.ts +0 -1
- package/mcp-server/tools/cms/__tests__/HsCreateFunctionTool.test.js +0 -254
- package/mcp-server/tools/cms/__tests__/HsCreateModuleTool.test.d.ts +0 -1
- package/mcp-server/tools/cms/__tests__/HsCreateModuleTool.test.js +0 -227
- package/mcp-server/tools/cms/__tests__/HsCreateTemplateTool.test.d.ts +0 -1
- package/mcp-server/tools/cms/__tests__/HsCreateTemplateTool.test.js +0 -208
- package/mcp-server/tools/cms/__tests__/HsFunctionLogsTool.test.d.ts +0 -1
- package/mcp-server/tools/cms/__tests__/HsFunctionLogsTool.test.js +0 -186
- package/mcp-server/tools/cms/__tests__/HsListFunctionsTool.test.d.ts +0 -1
- package/mcp-server/tools/cms/__tests__/HsListFunctionsTool.test.js +0 -124
- package/mcp-server/tools/cms/__tests__/HsListTool.test.d.ts +0 -1
- package/mcp-server/tools/cms/__tests__/HsListTool.test.js +0 -124
- package/mcp-server/tools/project/__tests__/AddFeatureToProjectTool.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/AddFeatureToProjectTool.test.js +0 -157
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +0 -131
- package/mcp-server/tools/project/__tests__/CreateTestAccountTool.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/CreateTestAccountTool.test.js +0 -461
- package/mcp-server/tools/project/__tests__/DeployProjectTool.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/DeployProjectTool.test.js +0 -125
- package/mcp-server/tools/project/__tests__/DocFetchTool.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/DocFetchTool.test.js +0 -125
- package/mcp-server/tools/project/__tests__/DocsSearchTool.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/DocsSearchTool.test.js +0 -210
- package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.js +0 -146
- package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.js +0 -124
- package/mcp-server/tools/project/__tests__/GetBuildLogsTool.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/GetBuildLogsTool.test.js +0 -307
- package/mcp-server/tools/project/__tests__/GetBuildStatusTool.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/GetBuildStatusTool.test.js +0 -242
- package/mcp-server/tools/project/__tests__/GetConfigValuesTool.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/GetConfigValuesTool.test.js +0 -209
- package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.js +0 -158
- package/mcp-server/tools/project/__tests__/UploadProjectTools.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +0 -187
- package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.d.ts +0 -1
- package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.js +0 -118
- package/mcp-server/utils/__tests__/command.test.d.ts +0 -1
- package/mcp-server/utils/__tests__/command.test.js +0 -275
- package/mcp-server/utils/__tests__/content.test.d.ts +0 -1
- package/mcp-server/utils/__tests__/content.test.js +0 -164
- package/mcp-server/utils/__tests__/feedbackTracking.test.d.ts +0 -1
- package/mcp-server/utils/__tests__/feedbackTracking.test.js +0 -69
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { DocFetchTool } from '../DocFetchTool.js';
|
|
2
|
-
import { http } from '@hubspot/local-dev-lib/http/unauthed';
|
|
3
|
-
import { isHubSpotHttpError } from '@hubspot/local-dev-lib/errors/index';
|
|
4
|
-
import { mcpFeedbackRequest } from '../../../utils/feedbackTracking.js';
|
|
5
|
-
import { trackToolUsage } from '../../../utils/toolUsageTracking.js';
|
|
6
|
-
vi.mock('@modelcontextprotocol/sdk/server/mcp.js');
|
|
7
|
-
vi.mock('@hubspot/local-dev-lib/http/unauthed');
|
|
8
|
-
vi.mock('@hubspot/local-dev-lib/errors/index');
|
|
9
|
-
vi.mock('@hubspot/local-dev-lib/config');
|
|
10
|
-
vi.mock('../../../utils/toolUsageTracking');
|
|
11
|
-
vi.mock('../../../utils/feedbackTracking');
|
|
12
|
-
const mockMcpFeedbackRequest = mcpFeedbackRequest;
|
|
13
|
-
const mockTrackToolUsage = trackToolUsage;
|
|
14
|
-
const mockHttp = http;
|
|
15
|
-
const mockIsHubSpotHttpError = vi.mocked(isHubSpotHttpError);
|
|
16
|
-
describe('mcp-server/tools/project/DocFetchTool', () => {
|
|
17
|
-
let mockMcpServer;
|
|
18
|
-
let tool;
|
|
19
|
-
let mockRegisteredTool;
|
|
20
|
-
beforeEach(() => {
|
|
21
|
-
// @ts-expect-error Not mocking whole server
|
|
22
|
-
mockMcpServer = {
|
|
23
|
-
registerTool: vi.fn(),
|
|
24
|
-
};
|
|
25
|
-
mockRegisteredTool = {};
|
|
26
|
-
mockMcpServer.registerTool.mockReturnValue(mockRegisteredTool);
|
|
27
|
-
mockMcpFeedbackRequest.mockResolvedValue('');
|
|
28
|
-
mockTrackToolUsage.mockResolvedValue(undefined);
|
|
29
|
-
tool = new DocFetchTool(mockMcpServer);
|
|
30
|
-
});
|
|
31
|
-
describe('register', () => {
|
|
32
|
-
it('should register tool with correct parameters', () => {
|
|
33
|
-
const result = tool.register();
|
|
34
|
-
expect(mockMcpServer.registerTool).toHaveBeenCalledWith('fetch-doc', expect.objectContaining({
|
|
35
|
-
title: 'Fetch HubSpot Developer Documentation (single file)',
|
|
36
|
-
description: expect.stringContaining('Always use this immediately after `search-docs`'),
|
|
37
|
-
inputSchema: expect.any(Object),
|
|
38
|
-
}), expect.any(Function));
|
|
39
|
-
expect(result).toBe(mockRegisteredTool);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
describe('handler', () => {
|
|
43
|
-
const mockInput = {
|
|
44
|
-
absoluteCurrentWorkingDirectory: '/test/dir',
|
|
45
|
-
docUrl: 'https://example.com/docs/test-doc',
|
|
46
|
-
};
|
|
47
|
-
it('should successfully fetch and return markdown content', async () => {
|
|
48
|
-
const mockContent = '# Test Document\n\nThis is a test markdown document.';
|
|
49
|
-
// @ts-expect-error - Mocking axios response structure
|
|
50
|
-
mockHttp.get.mockResolvedValue({
|
|
51
|
-
data: mockContent,
|
|
52
|
-
});
|
|
53
|
-
const result = await tool.handler(mockInput);
|
|
54
|
-
expect(mockHttp.get).toHaveBeenCalledWith({
|
|
55
|
-
url: 'https://example.com/docs/test-doc.md',
|
|
56
|
-
});
|
|
57
|
-
expect(result).toEqual({
|
|
58
|
-
content: [
|
|
59
|
-
{
|
|
60
|
-
type: 'text',
|
|
61
|
-
text: mockContent,
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
it('should handle HubSpot HTTP errors', async () => {
|
|
67
|
-
const mockError = {
|
|
68
|
-
toString: () => 'HubSpotHttpError: \n- message: The request was not found.\n- status: 404\n- statusText: Not Found\n- method: get\n- code: ERR_BAD_REQUEST\n- derivedContext: {\n "request": "https://example.com/docs/test-doc.md"\n}',
|
|
69
|
-
};
|
|
70
|
-
mockHttp.get.mockRejectedValue(mockError);
|
|
71
|
-
mockIsHubSpotHttpError.mockReturnValue(true);
|
|
72
|
-
const result = await tool.handler(mockInput);
|
|
73
|
-
expect(result).toEqual({
|
|
74
|
-
content: [
|
|
75
|
-
{
|
|
76
|
-
type: 'text',
|
|
77
|
-
text: 'HubSpotHttpError: \n- message: The request was not found.\n- status: 404\n- statusText: Not Found\n- method: get\n- code: ERR_BAD_REQUEST\n- derivedContext: {\n "request": "https://example.com/docs/test-doc.md"\n}',
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
it('should handle empty content', async () => {
|
|
83
|
-
// @ts-expect-error - Mocking axios response structure
|
|
84
|
-
mockHttp.get.mockResolvedValue({
|
|
85
|
-
data: ' ',
|
|
86
|
-
});
|
|
87
|
-
const result = await tool.handler(mockInput);
|
|
88
|
-
expect(result).toEqual({
|
|
89
|
-
content: [
|
|
90
|
-
{
|
|
91
|
-
type: 'text',
|
|
92
|
-
text: 'Document is empty or contains no content.',
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
it('should handle generic errors', async () => {
|
|
98
|
-
const mockError = new Error('Network error');
|
|
99
|
-
mockHttp.get.mockRejectedValue(mockError);
|
|
100
|
-
mockIsHubSpotHttpError.mockReturnValue(false);
|
|
101
|
-
const result = await tool.handler(mockInput);
|
|
102
|
-
expect(result).toEqual({
|
|
103
|
-
content: [
|
|
104
|
-
{
|
|
105
|
-
type: 'text',
|
|
106
|
-
text: 'Error fetching documentation: Network error',
|
|
107
|
-
},
|
|
108
|
-
],
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
it('should handle non-Error rejections', async () => {
|
|
112
|
-
mockHttp.get.mockRejectedValue('String error');
|
|
113
|
-
mockIsHubSpotHttpError.mockReturnValue(false);
|
|
114
|
-
const result = await tool.handler(mockInput);
|
|
115
|
-
expect(result).toEqual({
|
|
116
|
-
content: [
|
|
117
|
-
{
|
|
118
|
-
type: 'text',
|
|
119
|
-
text: 'Error fetching documentation: String error',
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import { DocsSearchTool } from '../DocsSearchTool.js';
|
|
2
|
-
import { http } from '@hubspot/local-dev-lib/http';
|
|
3
|
-
import { isHubSpotHttpError } from '@hubspot/local-dev-lib/errors/index';
|
|
4
|
-
import { getConfigDefaultAccountIfExists } from '@hubspot/local-dev-lib/config';
|
|
5
|
-
import { mcpFeedbackRequest } from '../../../utils/feedbackTracking.js';
|
|
6
|
-
import { trackToolUsage } from '../../../utils/toolUsageTracking.js';
|
|
7
|
-
vi.mock('@modelcontextprotocol/sdk/server/mcp.js');
|
|
8
|
-
vi.mock('@hubspot/local-dev-lib/http');
|
|
9
|
-
vi.mock('@hubspot/local-dev-lib/errors/index');
|
|
10
|
-
vi.mock('@hubspot/local-dev-lib/config');
|
|
11
|
-
vi.mock('../../../utils/toolUsageTracking');
|
|
12
|
-
vi.mock('../../../utils/feedbackTracking');
|
|
13
|
-
const mockTrackToolUsage = trackToolUsage;
|
|
14
|
-
const mockMcpFeedbackRequest = mcpFeedbackRequest;
|
|
15
|
-
const mockHttp = http;
|
|
16
|
-
const mockIsHubSpotHttpError = vi.mocked(isHubSpotHttpError);
|
|
17
|
-
const mockGetConfigDefaultAccountIfExists = getConfigDefaultAccountIfExists;
|
|
18
|
-
describe('mcp-server/tools/project/DocsSearchTool', () => {
|
|
19
|
-
let mockMcpServer;
|
|
20
|
-
let tool;
|
|
21
|
-
let mockRegisteredTool;
|
|
22
|
-
beforeEach(() => {
|
|
23
|
-
// @ts-expect-error Not mocking whole server
|
|
24
|
-
mockMcpServer = {
|
|
25
|
-
registerTool: vi.fn(),
|
|
26
|
-
};
|
|
27
|
-
mockRegisteredTool = {};
|
|
28
|
-
mockMcpServer.registerTool.mockReturnValue(mockRegisteredTool);
|
|
29
|
-
mockMcpFeedbackRequest.mockResolvedValue('');
|
|
30
|
-
mockTrackToolUsage.mockResolvedValue(undefined);
|
|
31
|
-
tool = new DocsSearchTool(mockMcpServer);
|
|
32
|
-
});
|
|
33
|
-
describe('register', () => {
|
|
34
|
-
it('should register tool with correct parameters and enhanced description', () => {
|
|
35
|
-
const result = tool.register();
|
|
36
|
-
expect(mockMcpServer.registerTool).toHaveBeenCalledWith('search-docs', expect.objectContaining({
|
|
37
|
-
title: 'Search HubSpot Developer Documentation',
|
|
38
|
-
description: 'Use this first whenever you need details about HubSpot APIs, SDKs, integrations, or developer platform features. This searches the official HubSpot Developer Documentation and returns the most relevant pages, each with a URL for use in `fetch-doc`. Always follow this with a fetch to get the full, authoritative content before making plans or writing answers.',
|
|
39
|
-
inputSchema: expect.any(Object),
|
|
40
|
-
}), expect.any(Function));
|
|
41
|
-
expect(result).toBe(mockRegisteredTool);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
describe('handler', () => {
|
|
45
|
-
const mockInput = {
|
|
46
|
-
docsSearchQuery: 'test query',
|
|
47
|
-
absoluteCurrentWorkingDirectory: '/foo',
|
|
48
|
-
};
|
|
49
|
-
it('should return auth error message when no account ID is found', async () => {
|
|
50
|
-
mockGetConfigDefaultAccountIfExists.mockReturnValue(undefined);
|
|
51
|
-
const result = await tool.handler(mockInput);
|
|
52
|
-
expect(result).toEqual({
|
|
53
|
-
content: [
|
|
54
|
-
{
|
|
55
|
-
type: 'text',
|
|
56
|
-
text: 'No account ID found. Please run `hs account auth` to configure an account, or set a default account with `hs account use <account>`',
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
it('should return successful results when docs are found', async () => {
|
|
62
|
-
mockGetConfigDefaultAccountIfExists.mockReturnValue({
|
|
63
|
-
accountId: 12345,
|
|
64
|
-
});
|
|
65
|
-
const mockResponse = {
|
|
66
|
-
results: [
|
|
67
|
-
{
|
|
68
|
-
title: 'Test Doc 1',
|
|
69
|
-
content: 'Test content 1',
|
|
70
|
-
description: 'Test description 1',
|
|
71
|
-
url: 'https://example.com/doc1',
|
|
72
|
-
score: 0.9,
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
title: 'Test Doc 2',
|
|
76
|
-
content: 'Test content 2',
|
|
77
|
-
description: 'Test description 2',
|
|
78
|
-
url: 'https://example.com/doc2',
|
|
79
|
-
score: 0.8,
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
};
|
|
83
|
-
// @ts-expect-error - Mocking axios response structure
|
|
84
|
-
mockHttp.post.mockResolvedValue({
|
|
85
|
-
data: mockResponse,
|
|
86
|
-
});
|
|
87
|
-
const result = await tool.handler(mockInput);
|
|
88
|
-
expect(mockGetConfigDefaultAccountIfExists).toHaveBeenCalled();
|
|
89
|
-
expect(mockHttp.post).toHaveBeenCalledWith(12345, {
|
|
90
|
-
url: 'dev/docs/llms/v1/docs-search',
|
|
91
|
-
data: {
|
|
92
|
-
query: 'test query',
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
expect(result).toEqual({
|
|
96
|
-
content: [
|
|
97
|
-
{
|
|
98
|
-
type: 'text',
|
|
99
|
-
text: expect.stringContaining('Found 2 documentation results:'),
|
|
100
|
-
},
|
|
101
|
-
],
|
|
102
|
-
});
|
|
103
|
-
const resultText = result.content[0].text;
|
|
104
|
-
expect(resultText).toContain('**Test Doc 1**');
|
|
105
|
-
expect(resultText).toContain('Test description 1');
|
|
106
|
-
expect(resultText).toContain('https://example.com/doc1');
|
|
107
|
-
expect(resultText).toContain('Score: 0.9');
|
|
108
|
-
expect(resultText).toContain('Test content 1');
|
|
109
|
-
expect(resultText).toContain('**Test Doc 2**');
|
|
110
|
-
expect(resultText).toContain('Test description 2');
|
|
111
|
-
expect(resultText).toContain('https://example.com/doc2');
|
|
112
|
-
expect(resultText).toContain('Score: 0.8');
|
|
113
|
-
expect(resultText).toContain('Test content 2');
|
|
114
|
-
});
|
|
115
|
-
it('should return no results message when no documentation is found', async () => {
|
|
116
|
-
mockGetConfigDefaultAccountIfExists.mockReturnValue({
|
|
117
|
-
accountId: 12345,
|
|
118
|
-
});
|
|
119
|
-
const mockResponse = {
|
|
120
|
-
results: [],
|
|
121
|
-
};
|
|
122
|
-
// @ts-expect-error - Mocking axios response structure
|
|
123
|
-
mockHttp.post.mockResolvedValue({
|
|
124
|
-
data: mockResponse,
|
|
125
|
-
});
|
|
126
|
-
const result = await tool.handler(mockInput);
|
|
127
|
-
expect(result).toEqual({
|
|
128
|
-
content: [
|
|
129
|
-
{
|
|
130
|
-
type: 'text',
|
|
131
|
-
text: 'No documentation found for your query.',
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
it('should return no results message when results is null', async () => {
|
|
137
|
-
mockGetConfigDefaultAccountIfExists.mockReturnValue({
|
|
138
|
-
accountId: 12345,
|
|
139
|
-
});
|
|
140
|
-
const mockResponse = {
|
|
141
|
-
results: null,
|
|
142
|
-
};
|
|
143
|
-
// @ts-expect-error - Mocking axios response structure
|
|
144
|
-
mockHttp.post.mockResolvedValue({
|
|
145
|
-
data: mockResponse,
|
|
146
|
-
});
|
|
147
|
-
const result = await tool.handler(mockInput);
|
|
148
|
-
expect(result).toEqual({
|
|
149
|
-
content: [
|
|
150
|
-
{
|
|
151
|
-
type: 'text',
|
|
152
|
-
text: 'No documentation found for your query.',
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
it('should handle HubSpot HTTP errors', async () => {
|
|
158
|
-
mockGetConfigDefaultAccountIfExists.mockReturnValue({
|
|
159
|
-
accountId: 12345,
|
|
160
|
-
});
|
|
161
|
-
const mockError = {
|
|
162
|
-
toString: () => 'HubSpot API Error: 404 Not Found',
|
|
163
|
-
};
|
|
164
|
-
mockHttp.post.mockRejectedValue(mockError);
|
|
165
|
-
mockIsHubSpotHttpError.mockReturnValue(true);
|
|
166
|
-
const result = await tool.handler(mockInput);
|
|
167
|
-
expect(result).toEqual({
|
|
168
|
-
content: [
|
|
169
|
-
{
|
|
170
|
-
type: 'text',
|
|
171
|
-
text: 'HubSpot API Error: 404 Not Found',
|
|
172
|
-
},
|
|
173
|
-
],
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
it('should handle generic errors', async () => {
|
|
177
|
-
mockGetConfigDefaultAccountIfExists.mockReturnValue({
|
|
178
|
-
accountId: 12345,
|
|
179
|
-
});
|
|
180
|
-
const mockError = new Error('Network error');
|
|
181
|
-
mockHttp.post.mockRejectedValue(mockError);
|
|
182
|
-
mockIsHubSpotHttpError.mockReturnValue(false);
|
|
183
|
-
const result = await tool.handler(mockInput);
|
|
184
|
-
expect(result).toEqual({
|
|
185
|
-
content: [
|
|
186
|
-
{
|
|
187
|
-
type: 'text',
|
|
188
|
-
text: 'Error searching documentation: Network error',
|
|
189
|
-
},
|
|
190
|
-
],
|
|
191
|
-
});
|
|
192
|
-
});
|
|
193
|
-
it('should handle non-Error rejections', async () => {
|
|
194
|
-
mockGetConfigDefaultAccountIfExists.mockReturnValue({
|
|
195
|
-
accountId: 12345,
|
|
196
|
-
});
|
|
197
|
-
mockHttp.post.mockRejectedValue('String error');
|
|
198
|
-
mockIsHubSpotHttpError.mockReturnValue(false);
|
|
199
|
-
const result = await tool.handler(mockInput);
|
|
200
|
-
expect(result).toEqual({
|
|
201
|
-
content: [
|
|
202
|
-
{
|
|
203
|
-
type: 'text',
|
|
204
|
-
text: 'Error searching documentation: String error',
|
|
205
|
-
},
|
|
206
|
-
],
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
});
|
|
210
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { GetApiUsagePatternsByAppIdTool } from '../GetApiUsagePatternsByAppIdTool.js';
|
|
2
|
-
import { getConfigDefaultAccountIfExists } from '@hubspot/local-dev-lib/config';
|
|
3
|
-
import { http } from '@hubspot/local-dev-lib/http';
|
|
4
|
-
import { isHubSpotHttpError } from '@hubspot/local-dev-lib/errors/index';
|
|
5
|
-
import { mcpFeedbackRequest } from '../../../utils/feedbackTracking.js';
|
|
6
|
-
import { trackToolUsage } from '../../../utils/toolUsageTracking.js';
|
|
7
|
-
vi.mock('@modelcontextprotocol/sdk/server/mcp.js');
|
|
8
|
-
vi.mock('../../../utils/toolUsageTracking');
|
|
9
|
-
vi.mock('@hubspot/local-dev-lib/http');
|
|
10
|
-
vi.mock('@hubspot/local-dev-lib/errors/index');
|
|
11
|
-
vi.mock('@hubspot/local-dev-lib/config');
|
|
12
|
-
vi.mock('../../../utils/feedbackTracking');
|
|
13
|
-
const mockTrackToolUsage = trackToolUsage;
|
|
14
|
-
const mockMcpFeedbackRequest = mcpFeedbackRequest;
|
|
15
|
-
const mockGetConfigDefaultAccountIfExists = getConfigDefaultAccountIfExists;
|
|
16
|
-
const mockHttp = http;
|
|
17
|
-
const mockIsHubSpotHttpError = isHubSpotHttpError;
|
|
18
|
-
describe('mcp-server/tools/project/GetApiUsagePatternsByAppIdTool', () => {
|
|
19
|
-
let mockMcpServer;
|
|
20
|
-
let tool;
|
|
21
|
-
let mockRegisteredTool;
|
|
22
|
-
beforeEach(() => {
|
|
23
|
-
// @ts-expect-error Not mocking the whole thing
|
|
24
|
-
mockMcpServer = {
|
|
25
|
-
registerTool: vi.fn(),
|
|
26
|
-
};
|
|
27
|
-
mockRegisteredTool = {};
|
|
28
|
-
mockMcpServer.registerTool.mockReturnValue(mockRegisteredTool);
|
|
29
|
-
mockMcpFeedbackRequest.mockResolvedValue('');
|
|
30
|
-
mockTrackToolUsage.mockResolvedValue(undefined);
|
|
31
|
-
tool = new GetApiUsagePatternsByAppIdTool(mockMcpServer);
|
|
32
|
-
});
|
|
33
|
-
describe('register', () => {
|
|
34
|
-
it('should register tool with correct parameters', () => {
|
|
35
|
-
const result = tool.register();
|
|
36
|
-
expect(mockMcpServer.registerTool).toHaveBeenCalledWith('get-api-usage-patterns-by-app-id', expect.objectContaining({
|
|
37
|
-
title: 'Get API Usage Patterns by App ID',
|
|
38
|
-
description: expect.stringContaining('Retrieves detailed API usage pattern analytics for a specific HubSpot app'),
|
|
39
|
-
inputSchema: expect.objectContaining({
|
|
40
|
-
appId: expect.objectContaining({
|
|
41
|
-
describe: expect.any(Function),
|
|
42
|
-
}),
|
|
43
|
-
startDate: expect.objectContaining({
|
|
44
|
-
optional: expect.any(Function),
|
|
45
|
-
}),
|
|
46
|
-
endDate: expect.objectContaining({
|
|
47
|
-
optional: expect.any(Function),
|
|
48
|
-
}),
|
|
49
|
-
}),
|
|
50
|
-
}), expect.any(Function));
|
|
51
|
-
expect(result).toBe(mockRegisteredTool);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
describe('handler', () => {
|
|
55
|
-
const input = {
|
|
56
|
-
absoluteCurrentWorkingDirectory: '/test/dir',
|
|
57
|
-
appId: '12345',
|
|
58
|
-
startDate: '2025-01-01',
|
|
59
|
-
endDate: '2025-12-31',
|
|
60
|
-
};
|
|
61
|
-
beforeEach(() => {
|
|
62
|
-
mockGetConfigDefaultAccountIfExists.mockReturnValue({
|
|
63
|
-
accountId: 123456789,
|
|
64
|
-
});
|
|
65
|
-
mockIsHubSpotHttpError.mockReturnValue(false);
|
|
66
|
-
});
|
|
67
|
-
it('should return API usage patterns successfully', async () => {
|
|
68
|
-
const mockResponse = {
|
|
69
|
-
data: {
|
|
70
|
-
patternSummaries: {
|
|
71
|
-
additionalProp1: {
|
|
72
|
-
portalPercentage: 25.5,
|
|
73
|
-
numOfPortals: 150,
|
|
74
|
-
},
|
|
75
|
-
additionalProp2: {
|
|
76
|
-
portalPercentage: 18.2,
|
|
77
|
-
numOfPortals: 89,
|
|
78
|
-
},
|
|
79
|
-
additionalProp3: {
|
|
80
|
-
portalPercentage: 32.1,
|
|
81
|
-
numOfPortals: 201,
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
status: 200,
|
|
86
|
-
statusText: 'OK',
|
|
87
|
-
headers: {},
|
|
88
|
-
config: { headers: {} },
|
|
89
|
-
};
|
|
90
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
|
-
mockHttp.get.mockResolvedValue(mockResponse);
|
|
92
|
-
const result = await tool.handler(input);
|
|
93
|
-
expect(mockGetConfigDefaultAccountIfExists).toHaveBeenCalledWith();
|
|
94
|
-
expect(mockHttp.get).toHaveBeenCalledWith(123456789, {
|
|
95
|
-
url: 'app/feature/utilization/public/v3/insights/app/12345/usage-patterns',
|
|
96
|
-
params: {
|
|
97
|
-
startDate: '2025-01-01',
|
|
98
|
-
endDate: '2025-12-31',
|
|
99
|
-
},
|
|
100
|
-
});
|
|
101
|
-
expect(result).toEqual({
|
|
102
|
-
content: [
|
|
103
|
-
{
|
|
104
|
-
type: 'text',
|
|
105
|
-
text: JSON.stringify(mockResponse.data, null, 2),
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
it('should return error when account ID cannot be determined', async () => {
|
|
111
|
-
mockGetConfigDefaultAccountIfExists.mockReturnValue(undefined);
|
|
112
|
-
const result = await tool.handler(input);
|
|
113
|
-
expect(result).toEqual({
|
|
114
|
-
content: [
|
|
115
|
-
{
|
|
116
|
-
type: 'text',
|
|
117
|
-
text: 'No account ID found. Please run `hs account auth` to configure an account, or set a default account with `hs account use <account>`',
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
});
|
|
121
|
-
expect(mockHttp.get).not.toHaveBeenCalled();
|
|
122
|
-
});
|
|
123
|
-
it('should handle empty usage patterns response', async () => {
|
|
124
|
-
const mockResponse = {
|
|
125
|
-
data: {
|
|
126
|
-
patternSummaries: {},
|
|
127
|
-
},
|
|
128
|
-
status: 200,
|
|
129
|
-
statusText: 'OK',
|
|
130
|
-
headers: {},
|
|
131
|
-
config: { headers: {} },
|
|
132
|
-
};
|
|
133
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
134
|
-
mockHttp.get.mockResolvedValue(mockResponse);
|
|
135
|
-
const result = await tool.handler(input);
|
|
136
|
-
expect(result).toEqual({
|
|
137
|
-
content: [
|
|
138
|
-
{
|
|
139
|
-
type: 'text',
|
|
140
|
-
text: JSON.stringify(mockResponse.data, null, 2),
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { GetApplicationInfoTool } from '../GetApplicationInfoTool.js';
|
|
2
|
-
import { getConfigDefaultAccountIfExists } from '@hubspot/local-dev-lib/config';
|
|
3
|
-
import { http } from '@hubspot/local-dev-lib/http';
|
|
4
|
-
import { isHubSpotHttpError } from '@hubspot/local-dev-lib/errors/index';
|
|
5
|
-
import { mcpFeedbackRequest } from '../../../utils/feedbackTracking.js';
|
|
6
|
-
import { trackToolUsage } from '../../../utils/toolUsageTracking.js';
|
|
7
|
-
vi.mock('@modelcontextprotocol/sdk/server/mcp.js');
|
|
8
|
-
vi.mock('../../../utils/toolUsageTracking');
|
|
9
|
-
vi.mock('@hubspot/local-dev-lib/http');
|
|
10
|
-
vi.mock('@hubspot/local-dev-lib/errors/index');
|
|
11
|
-
vi.mock('@hubspot/local-dev-lib/config');
|
|
12
|
-
vi.mock('../../../utils/feedbackTracking');
|
|
13
|
-
vi.mock('../../../utils/config');
|
|
14
|
-
const mockTrackToolUsage = trackToolUsage;
|
|
15
|
-
const mockMcpFeedbackRequest = mcpFeedbackRequest;
|
|
16
|
-
const mockGetConfigDefaultAccountIfExists = getConfigDefaultAccountIfExists;
|
|
17
|
-
const mockHttp = http;
|
|
18
|
-
const mockIsHubSpotHttpError = isHubSpotHttpError;
|
|
19
|
-
describe('mcp-server/tools/project/GetApplicationInfoTool', () => {
|
|
20
|
-
let mockMcpServer;
|
|
21
|
-
let tool;
|
|
22
|
-
let mockRegisteredTool;
|
|
23
|
-
beforeEach(() => {
|
|
24
|
-
// @ts-expect-error Not mocking the whole thing
|
|
25
|
-
mockMcpServer = {
|
|
26
|
-
registerTool: vi.fn(),
|
|
27
|
-
};
|
|
28
|
-
mockRegisteredTool = {};
|
|
29
|
-
mockMcpServer.registerTool.mockReturnValue(mockRegisteredTool);
|
|
30
|
-
mockMcpFeedbackRequest.mockResolvedValue('');
|
|
31
|
-
mockTrackToolUsage.mockResolvedValue(undefined);
|
|
32
|
-
tool = new GetApplicationInfoTool(mockMcpServer);
|
|
33
|
-
});
|
|
34
|
-
describe('register', () => {
|
|
35
|
-
it('should register tool with correct parameters', () => {
|
|
36
|
-
const result = tool.register();
|
|
37
|
-
expect(mockMcpServer.registerTool).toHaveBeenCalledWith('get-apps-info', expect.objectContaining({
|
|
38
|
-
title: 'Get Apps Information',
|
|
39
|
-
description: expect.stringContaining('Retrieves a list of all HubSpot apps available in the current account'),
|
|
40
|
-
inputSchema: expect.any(Object),
|
|
41
|
-
}), expect.any(Function));
|
|
42
|
-
expect(result).toBe(mockRegisteredTool);
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
describe('handler', () => {
|
|
46
|
-
const input = { absoluteCurrentWorkingDirectory: '/test/dir' };
|
|
47
|
-
beforeEach(() => {
|
|
48
|
-
mockGetConfigDefaultAccountIfExists.mockReturnValue({
|
|
49
|
-
accountId: 123456789,
|
|
50
|
-
});
|
|
51
|
-
mockIsHubSpotHttpError.mockReturnValue(false);
|
|
52
|
-
});
|
|
53
|
-
it('should return application information successfully', async () => {
|
|
54
|
-
const mockResponse = {
|
|
55
|
-
data: {
|
|
56
|
-
applications: [
|
|
57
|
-
{
|
|
58
|
-
appId: 12345,
|
|
59
|
-
appName: 'Test App 1',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
appId: 67890,
|
|
63
|
-
appName: 'Test App 2',
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
},
|
|
67
|
-
status: 200,
|
|
68
|
-
statusText: 'OK',
|
|
69
|
-
headers: {},
|
|
70
|
-
config: { headers: {} },
|
|
71
|
-
};
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
73
|
-
mockHttp.get.mockResolvedValue(mockResponse);
|
|
74
|
-
const result = await tool.handler(input);
|
|
75
|
-
expect(mockGetConfigDefaultAccountIfExists).toHaveBeenCalledWith();
|
|
76
|
-
expect(mockHttp.get).toHaveBeenCalledWith(123456789, {
|
|
77
|
-
url: 'app/feature/utilization/public/v3/insights/apps',
|
|
78
|
-
});
|
|
79
|
-
expect(result).toEqual({
|
|
80
|
-
content: [
|
|
81
|
-
{
|
|
82
|
-
type: 'text',
|
|
83
|
-
text: JSON.stringify(mockResponse.data, null, 2),
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
it('should return error when account ID cannot be determined', async () => {
|
|
89
|
-
mockGetConfigDefaultAccountIfExists.mockReturnValue(undefined);
|
|
90
|
-
const result = await tool.handler(input);
|
|
91
|
-
expect(result).toEqual({
|
|
92
|
-
content: [
|
|
93
|
-
{
|
|
94
|
-
type: 'text',
|
|
95
|
-
text: 'No account ID found. Please run `hs account auth` to configure an account, or set a default account with `hs account use <account>`',
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
});
|
|
99
|
-
expect(mockHttp.get).not.toHaveBeenCalled();
|
|
100
|
-
});
|
|
101
|
-
it('should handle empty applications response', async () => {
|
|
102
|
-
const mockResponse = {
|
|
103
|
-
data: {
|
|
104
|
-
applications: [],
|
|
105
|
-
},
|
|
106
|
-
status: 200,
|
|
107
|
-
statusText: 'OK',
|
|
108
|
-
headers: {},
|
|
109
|
-
config: { headers: {} },
|
|
110
|
-
};
|
|
111
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
112
|
-
mockHttp.get.mockResolvedValue(mockResponse);
|
|
113
|
-
const result = await tool.handler(input);
|
|
114
|
-
expect(result).toEqual({
|
|
115
|
-
content: [
|
|
116
|
-
{
|
|
117
|
-
type: 'text',
|
|
118
|
-
text: JSON.stringify(mockResponse.data, null, 2),
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|