@hubspot/cli 7.7.21-experimental.0 → 7.7.21-experimental.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/__tests__/migrate.test.js +29 -27
- package/api/migrate.js +22 -14
- package/bin/cli.js +101 -92
- package/bin/hs +2 -2
- package/bin/hscms +2 -2
- package/bin/silenceErrors.js +2 -1
- package/commands/__tests__/account.test.js +34 -29
- package/commands/__tests__/auth.test.js +16 -11
- package/commands/__tests__/cms.test.js +20 -15
- package/commands/__tests__/config.test.js +19 -14
- package/commands/__tests__/create.test.js +15 -10
- package/commands/__tests__/customObject.test.js +19 -14
- package/commands/__tests__/doctor.test.js +48 -43
- package/commands/__tests__/feedback.test.js +45 -7
- package/commands/__tests__/fetch.test.js +28 -29
- package/commands/__tests__/filemanager.test.js +19 -14
- package/commands/__tests__/function.test.js +21 -16
- package/commands/__tests__/getStarted.test.js +50 -55
- package/commands/__tests__/hubdb.test.js +22 -17
- package/commands/__tests__/init.test.js +17 -12
- package/commands/__tests__/lint.test.js +18 -13
- package/commands/__tests__/list.test.js +23 -18
- package/commands/__tests__/logs.test.js +27 -28
- package/commands/__tests__/mcp.test.js +19 -14
- package/commands/__tests__/mv.test.js +52 -14
- package/commands/__tests__/open.test.js +51 -13
- package/commands/__tests__/project.test.js +49 -44
- package/commands/__tests__/remove.test.js +51 -13
- package/commands/__tests__/sandbox.test.js +19 -14
- package/commands/__tests__/secret.test.js +21 -16
- package/commands/__tests__/testAccount.test.js +21 -16
- package/commands/__tests__/theme.test.js +20 -15
- package/commands/account/__tests__/auth.test.js +16 -11
- package/commands/account/__tests__/clean.test.js +17 -12
- package/commands/account/__tests__/createOverride.test.js +15 -10
- package/commands/account/__tests__/info.test.js +16 -11
- package/commands/account/__tests__/list.test.js +16 -11
- package/commands/account/__tests__/remove.test.js +18 -13
- package/commands/account/__tests__/removeOverride.js +13 -8
- package/commands/account/__tests__/rename.test.js +20 -15
- package/commands/account/__tests__/use.test.js +15 -10
- package/commands/account/auth.d.ts +1 -1
- package/commands/account/auth.js +67 -65
- package/commands/account/clean.d.ts +1 -1
- package/commands/account/clean.js +60 -55
- package/commands/account/createOverride.d.ts +1 -1
- package/commands/account/createOverride.js +57 -52
- package/commands/account/info.d.ts +1 -1
- package/commands/account/info.js +35 -33
- package/commands/account/list.d.ts +1 -1
- package/commands/account/list.js +45 -43
- package/commands/account/remove.d.ts +1 -1
- package/commands/account/remove.js +42 -37
- package/commands/account/removeOverride.d.ts +1 -1
- package/commands/account/removeOverride.js +43 -38
- package/commands/account/rename.d.ts +1 -1
- package/commands/account/rename.js +20 -18
- package/commands/account/use.d.ts +1 -1
- package/commands/account/use.js +31 -29
- package/commands/account.d.ts +1 -1
- package/commands/account.js +28 -23
- package/commands/app/__tests__/install.test.js +52 -0
- package/commands/app/__tests__/migrate.test.js +34 -29
- package/commands/app/install.d.ts +8 -0
- package/commands/app/install.js +127 -0
- package/commands/app/migrate.d.ts +2 -2
- package/commands/app/migrate.js +43 -40
- package/commands/app/secret/__tests__/add.test.js +11 -6
- package/commands/app/secret/__tests__/delete.test.js +11 -6
- package/commands/app/secret/__tests__/list.test.js +11 -6
- package/commands/app/secret/__tests__/update.test.js +11 -6
- package/commands/app/secret/add.d.ts +1 -1
- package/commands/app/secret/add.js +30 -28
- package/commands/app/secret/delete.d.ts +1 -1
- package/commands/app/secret/delete.js +36 -34
- package/commands/app/secret/list.d.ts +1 -1
- package/commands/app/secret/list.js +27 -25
- package/commands/app/secret/update.d.ts +1 -1
- package/commands/app/secret/update.js +34 -32
- package/commands/app/secret.d.ts +1 -1
- package/commands/app/secret.js +17 -12
- package/commands/app.d.ts +1 -1
- package/commands/app.js +16 -6
- package/commands/auth.d.ts +1 -1
- package/commands/auth.js +72 -70
- package/commands/cms/convertFields.d.ts +1 -1
- package/commands/cms/convertFields.js +39 -34
- package/commands/cms/getReactModule.d.ts +1 -1
- package/commands/cms/getReactModule.js +37 -32
- package/commands/cms/lighthouseScore.d.ts +1 -1
- package/commands/cms/lighthouseScore.js +72 -67
- package/commands/cms.d.ts +1 -1
- package/commands/cms.js +16 -11
- package/commands/completion.d.ts +1 -1
- package/commands/completion.js +15 -10
- package/commands/config/migrate.d.ts +1 -1
- package/commands/config/migrate.js +32 -27
- package/commands/config/set.d.ts +1 -1
- package/commands/config/set.js +25 -23
- package/commands/config.d.ts +1 -1
- package/commands/config.js +13 -8
- package/commands/create/api-sample.d.ts +1 -1
- package/commands/create/api-sample.js +33 -28
- package/commands/create/app.d.ts +1 -1
- package/commands/create/app.js +5 -3
- package/commands/create/function.d.ts +1 -1
- package/commands/create/function.js +11 -9
- package/commands/create/index.d.ts +1 -1
- package/commands/create/index.js +24 -19
- package/commands/create/module.d.ts +1 -1
- package/commands/create/module.js +14 -12
- package/commands/create/react-app.d.ts +1 -1
- package/commands/create/react-app.js +5 -3
- package/commands/create/template.d.ts +1 -1
- package/commands/create/template.js +14 -12
- package/commands/create/vue-app.d.ts +1 -1
- package/commands/create/vue-app.js +5 -3
- package/commands/create/webpack-serverless.d.ts +1 -1
- package/commands/create/webpack-serverless.js +5 -3
- package/commands/create/website-theme.d.ts +1 -1
- package/commands/create/website-theme.js +7 -5
- package/commands/create.d.ts +2 -2
- package/commands/create.js +35 -30
- package/commands/customObject/__tests__/create.test.js +18 -13
- package/commands/customObject/__tests__/schema.test.js +23 -18
- package/commands/customObject/create.d.ts +1 -1
- package/commands/customObject/create.js +30 -28
- package/commands/customObject/schema/__tests__/create.test.js +18 -13
- package/commands/customObject/schema/__tests__/delete.test.js +18 -13
- package/commands/customObject/schema/__tests__/fetch-all.test.js +18 -13
- package/commands/customObject/schema/__tests__/fetch.test.js +18 -13
- package/commands/customObject/schema/__tests__/list.test.js +18 -13
- package/commands/customObject/schema/__tests__/update.test.js +18 -13
- package/commands/customObject/schema/create.d.ts +1 -1
- package/commands/customObject/schema/create.js +30 -28
- package/commands/customObject/schema/delete.d.ts +1 -1
- package/commands/customObject/schema/delete.js +26 -24
- package/commands/customObject/schema/fetch-all.d.ts +1 -1
- package/commands/customObject/schema/fetch-all.js +24 -22
- package/commands/customObject/schema/fetch.d.ts +1 -1
- package/commands/customObject/schema/fetch.js +26 -24
- package/commands/customObject/schema/list.d.ts +1 -1
- package/commands/customObject/schema/list.js +15 -13
- package/commands/customObject/schema/update.d.ts +1 -1
- package/commands/customObject/schema/update.js +34 -32
- package/commands/customObject/schema.d.ts +1 -1
- package/commands/customObject/schema.js +22 -17
- package/commands/customObject.d.ts +1 -1
- package/commands/customObject.js +18 -13
- package/commands/doctor.d.ts +1 -1
- package/commands/doctor.js +33 -28
- package/commands/feedback.d.ts +1 -1
- package/commands/feedback.js +24 -19
- package/commands/fetch.d.ts +1 -1
- package/commands/fetch.js +30 -28
- package/commands/filemanager/__tests__/fetch.test.js +22 -17
- package/commands/filemanager/__tests__/upload.test.js +20 -15
- package/commands/filemanager/fetch.d.ts +1 -1
- package/commands/filemanager/fetch.js +25 -23
- package/commands/filemanager/upload.d.ts +1 -1
- package/commands/filemanager/upload.js +44 -39
- package/commands/filemanager.d.ts +1 -1
- package/commands/filemanager.js +13 -8
- package/commands/function/deploy.d.ts +1 -1
- package/commands/function/deploy.js +40 -35
- package/commands/function/list.d.ts +1 -1
- package/commands/function/list.js +29 -24
- package/commands/function/server.d.ts +1 -1
- package/commands/function/server.js +17 -15
- package/commands/function.d.ts +1 -1
- package/commands/function.js +18 -12
- package/commands/getStarted.d.ts +1 -1
- package/commands/getStarted.js +131 -140
- package/commands/hubdb/__tests__/clear.test.js +18 -13
- package/commands/hubdb/__tests__/create.test.js +18 -13
- package/commands/hubdb/__tests__/delete.test.js +18 -13
- package/commands/hubdb/__tests__/fetch.test.js +18 -13
- package/commands/hubdb/__tests__/list.test.js +28 -23
- package/commands/hubdb/clear.d.ts +1 -1
- package/commands/hubdb/clear.js +22 -20
- package/commands/hubdb/create.d.ts +1 -1
- package/commands/hubdb/create.js +35 -30
- package/commands/hubdb/delete.d.ts +1 -1
- package/commands/hubdb/delete.js +26 -24
- package/commands/hubdb/fetch.d.ts +1 -1
- package/commands/hubdb/fetch.js +19 -17
- package/commands/hubdb/list.d.ts +1 -1
- package/commands/hubdb/list.js +35 -33
- package/commands/hubdb.d.ts +1 -1
- package/commands/hubdb.js +24 -18
- package/commands/init.d.ts +1 -1
- package/commands/init.js +88 -83
- package/commands/lint.d.ts +1 -1
- package/commands/lint.js +26 -24
- package/commands/list.d.ts +1 -1
- package/commands/list.js +37 -32
- package/commands/logs.d.ts +1 -1
- package/commands/logs.js +37 -35
- package/commands/mcp/__tests__/setup.test.js +12 -7
- package/commands/mcp/__tests__/start.test.js +12 -7
- package/commands/mcp/setup.d.ts +1 -1
- package/commands/mcp/setup.js +20 -17
- package/commands/mcp/start.d.ts +5 -2
- package/commands/mcp/start.js +41 -31
- package/commands/mcp.d.ts +1 -1
- package/commands/mcp.js +12 -7
- package/commands/module/marketplace-validate.d.ts +1 -1
- package/commands/module/marketplace-validate.js +26 -21
- package/commands/module.d.ts +1 -1
- package/commands/module.js +13 -7
- package/commands/mv.d.ts +1 -1
- package/commands/mv.js +22 -20
- package/commands/open.d.ts +1 -1
- package/commands/open.js +21 -19
- package/commands/project/__tests__/add.test.js +15 -10
- package/commands/project/__tests__/create.test.js +19 -14
- package/commands/project/__tests__/deploy.test.js +143 -103
- package/commands/project/__tests__/devUnifiedFlow.test.js +157 -148
- package/commands/project/__tests__/download.test.js +19 -14
- package/commands/project/__tests__/installDeps.test.js +70 -32
- package/commands/project/__tests__/listBuilds.test.js +19 -14
- package/commands/project/__tests__/logs.test.js +94 -56
- package/commands/project/__tests__/migrate.test.js +30 -25
- package/commands/project/__tests__/migrateApp.test.js +22 -17
- package/commands/project/__tests__/open.test.js +21 -16
- package/commands/project/__tests__/profile.test.js +19 -14
- package/commands/project/__tests__/upload.test.js +23 -18
- package/commands/project/__tests__/watch.test.js +19 -14
- package/commands/project/add.d.ts +1 -1
- package/commands/project/add.js +36 -34
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/cloneApp.js +72 -67
- package/commands/project/create.d.ts +2 -2
- package/commands/project/create.js +68 -63
- package/commands/project/deploy.d.ts +3 -2
- package/commands/project/deploy.js +102 -91
- package/commands/project/dev/deprecatedFlow.d.ts +2 -2
- package/commands/project/dev/deprecatedFlow.js +58 -52
- package/commands/project/dev/index.d.ts +1 -1
- package/commands/project/dev/index.js +47 -44
- package/commands/project/dev/unifiedFlow.d.ts +3 -3
- package/commands/project/dev/unifiedFlow.js +74 -67
- package/commands/project/download.d.ts +1 -1
- package/commands/project/download.js +40 -35
- package/commands/project/installDeps.d.ts +1 -1
- package/commands/project/installDeps.js +34 -29
- package/commands/project/listBuilds.d.ts +1 -1
- package/commands/project/listBuilds.js +45 -40
- package/commands/project/logs.d.ts +1 -1
- package/commands/project/logs.js +54 -52
- package/commands/project/migrate.d.ts +1 -1
- package/commands/project/migrate.js +26 -24
- package/commands/project/migrateApp.d.ts +2 -2
- package/commands/project/migrateApp.js +20 -18
- package/commands/project/open.d.ts +1 -1
- package/commands/project/open.js +30 -25
- package/commands/project/profile/add.d.ts +1 -1
- package/commands/project/profile/add.js +73 -68
- package/commands/project/profile/delete.d.ts +1 -1
- package/commands/project/profile/delete.js +56 -51
- package/commands/project/profile.d.ts +1 -1
- package/commands/project/profile.js +14 -9
- package/commands/project/upload.d.ts +1 -1
- package/commands/project/upload.js +55 -50
- package/commands/project/validate.d.ts +1 -1
- package/commands/project/validate.js +40 -35
- package/commands/project/watch.d.ts +1 -1
- package/commands/project/watch.js +61 -59
- package/commands/project.d.ts +1 -1
- package/commands/project.js +43 -38
- package/commands/remove.d.ts +1 -1
- package/commands/remove.js +17 -15
- package/commands/sandbox/__tests__/create.test.js +20 -15
- package/commands/sandbox/__tests__/delete.test.js +20 -15
- package/commands/sandbox/create.d.ts +1 -1
- package/commands/sandbox/create.js +69 -67
- package/commands/sandbox/delete.d.ts +1 -1
- package/commands/sandbox/delete.js +96 -94
- package/commands/sandbox.d.ts +1 -1
- package/commands/sandbox.js +14 -9
- package/commands/secret/__tests__/addSecret.test.js +18 -13
- package/commands/secret/__tests__/deleteSecret.test.js +18 -13
- package/commands/secret/__tests__/listSecret.test.js +18 -13
- package/commands/secret/__tests__/updateSecret.test.js +18 -13
- package/commands/secret/addSecret.d.ts +1 -1
- package/commands/secret/addSecret.js +28 -26
- package/commands/secret/deleteSecret.d.ts +1 -1
- package/commands/secret/deleteSecret.js +29 -27
- package/commands/secret/listSecret.d.ts +1 -1
- package/commands/secret/listSecret.js +21 -19
- package/commands/secret/updateSecret.d.ts +1 -1
- package/commands/secret/updateSecret.js +27 -25
- package/commands/secret.d.ts +1 -1
- package/commands/secret.js +18 -13
- package/commands/testAccount/__tests__/create.test.js +22 -17
- package/commands/testAccount/__tests__/createConfig.test.js +11 -9
- package/commands/testAccount/__tests__/delete.test.js +20 -15
- package/commands/testAccount/create.d.ts +1 -1
- package/commands/testAccount/create.js +57 -62
- package/commands/testAccount/createConfig.d.ts +1 -3
- package/commands/testAccount/createConfig.js +47 -43
- package/commands/testAccount/delete.d.ts +1 -1
- package/commands/testAccount/delete.js +19 -17
- package/commands/testAccount.d.ts +1 -1
- package/commands/testAccount.js +15 -10
- package/commands/theme/__tests__/generate-selectors.test.js +12 -7
- package/commands/theme/__tests__/marketplace-validate.test.js +19 -14
- package/commands/theme/__tests__/preview.test.js +17 -12
- package/commands/theme/generate-selectors.d.ts +1 -1
- package/commands/theme/generate-selectors.js +28 -23
- package/commands/theme/marketplace-validate.d.ts +1 -1
- package/commands/theme/marketplace-validate.js +24 -19
- package/commands/theme/preview.d.ts +1 -1
- package/commands/theme/preview.js +65 -60
- package/commands/theme.d.ts +1 -1
- package/commands/theme.js +16 -11
- package/commands/upload.d.ts +1 -1
- package/commands/upload.js +82 -77
- package/commands/watch.d.ts +1 -1
- package/commands/watch.js +51 -45
- package/lang/en.d.ts +62 -23
- package/lang/en.js +434 -389
- package/lang/en.lyaml +0 -26
- package/lib/__tests__/accountTypes.test.js +22 -20
- package/lib/__tests__/buildAccount.test.js +90 -27
- package/lib/__tests__/commonOpts.test.js +22 -20
- package/lib/__tests__/dependencyManagement.test.js +51 -46
- package/lib/__tests__/developerTestAccounts.test.js +62 -27
- package/lib/__tests__/hasFeature.test.js +8 -6
- package/lib/__tests__/npm.test.js +20 -15
- package/lib/__tests__/oauth.test.js +28 -23
- package/lib/__tests__/parsing.test.js +20 -18
- package/lib/__tests__/polling.test.js +26 -24
- package/lib/__tests__/process.test.js +19 -14
- package/lib/__tests__/projectProfiles.test.js +39 -34
- package/lib/__tests__/sandboxSync.test.js +35 -30
- package/lib/__tests__/sandboxes.test.js +31 -29
- package/lib/__tests__/serverlessLogs.test.js +13 -8
- package/lib/__tests__/usageTracking.test.js +42 -47
- package/lib/__tests__/validation.test.js +20 -18
- package/lib/__tests__/yargsUtils.test.js +41 -6
- package/lib/accountTypes.js +34 -24
- package/lib/app/__tests__/migrate.test.js +99 -94
- package/lib/app/__tests__/migrate_legacy.test.js +31 -29
- package/lib/app/migrate.d.ts +3 -3
- package/lib/app/migrate.js +145 -127
- package/lib/app/migrate_legacy.d.ts +1 -1
- package/lib/app/migrate_legacy.js +78 -72
- package/lib/app/urls.js +9 -5
- package/lib/buildAccount.d.ts +8 -2
- package/lib/buildAccount.js +119 -61
- package/lib/commonOpts.d.ts +1 -1
- package/lib/commonOpts.js +59 -42
- package/lib/configMigrate.js +38 -34
- package/lib/configOptions.js +40 -34
- package/lib/constants.js +34 -31
- package/lib/customObject.js +6 -2
- package/lib/dependencyManagement.js +45 -37
- package/lib/developerTestAccounts.d.ts +1 -1
- package/lib/developerTestAccounts.js +39 -34
- package/lib/doctor/Diagnosis.d.ts +1 -1
- package/lib/doctor/Diagnosis.js +29 -25
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +1 -1
- package/lib/doctor/DiagnosticInfoBuilder.js +37 -30
- package/lib/doctor/Doctor.d.ts +1 -1
- package/lib/doctor/Doctor.js +101 -94
- package/lib/doctor/__tests__/Diagnosis.test.js +14 -9
- package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.js +34 -29
- package/lib/doctor/__tests__/Doctor.test.js +26 -24
- package/lib/enums/exitCodes.js +4 -1
- package/lib/errorHandlers/index.js +41 -32
- package/lib/errorHandlers/suppressError.d.ts +1 -1
- package/lib/errorHandlers/suppressError.js +31 -28
- package/lib/filesystem.js +15 -8
- package/lib/generateSelectors.js +29 -18
- package/lib/hasFeature.d.ts +1 -1
- package/lib/hasFeature.js +6 -3
- package/lib/interpolation.js +18 -11
- package/lib/lang.d.ts +1 -1
- package/lib/lang.js +27 -22
- package/lib/links.js +24 -16
- package/lib/marketplaceValidate.js +39 -29
- package/lib/mcp/setup.js +105 -72
- package/lib/middleware/__test__/configMiddleware.test.js +55 -20
- package/lib/middleware/__test__/gitMiddleware.test.js +42 -7
- package/lib/middleware/__test__/notificationsMiddleware.test.js +4 -2
- package/lib/middleware/__test__/requestMiddleware.test.js +11 -6
- package/lib/middleware/__test__/utils.test.js +11 -9
- package/lib/middleware/__test__/yargsChecksMiddleware.test.js +44 -9
- package/lib/middleware/autoUpdateMiddleware.js +40 -33
- package/lib/middleware/configMiddleware.js +42 -36
- package/lib/middleware/fireAlarmMiddleware.js +18 -12
- package/lib/middleware/gitMiddleware.js +8 -5
- package/lib/middleware/notificationsMiddleware.js +23 -16
- package/lib/middleware/requestMiddleware.js +10 -4
- package/lib/middleware/utils.js +4 -1
- package/lib/middleware/yargsChecksMiddleware.js +13 -10
- package/lib/npm.js +23 -14
- package/lib/oauth.js +35 -29
- package/lib/parsing.js +6 -3
- package/lib/polling.js +15 -11
- package/lib/process.js +19 -11
- package/lib/projectProfiles.d.ts +2 -2
- package/lib/projectProfiles.js +42 -32
- package/lib/projects/ProjectLogsManager.js +21 -18
- package/lib/projects/__tests__/AppDevModeInterface.test.js +145 -140
- package/lib/projects/__tests__/LocalDevProcess.test.js +73 -68
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +37 -32
- package/lib/projects/__tests__/ProjectLogsManager.test.js +58 -56
- package/lib/projects/__tests__/buildAndDeploy.test.js +9 -7
- package/lib/projects/__tests__/components.test.js +14 -9
- package/lib/projects/__tests__/projects.test.js +40 -35
- package/lib/projects/__tests__/structure.test.js +81 -43
- package/lib/projects/add/__tests__/legacyAddComponent.test.js +28 -26
- package/lib/projects/add/__tests__/v3AddComponent.test.js +30 -25
- package/lib/projects/add/legacyAddComponent.d.ts +1 -1
- package/lib/projects/add/legacyAddComponent.js +30 -24
- package/lib/projects/add/v3AddComponent.d.ts +1 -1
- package/lib/projects/add/v3AddComponent.js +42 -36
- package/lib/projects/buildAndDeploy.d.ts +1 -1
- package/lib/projects/buildAndDeploy.js +97 -88
- package/lib/projects/components.js +25 -19
- package/lib/projects/config.d.ts +1 -1
- package/lib/projects/config.js +41 -32
- package/lib/projects/create/__tests__/legacy.test.js +57 -22
- package/lib/projects/create/__tests__/v3.test.js +7 -5
- package/lib/projects/create/index.d.ts +3 -3
- package/lib/projects/create/index.js +22 -19
- package/lib/projects/create/legacy.d.ts +1 -1
- package/lib/projects/create/legacy.js +31 -25
- package/lib/projects/create/v3.d.ts +3 -3
- package/lib/projects/create/v3.js +59 -49
- package/lib/projects/ensureProjectExists.js +37 -31
- package/lib/projects/localDev/AppDevModeInterface.d.ts +3 -3
- package/lib/projects/localDev/AppDevModeInterface.js +60 -58
- package/lib/projects/localDev/DevServerManager.d.ts +1 -1
- package/lib/projects/localDev/DevServerManager.js +24 -24
- package/lib/projects/localDev/DevServerManagerV2.d.ts +2 -2
- package/lib/projects/localDev/DevServerManagerV2.js +20 -17
- package/lib/projects/localDev/LocalDevLogger.d.ts +1 -1
- package/lib/projects/localDev/LocalDevLogger.js +64 -59
- package/lib/projects/localDev/LocalDevManager.d.ts +1 -1
- package/lib/projects/localDev/LocalDevManager.js +111 -106
- package/lib/projects/localDev/LocalDevProcess.d.ts +4 -4
- package/lib/projects/localDev/LocalDevProcess.js +30 -25
- package/lib/projects/localDev/LocalDevState.d.ts +3 -3
- package/lib/projects/localDev/LocalDevState.js +5 -3
- package/lib/projects/localDev/LocalDevWatcher.d.ts +1 -1
- package/lib/projects/localDev/LocalDevWatcher.js +11 -6
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +1 -1
- package/lib/projects/localDev/LocalDevWebsocketServer.js +27 -25
- package/lib/projects/localDev/helpers.d.ts +4 -4
- package/lib/projects/localDev/helpers.js +174 -156
- package/lib/projects/structure.d.ts +4 -4
- package/lib/projects/structure.js +78 -32
- package/lib/projects/ui.js +13 -10
- package/lib/projects/upload.d.ts +3 -2
- package/lib/projects/upload.js +65 -55
- package/lib/projects/urls.js +24 -14
- package/lib/projects/watch.d.ts +1 -1
- package/lib/projects/watch.js +54 -48
- package/lib/prompts/__tests__/downloadProjectPrompt.test.js +11 -9
- package/lib/prompts/__tests__/projectsLogsPrompt.test.js +16 -11
- package/lib/prompts/accountNamePrompt.d.ts +1 -1
- package/lib/prompts/accountNamePrompt.js +31 -26
- package/lib/prompts/accountsPrompt.js +15 -12
- package/lib/prompts/cmsFieldPrompt.js +19 -13
- package/lib/prompts/createApiSamplePrompt.d.ts +1 -1
- package/lib/prompts/createApiSamplePrompt.js +12 -9
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +11 -10
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +88 -43
- package/lib/prompts/createFunctionPrompt.js +20 -17
- package/lib/prompts/createModulePrompt.js +15 -12
- package/lib/prompts/createTemplatePrompt.js +8 -5
- package/lib/prompts/downloadProjectPrompt.js +20 -17
- package/lib/prompts/installAppPrompt.js +26 -19
- package/lib/prompts/personalAccessKeyPrompt.d.ts +2 -2
- package/lib/prompts/personalAccessKeyPrompt.js +47 -40
- package/lib/prompts/previewPrompt.js +22 -15
- package/lib/prompts/projectAddPrompt.d.ts +1 -1
- package/lib/prompts/projectAddPrompt.js +18 -14
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +1 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +54 -48
- package/lib/prompts/projectNameAndDestPrompt.d.ts +1 -1
- package/lib/prompts/projectNameAndDestPrompt.js +29 -22
- package/lib/prompts/projectNamePrompt.js +14 -11
- package/lib/prompts/projectsLogsPrompt.js +8 -5
- package/lib/prompts/promptUtils.d.ts +1 -1
- package/lib/prompts/promptUtils.js +87 -70
- package/lib/prompts/sandboxesPrompt.d.ts +1 -1
- package/lib/prompts/sandboxesPrompt.js +30 -26
- package/lib/prompts/secretPrompt.js +15 -10
- package/lib/prompts/selectAppPrompt.js +14 -11
- package/lib/prompts/selectHubDBTablePrompt.js +30 -24
- package/lib/prompts/selectProjectTemplatePrompt.d.ts +1 -1
- package/lib/prompts/selectProjectTemplatePrompt.js +13 -10
- package/lib/prompts/selectPublicAppForMigrationPrompt.js +25 -22
- package/lib/prompts/setAsDefaultAccountPrompt.js +16 -13
- package/lib/prompts/uploadPrompt.js +17 -11
- package/lib/sandboxSync.d.ts +1 -1
- package/lib/sandboxSync.js +65 -58
- package/lib/sandboxes.d.ts +1 -1
- package/lib/sandboxes.js +76 -68
- package/lib/schema.js +23 -12
- package/lib/serverlessLogs.js +52 -45
- package/lib/testUtils.js +8 -4
- package/lib/ui/SpinniesManager.d.ts +1 -1
- package/lib/ui/SpinniesManager.js +34 -29
- package/lib/ui/boxen.js +14 -11
- package/lib/ui/git.js +20 -14
- package/lib/ui/index.js +74 -56
- package/lib/ui/logger.js +13 -10
- package/lib/ui/serverlessFunctionLogs.js +20 -14
- package/lib/ui/spinniesUtils.js +39 -24
- package/lib/ui/supportHyperlinks.js +6 -3
- package/lib/ui/supportsColor.js +17 -11
- package/lib/ui/table.js +13 -6
- package/lib/upload.js +21 -15
- package/lib/usageTracking.d.ts +11 -0
- package/lib/usageTracking.js +95 -95
- package/lib/utils/hasFlag.js +8 -2
- package/lib/validation.js +87 -48
- package/lib/yargsUtils.d.ts +1 -1
- package/lib/yargsUtils.js +16 -13
- package/mcp-server/server.js +8 -6
- package/mcp-server/tools/index.js +16 -13
- package/mcp-server/tools/project/AddFeatureToProject.d.ts +1 -1
- package/mcp-server/tools/project/AddFeatureToProject.js +41 -34
- package/mcp-server/tools/project/CreateProjectTool.d.ts +3 -3
- package/mcp-server/tools/project/CreateProjectTool.js +52 -45
- package/mcp-server/tools/project/DeployProject.d.ts +1 -1
- package/mcp-server/tools/project/DeployProject.js +24 -17
- package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +1 -1
- package/mcp-server/tools/project/GuidedWalkthroughTool.js +27 -20
- package/mcp-server/tools/project/UploadProjectTools.d.ts +1 -1
- package/mcp-server/tools/project/UploadProjectTools.js +21 -11
- package/mcp-server/tools/project/ValidateProjectTool.d.ts +1 -1
- package/mcp-server/tools/project/ValidateProjectTool.js +19 -12
- package/mcp-server/tools/project/__tests__/AddFeatureToProject.test.js +15 -12
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +16 -13
- package/mcp-server/tools/project/__tests__/DeployProject.test.js +9 -6
- package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.js +7 -4
- package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +7 -4
- package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.js +7 -4
- package/mcp-server/tools/project/constants.js +9 -3
- package/mcp-server/types.js +5 -1
- package/mcp-server/utils/__tests__/command.test.js +11 -9
- package/mcp-server/utils/__tests__/project.test.js +26 -18
- package/mcp-server/utils/command.d.ts +1 -1
- package/mcp-server/utils/command.js +11 -4
- package/mcp-server/utils/content.d.ts +1 -1
- package/mcp-server/utils/content.js +6 -2
- package/mcp-server/utils/project.js +17 -8
- package/mcp-server/utils/toolUsageTracking.d.ts +1 -0
- package/mcp-server/utils/toolUsageTracking.js +25 -0
- package/package.json +13 -17
- package/types/{cms.d.ts → Cms.d.ts} +1 -1
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +4 -4
- package/types/LocalDev.js +2 -1
- package/types/ProjectComponents.d.ts +2 -2
- package/types/ProjectComponents.js +2 -1
- package/types/Projects.d.ts +1 -1
- package/types/Projects.js +5 -2
- package/types/Prompts.js +2 -1
- package/types/Sandboxes.js +2 -0
- package/types/Yargs.js +2 -1
- package/types/sandboxes.js +0 -1
- /package/{types/cms.js → commands/app/__tests__/install.test.d.ts} +0 -0
- /package/types/{sandboxes.d.ts → Sandboxes.d.ts} +0 -0
|
@@ -1,79 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateProjectTool = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const constants_1 = require("../../../lib/constants");
|
|
7
|
+
const command_1 = require("../../utils/command");
|
|
8
|
+
const v3_1 = require("../../../lib/projects/create/v3");
|
|
9
|
+
const constants_2 = require("./constants");
|
|
10
|
+
const project_1 = require("../../utils/project");
|
|
11
|
+
const content_1 = require("../../utils/content");
|
|
12
|
+
const toolUsageTracking_1 = require("../../utils/toolUsageTracking");
|
|
9
13
|
const inputSchema = {
|
|
10
|
-
absoluteCurrentWorkingDirectory,
|
|
11
|
-
name: z
|
|
14
|
+
absoluteCurrentWorkingDirectory: constants_2.absoluteCurrentWorkingDirectory,
|
|
15
|
+
name: zod_1.z
|
|
12
16
|
.string()
|
|
13
17
|
.describe('The name of the project to be created. This name is how your project will appear in HubSpot. If not specified by the user, do not choose for them. Changing this is potentially destructive.')
|
|
14
18
|
.optional(),
|
|
15
|
-
destination: z
|
|
19
|
+
destination: zod_1.z
|
|
16
20
|
.string()
|
|
17
21
|
.describe('Relative path to the directory the project will be created in. DO NOT use the current directory unless the user has explicitly stated to do so.'),
|
|
18
|
-
projectBase: z
|
|
19
|
-
.union([z.literal(EMPTY_PROJECT), z.literal(PROJECT_WITH_APP)])
|
|
22
|
+
projectBase: zod_1.z
|
|
23
|
+
.union([zod_1.z.literal(v3_1.EMPTY_PROJECT), zod_1.z.literal(v3_1.PROJECT_WITH_APP)])
|
|
20
24
|
.describe('Empty will create an empty project, and app will create a project with an app inside of it.'),
|
|
21
|
-
distribution: z
|
|
22
|
-
.optional(z.union([
|
|
23
|
-
z.literal(APP_DISTRIBUTION_TYPES.MARKETPLACE),
|
|
24
|
-
z.literal(APP_DISTRIBUTION_TYPES.PRIVATE),
|
|
25
|
+
distribution: zod_1.z
|
|
26
|
+
.optional(zod_1.z.union([
|
|
27
|
+
zod_1.z.literal(constants_1.APP_DISTRIBUTION_TYPES.MARKETPLACE),
|
|
28
|
+
zod_1.z.literal(constants_1.APP_DISTRIBUTION_TYPES.PRIVATE),
|
|
25
29
|
]))
|
|
26
30
|
.describe('Private is used if you do not wish to distribute your application on the HubSpot marketplace. If not specified by the user, do not choose for them. This cannot be changed after a project is uploaded.'),
|
|
27
|
-
auth: z
|
|
28
|
-
.optional(z.union([
|
|
29
|
-
z.literal(APP_AUTH_TYPES.STATIC),
|
|
30
|
-
z.literal(APP_AUTH_TYPES.OAUTH),
|
|
31
|
+
auth: zod_1.z
|
|
32
|
+
.optional(zod_1.z.union([
|
|
33
|
+
zod_1.z.literal(constants_1.APP_AUTH_TYPES.STATIC),
|
|
34
|
+
zod_1.z.literal(constants_1.APP_AUTH_TYPES.OAUTH),
|
|
31
35
|
]))
|
|
32
36
|
.describe('Static uses a static non changing authentication token, and is only available for private distribution. If not specified by the user, do not choose for them. This cannot be changed after a project is uploaded.')
|
|
33
37
|
.optional(),
|
|
34
|
-
features: z
|
|
35
|
-
.array(z
|
|
38
|
+
features: zod_1.z
|
|
39
|
+
.array(zod_1.z
|
|
36
40
|
.union([
|
|
37
|
-
z.literal('card'),
|
|
38
|
-
z.literal('settings'),
|
|
39
|
-
z.literal('app-function'),
|
|
40
|
-
z.literal('webhooks'),
|
|
41
|
+
zod_1.z.literal('card'),
|
|
42
|
+
zod_1.z.literal('settings'),
|
|
43
|
+
zod_1.z.literal('app-function'),
|
|
44
|
+
zod_1.z.literal('webhooks'),
|
|
41
45
|
])
|
|
42
46
|
.describe('The features to include in the project, multiple options can be selected'))
|
|
43
47
|
.optional(),
|
|
44
48
|
};
|
|
45
49
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
46
|
-
const inputSchemaZodObject = z.object({ ...inputSchema });
|
|
47
|
-
|
|
50
|
+
const inputSchemaZodObject = zod_1.z.object({ ...inputSchema });
|
|
51
|
+
const toolName = 'create-hubspot-project';
|
|
52
|
+
class CreateProjectTool extends types_1.Tool {
|
|
48
53
|
constructor(mcpServer) {
|
|
49
54
|
super(mcpServer);
|
|
50
55
|
}
|
|
51
56
|
async handler({ name, destination, projectBase, distribution, auth, features, absoluteCurrentWorkingDirectory, }) {
|
|
52
|
-
|
|
57
|
+
await (0, toolUsageTracking_1.trackToolUsage)(toolName);
|
|
58
|
+
let command = (0, command_1.addFlag)('hs project create', 'platform-version', '2025.2');
|
|
53
59
|
const content = [];
|
|
54
60
|
if (name) {
|
|
55
|
-
command = addFlag(command, 'name', name);
|
|
61
|
+
command = (0, command_1.addFlag)(command, 'name', name);
|
|
56
62
|
}
|
|
57
63
|
else {
|
|
58
|
-
content.push(formatTextContent(`Ask the user what they would like to name the project.`));
|
|
64
|
+
content.push((0, content_1.formatTextContent)(`Ask the user what they would like to name the project.`));
|
|
59
65
|
}
|
|
60
66
|
if (destination) {
|
|
61
|
-
command = addFlag(command, 'dest', destination);
|
|
67
|
+
command = (0, command_1.addFlag)(command, 'dest', destination);
|
|
62
68
|
}
|
|
63
69
|
if (projectBase) {
|
|
64
|
-
command = addFlag(command, 'project-base', projectBase);
|
|
70
|
+
command = (0, command_1.addFlag)(command, 'project-base', projectBase);
|
|
65
71
|
}
|
|
66
72
|
if (distribution) {
|
|
67
|
-
command = addFlag(command, 'distribution', distribution);
|
|
73
|
+
command = (0, command_1.addFlag)(command, 'distribution', distribution);
|
|
68
74
|
}
|
|
69
|
-
else if (projectBase === PROJECT_WITH_APP) {
|
|
70
|
-
content.push(formatTextContent(`Ask the user how they would you like to distribute the application? Options are ${APP_DISTRIBUTION_TYPES.MARKETPLACE} and ${APP_DISTRIBUTION_TYPES.PRIVATE}`));
|
|
75
|
+
else if (projectBase === v3_1.PROJECT_WITH_APP) {
|
|
76
|
+
content.push((0, content_1.formatTextContent)(`Ask the user how they would you like to distribute the application? Options are ${constants_1.APP_DISTRIBUTION_TYPES.MARKETPLACE} and ${constants_1.APP_DISTRIBUTION_TYPES.PRIVATE}`));
|
|
71
77
|
}
|
|
72
78
|
if (auth) {
|
|
73
|
-
command = addFlag(command, 'auth', auth);
|
|
79
|
+
command = (0, command_1.addFlag)(command, 'auth', auth);
|
|
74
80
|
}
|
|
75
|
-
else if (projectBase === PROJECT_WITH_APP) {
|
|
76
|
-
content.push(formatTextContent(`Ask the user which auth type they would like to use? Options are ${APP_AUTH_TYPES.STATIC} and ${APP_AUTH_TYPES.OAUTH}`));
|
|
81
|
+
else if (projectBase === v3_1.PROJECT_WITH_APP) {
|
|
82
|
+
content.push((0, content_1.formatTextContent)(`Ask the user which auth type they would like to use? Options are ${constants_1.APP_AUTH_TYPES.STATIC} and ${constants_1.APP_AUTH_TYPES.OAUTH}`));
|
|
77
83
|
}
|
|
78
84
|
if (content.length > 0) {
|
|
79
85
|
return {
|
|
@@ -81,20 +87,21 @@ export class CreateProjectTool extends Tool {
|
|
|
81
87
|
};
|
|
82
88
|
}
|
|
83
89
|
// Always pass features, even if it is an empty array to bypass the prompts
|
|
84
|
-
command = addFlag(command, 'features', features || []);
|
|
90
|
+
command = (0, command_1.addFlag)(command, 'features', features || []);
|
|
85
91
|
try {
|
|
86
|
-
const { stdout, stderr } = await runCommandInDir(absoluteCurrentWorkingDirectory, command);
|
|
87
|
-
return formatTextContents(stdout, stderr);
|
|
92
|
+
const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteCurrentWorkingDirectory, command);
|
|
93
|
+
return (0, content_1.formatTextContents)(stdout, stderr);
|
|
88
94
|
}
|
|
89
95
|
catch (error) {
|
|
90
|
-
return formatTextContents(error instanceof Error ? error.message : `${error}`);
|
|
96
|
+
return (0, content_1.formatTextContents)(error instanceof Error ? error.message : `${error}`);
|
|
91
97
|
}
|
|
92
98
|
}
|
|
93
99
|
register() {
|
|
94
|
-
return this.mcpServer.registerTool(
|
|
100
|
+
return this.mcpServer.registerTool(toolName, {
|
|
95
101
|
title: 'Create HubSpot Project',
|
|
96
102
|
description: 'Creates a HubSpot project with the provided name and outputs it in the provided destination',
|
|
97
103
|
inputSchema,
|
|
98
104
|
}, this.handler);
|
|
99
105
|
}
|
|
100
106
|
}
|
|
107
|
+
exports.CreateProjectTool = CreateProjectTool;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextContentResponse, Tool } from '../../types
|
|
1
|
+
import { TextContentResponse, Tool } from '../../types';
|
|
2
2
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
declare const inputSchemaZodObject: z.ZodObject<{
|
|
@@ -1,46 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeployProject = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const command_1 = require("../../utils/command");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
const project_1 = require("../../utils/project");
|
|
9
|
+
const content_1 = require("../../utils/content");
|
|
10
|
+
const toolUsageTracking_1 = require("../../utils/toolUsageTracking");
|
|
7
11
|
const inputSchema = {
|
|
8
|
-
absoluteProjectPath,
|
|
9
|
-
buildNumber: z
|
|
10
|
-
.optional(z.number())
|
|
12
|
+
absoluteProjectPath: constants_1.absoluteProjectPath,
|
|
13
|
+
buildNumber: zod_1.z
|
|
14
|
+
.optional(zod_1.z.number())
|
|
11
15
|
.describe('The build number to be deployed. This can be found in the project details page using `hs project open`. If no build number is specified, the most recent build is deployed'),
|
|
12
16
|
};
|
|
13
17
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
-
const inputSchemaZodObject = z.object({
|
|
18
|
+
const inputSchemaZodObject = zod_1.z.object({
|
|
15
19
|
...inputSchema,
|
|
16
20
|
});
|
|
17
|
-
|
|
21
|
+
const toolName = 'deploy-hubspot-project';
|
|
22
|
+
class DeployProject extends types_1.Tool {
|
|
18
23
|
constructor(mcpServer) {
|
|
19
24
|
super(mcpServer);
|
|
20
25
|
}
|
|
21
26
|
async handler({ absoluteProjectPath, buildNumber, }) {
|
|
27
|
+
await (0, toolUsageTracking_1.trackToolUsage)(toolName);
|
|
22
28
|
let command = `hs project deploy`;
|
|
23
29
|
const content = [];
|
|
24
30
|
if (!buildNumber) {
|
|
25
|
-
const { stdout } = await runCommandInDir(absoluteProjectPath, `hs project list-builds --limit 100`);
|
|
26
|
-
content.push(formatTextContent(`Ask the user which build number they would like to deploy? Build information: ${stdout}`));
|
|
31
|
+
const { stdout } = await (0, project_1.runCommandInDir)(absoluteProjectPath, `hs project list-builds --limit 100`);
|
|
32
|
+
content.push((0, content_1.formatTextContent)(`Ask the user which build number they would like to deploy? Build information: ${stdout}`));
|
|
27
33
|
}
|
|
28
34
|
else {
|
|
29
|
-
command = addFlag(command, 'build', buildNumber);
|
|
35
|
+
command = (0, command_1.addFlag)(command, 'build', buildNumber);
|
|
30
36
|
}
|
|
31
37
|
if (content.length) {
|
|
32
38
|
return {
|
|
33
39
|
content,
|
|
34
40
|
};
|
|
35
41
|
}
|
|
36
|
-
const { stdout, stderr } = await runCommandInDir(absoluteProjectPath, command);
|
|
37
|
-
return formatTextContents(stdout, stderr);
|
|
42
|
+
const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, command);
|
|
43
|
+
return (0, content_1.formatTextContents)(stdout, stderr);
|
|
38
44
|
}
|
|
39
45
|
register() {
|
|
40
|
-
return this.mcpServer.registerTool(
|
|
46
|
+
return this.mcpServer.registerTool(toolName, {
|
|
41
47
|
title: 'Deploy a build of HubSpot Project',
|
|
42
48
|
description: 'Takes a build number and a project name and deploys that build of the project. DO NOT run this tool unless the user specifies they would like to deploy the project.',
|
|
43
49
|
inputSchema,
|
|
44
50
|
}, this.handler);
|
|
45
51
|
}
|
|
46
52
|
}
|
|
53
|
+
exports.DeployProject = DeployProject;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextContentResponse, Tool } from '../../types
|
|
1
|
+
import { TextContentResponse, Tool } from '../../types';
|
|
2
2
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
declare const inputSchemaZodObject: z.ZodObject<{
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GuidedWalkthroughTool = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const command_1 = require("../../utils/command");
|
|
7
|
+
const content_1 = require("../../utils/content");
|
|
8
|
+
const toolUsageTracking_1 = require("../../utils/toolUsageTracking");
|
|
5
9
|
const nextCommands = {
|
|
6
10
|
'hs init': 'hs auth',
|
|
7
11
|
'hs auth': 'hs project create',
|
|
@@ -9,42 +13,44 @@ const nextCommands = {
|
|
|
9
13
|
'hs project upload': 'hs project dev',
|
|
10
14
|
};
|
|
11
15
|
const inputSchema = {
|
|
12
|
-
command: z
|
|
16
|
+
command: zod_1.z
|
|
13
17
|
.union([
|
|
14
|
-
z.literal('hs init'),
|
|
15
|
-
z.literal('hs auth'),
|
|
16
|
-
z.literal('hs project create'),
|
|
17
|
-
z.literal('hs project upload'),
|
|
18
|
+
zod_1.z.literal('hs init'),
|
|
19
|
+
zod_1.z.literal('hs auth'),
|
|
20
|
+
zod_1.z.literal('hs project create'),
|
|
21
|
+
zod_1.z.literal('hs project upload'),
|
|
18
22
|
])
|
|
19
23
|
.describe('The command to learn more about. Start with `hs init`')
|
|
20
24
|
.optional(),
|
|
21
25
|
};
|
|
22
26
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
|
-
const inputSchemaZodObject = z.object({
|
|
27
|
+
const inputSchemaZodObject = zod_1.z.object({
|
|
24
28
|
...inputSchema,
|
|
25
29
|
});
|
|
26
|
-
|
|
30
|
+
const toolName = 'guided-walkthrough-hubspot-cli';
|
|
31
|
+
class GuidedWalkthroughTool extends types_1.Tool {
|
|
27
32
|
constructor(mcpServer) {
|
|
28
33
|
super(mcpServer);
|
|
29
34
|
}
|
|
30
35
|
async handler({ command }) {
|
|
36
|
+
await (0, toolUsageTracking_1.trackToolUsage)(toolName);
|
|
31
37
|
if (command) {
|
|
32
|
-
const { stdout } = await execAsync(`${command} --help`);
|
|
33
|
-
return formatTextContents(`Display this help output for the user amd wait for them to acknowledge: ${stdout}. ${nextCommands[command] ? `Once they are ready, A good command to look at next is ${nextCommands[command]}` : ''}`);
|
|
38
|
+
const { stdout } = await (0, command_1.execAsync)(`${command} --help`);
|
|
39
|
+
return (0, content_1.formatTextContents)(`Display this help output for the user amd wait for them to acknowledge: ${stdout}. ${nextCommands[command] ? `Once they are ready, A good command to look at next is ${nextCommands[command]}` : ''}`);
|
|
34
40
|
}
|
|
35
|
-
return formatTextContents('Is there another command you would like to learn more about?');
|
|
41
|
+
return (0, content_1.formatTextContents)('Is there another command you would like to learn more about?');
|
|
36
42
|
}
|
|
37
43
|
register() {
|
|
38
|
-
return this.mcpServer.registerTool(
|
|
44
|
+
return this.mcpServer.registerTool(toolName, {
|
|
39
45
|
title: 'Guided walkthrough of the CLI',
|
|
40
46
|
description: 'Give the user a guided walkthrough of the HubSpot CLI.',
|
|
41
47
|
inputSchema: {
|
|
42
|
-
command: z
|
|
48
|
+
command: zod_1.z
|
|
43
49
|
.union([
|
|
44
|
-
z.literal('hs init'),
|
|
45
|
-
z.literal('hs auth'),
|
|
46
|
-
z.literal('hs project create'),
|
|
47
|
-
z.literal('hs project upload'),
|
|
50
|
+
zod_1.z.literal('hs init'),
|
|
51
|
+
zod_1.z.literal('hs auth'),
|
|
52
|
+
zod_1.z.literal('hs project create'),
|
|
53
|
+
zod_1.z.literal('hs project upload'),
|
|
48
54
|
])
|
|
49
55
|
.describe('The command to learn more about. Start with `hs init`')
|
|
50
56
|
.optional(),
|
|
@@ -52,3 +58,4 @@ export class GuidedWalkthroughTool extends Tool {
|
|
|
52
58
|
}, this.handler);
|
|
53
59
|
}
|
|
54
60
|
}
|
|
61
|
+
exports.GuidedWalkthroughTool = GuidedWalkthroughTool;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextContentResponse, Tool } from '../../types
|
|
1
|
+
import { TextContentResponse, Tool } from '../../types';
|
|
2
2
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import z from 'zod';
|
|
4
4
|
declare const inputSchemaZodObject: z.ZodObject<{
|
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.UploadProjectTools = void 0;
|
|
7
|
+
const types_1 = require("../../types");
|
|
8
|
+
const project_1 = require("../../utils/project");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const zod_1 = __importDefault(require("zod"));
|
|
11
|
+
const content_1 = require("../../utils/content");
|
|
12
|
+
const toolUsageTracking_1 = require("../../utils/toolUsageTracking");
|
|
6
13
|
const inputSchema = {
|
|
7
|
-
absoluteProjectPath,
|
|
14
|
+
absoluteProjectPath: constants_1.absoluteProjectPath,
|
|
8
15
|
};
|
|
9
16
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
-
const inputSchemaZodObject =
|
|
17
|
+
const inputSchemaZodObject = zod_1.default.object({
|
|
11
18
|
...inputSchema,
|
|
12
19
|
});
|
|
13
|
-
|
|
20
|
+
const toolName = 'upload-hubspot-project';
|
|
21
|
+
class UploadProjectTools extends types_1.Tool {
|
|
14
22
|
constructor(mcpServer) {
|
|
15
23
|
super(mcpServer);
|
|
16
24
|
}
|
|
17
25
|
async handler({ absoluteProjectPath, }) {
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
await (0, toolUsageTracking_1.trackToolUsage)(toolName);
|
|
27
|
+
const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, `hs project upload --force-create`);
|
|
28
|
+
return (0, content_1.formatTextContents)(stdout, stderr);
|
|
20
29
|
}
|
|
21
30
|
register() {
|
|
22
|
-
return this.mcpServer.registerTool(
|
|
31
|
+
return this.mcpServer.registerTool(toolName, {
|
|
23
32
|
title: 'Upload HubSpot Project',
|
|
24
33
|
description: 'Uploads the HubSpot project in current working directory. If the project does not exist, it will be created. MUST be ran from within the project directory. DO NOT run this tool unless the user specifies they would like to upload the project, it is potentially destructive',
|
|
25
34
|
inputSchema,
|
|
26
35
|
}, this.handler);
|
|
27
36
|
}
|
|
28
37
|
}
|
|
38
|
+
exports.UploadProjectTools = UploadProjectTools;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextContentResponse, Tool } from '../../types
|
|
1
|
+
import { TextContentResponse, Tool } from '../../types';
|
|
2
2
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
declare const inputSchemaZodObject: z.ZodObject<{
|
|
@@ -1,31 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValidateProjectTool = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
const project_1 = require("../../utils/project");
|
|
8
|
+
const content_1 = require("../../utils/content");
|
|
9
|
+
const toolUsageTracking_1 = require("../../utils/toolUsageTracking");
|
|
6
10
|
const inputSchema = {
|
|
7
|
-
absoluteProjectPath,
|
|
11
|
+
absoluteProjectPath: constants_1.absoluteProjectPath,
|
|
8
12
|
};
|
|
9
13
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
-
const inputSchemaZodObject = z.object({ ...inputSchema });
|
|
11
|
-
|
|
14
|
+
const inputSchemaZodObject = zod_1.z.object({ ...inputSchema });
|
|
15
|
+
const toolName = 'validate-hubspot-project';
|
|
16
|
+
class ValidateProjectTool extends types_1.Tool {
|
|
12
17
|
constructor(mcpServer) {
|
|
13
18
|
super(mcpServer);
|
|
14
19
|
}
|
|
15
20
|
async handler({ absoluteProjectPath, }) {
|
|
21
|
+
await (0, toolUsageTracking_1.trackToolUsage)(toolName);
|
|
16
22
|
try {
|
|
17
|
-
const { stdout, stderr } = await runCommandInDir(absoluteProjectPath, 'hs project validate');
|
|
18
|
-
return formatTextContents(stdout, stderr);
|
|
23
|
+
const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, 'hs project validate');
|
|
24
|
+
return (0, content_1.formatTextContents)(stdout, stderr);
|
|
19
25
|
}
|
|
20
26
|
catch (error) {
|
|
21
|
-
return formatTextContents(error instanceof Error ? error.message : `${error}`);
|
|
27
|
+
return (0, content_1.formatTextContents)(error instanceof Error ? error.message : `${error}`);
|
|
22
28
|
}
|
|
23
29
|
}
|
|
24
30
|
register() {
|
|
25
|
-
return this.mcpServer.registerTool(
|
|
31
|
+
return this.mcpServer.registerTool(toolName, {
|
|
26
32
|
title: 'Validate HubSpot Project',
|
|
27
33
|
description: 'Validates the HubSpot project and its configuration files. This tool does not need to be ran before uploading the project',
|
|
28
34
|
inputSchema,
|
|
29
35
|
}, this.handler);
|
|
30
36
|
}
|
|
31
37
|
}
|
|
38
|
+
exports.ValidateProjectTool = ValidateProjectTool;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AddFeatureToProject_1 = require("../AddFeatureToProject");
|
|
4
|
+
const project_1 = require("../../../utils/project");
|
|
5
|
+
const command_1 = require("../../../utils/command");
|
|
6
|
+
const constants_1 = require("../../../../lib/constants");
|
|
5
7
|
vi.mock('@modelcontextprotocol/sdk/server/mcp.js');
|
|
6
8
|
vi.mock('../../../utils/project');
|
|
7
9
|
vi.mock('../../../utils/command');
|
|
8
10
|
vi.mock('../../../../lib/constants');
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
+
vi.mock('../../../utils/toolUsageTracking');
|
|
12
|
+
const mockRunCommandInDir = project_1.runCommandInDir;
|
|
13
|
+
const mockAddFlag = command_1.addFlag;
|
|
11
14
|
describe('mcp-server/tools/project/AddFeatureToProject', () => {
|
|
12
15
|
let mockMcpServer;
|
|
13
16
|
let tool;
|
|
@@ -20,7 +23,7 @@ describe('mcp-server/tools/project/AddFeatureToProject', () => {
|
|
|
20
23
|
};
|
|
21
24
|
mockRegisteredTool = {};
|
|
22
25
|
mockMcpServer.registerTool.mockReturnValue(mockRegisteredTool);
|
|
23
|
-
tool = new AddFeatureToProject(mockMcpServer);
|
|
26
|
+
tool = new AddFeatureToProject_1.AddFeatureToProject(mockMcpServer);
|
|
24
27
|
// Mock addFlag to simulate command building
|
|
25
28
|
mockAddFlag.mockImplementation((command, flag, value) => `${command} --${flag} "${value}"`);
|
|
26
29
|
});
|
|
@@ -91,7 +94,7 @@ describe('mcp-server/tools/project/AddFeatureToProject', () => {
|
|
|
91
94
|
const input = {
|
|
92
95
|
...baseInput,
|
|
93
96
|
addApp: true,
|
|
94
|
-
distribution: APP_DISTRIBUTION_TYPES.PRIVATE,
|
|
97
|
+
distribution: constants_1.APP_DISTRIBUTION_TYPES.PRIVATE,
|
|
95
98
|
};
|
|
96
99
|
const result = await tool.handler(input);
|
|
97
100
|
expect(result.content).toEqual([
|
|
@@ -109,13 +112,13 @@ describe('mcp-server/tools/project/AddFeatureToProject', () => {
|
|
|
109
112
|
const input = {
|
|
110
113
|
...baseInput,
|
|
111
114
|
addApp: true,
|
|
112
|
-
distribution: APP_DISTRIBUTION_TYPES.MARKETPLACE,
|
|
113
|
-
auth: APP_AUTH_TYPES.OAUTH,
|
|
115
|
+
distribution: constants_1.APP_DISTRIBUTION_TYPES.MARKETPLACE,
|
|
116
|
+
auth: constants_1.APP_AUTH_TYPES.OAUTH,
|
|
114
117
|
features: ['webhooks'],
|
|
115
118
|
};
|
|
116
119
|
await tool.handler(input);
|
|
117
|
-
expect(mockAddFlag).toHaveBeenCalledWith('hs project add', 'distribution', APP_DISTRIBUTION_TYPES.MARKETPLACE);
|
|
118
|
-
expect(mockAddFlag).toHaveBeenCalledWith(expect.any(String), 'auth', APP_AUTH_TYPES.OAUTH);
|
|
120
|
+
expect(mockAddFlag).toHaveBeenCalledWith('hs project add', 'distribution', constants_1.APP_DISTRIBUTION_TYPES.MARKETPLACE);
|
|
121
|
+
expect(mockAddFlag).toHaveBeenCalledWith(expect.any(String), 'auth', constants_1.APP_AUTH_TYPES.OAUTH);
|
|
119
122
|
expect(mockAddFlag).toHaveBeenCalledWith(expect.any(String), 'features', [
|
|
120
123
|
'webhooks',
|
|
121
124
|
]);
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const CreateProjectTool_1 = require("../CreateProjectTool");
|
|
4
|
+
const project_1 = require("../../../utils/project");
|
|
5
|
+
const command_1 = require("../../../utils/command");
|
|
6
|
+
const constants_1 = require("../../../../lib/constants");
|
|
7
|
+
const v3_1 = require("../../../../lib/projects/create/v3");
|
|
6
8
|
vi.mock('@modelcontextprotocol/sdk/server/mcp.js');
|
|
7
9
|
vi.mock('../../../utils/project');
|
|
8
10
|
vi.mock('../../../utils/command');
|
|
9
11
|
vi.mock('../../../../lib/constants');
|
|
10
12
|
vi.mock('../../../../lib/projects/create/v3');
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
+
vi.mock('../../../utils/toolUsageTracking');
|
|
14
|
+
const mockRunCommandInDir = project_1.runCommandInDir;
|
|
15
|
+
const mockAddFlag = command_1.addFlag;
|
|
13
16
|
describe('mcp-server/tools/project/CreateProjectTool', () => {
|
|
14
17
|
let mockMcpServer;
|
|
15
18
|
let tool;
|
|
@@ -22,7 +25,7 @@ describe('mcp-server/tools/project/CreateProjectTool', () => {
|
|
|
22
25
|
};
|
|
23
26
|
mockRegisteredTool = {};
|
|
24
27
|
mockMcpServer.registerTool.mockReturnValue(mockRegisteredTool);
|
|
25
|
-
tool = new CreateProjectTool(mockMcpServer);
|
|
28
|
+
tool = new CreateProjectTool_1.CreateProjectTool(mockMcpServer);
|
|
26
29
|
// Mock addFlag to simulate command building
|
|
27
30
|
mockAddFlag.mockImplementation((command, flag, value) => `${command} --${flag} "${value}"`);
|
|
28
31
|
});
|
|
@@ -42,7 +45,7 @@ describe('mcp-server/tools/project/CreateProjectTool', () => {
|
|
|
42
45
|
absoluteCurrentWorkingDirectory: '/test/workspace',
|
|
43
46
|
name: 'test-project',
|
|
44
47
|
destination: './test-dest',
|
|
45
|
-
projectBase: EMPTY_PROJECT,
|
|
48
|
+
projectBase: v3_1.EMPTY_PROJECT,
|
|
46
49
|
};
|
|
47
50
|
it('should handle successful command execution', async () => {
|
|
48
51
|
mockRunCommandInDir.mockResolvedValue({
|
|
@@ -53,7 +56,7 @@ describe('mcp-server/tools/project/CreateProjectTool', () => {
|
|
|
53
56
|
expect(mockAddFlag).toHaveBeenCalledWith('hs project create', 'platform-version', '2025.2');
|
|
54
57
|
expect(mockAddFlag).toHaveBeenCalledWith(expect.any(String), 'name', 'test-project');
|
|
55
58
|
expect(mockAddFlag).toHaveBeenCalledWith(expect.any(String), 'dest', './test-dest');
|
|
56
|
-
expect(mockAddFlag).toHaveBeenCalledWith(expect.any(String), 'project-base', EMPTY_PROJECT);
|
|
59
|
+
expect(mockAddFlag).toHaveBeenCalledWith(expect.any(String), 'project-base', v3_1.EMPTY_PROJECT);
|
|
57
60
|
expect(mockRunCommandInDir).toHaveBeenCalledWith('/test/workspace', expect.any(String));
|
|
58
61
|
expect(result).toEqual({
|
|
59
62
|
content: [
|
|
@@ -73,7 +76,7 @@ describe('mcp-server/tools/project/CreateProjectTool', () => {
|
|
|
73
76
|
it('should prompt for distribution and auth when creating app project without both', async () => {
|
|
74
77
|
const input = {
|
|
75
78
|
...baseInput,
|
|
76
|
-
projectBase: PROJECT_WITH_APP,
|
|
79
|
+
projectBase: v3_1.PROJECT_WITH_APP,
|
|
77
80
|
};
|
|
78
81
|
const result = await tool.handler(input);
|
|
79
82
|
expect(result.content).toEqual([
|
|
@@ -90,8 +93,8 @@ describe('mcp-server/tools/project/CreateProjectTool', () => {
|
|
|
90
93
|
it('should prompt for auth when creating app project without auth', async () => {
|
|
91
94
|
const input = {
|
|
92
95
|
...baseInput,
|
|
93
|
-
projectBase: PROJECT_WITH_APP,
|
|
94
|
-
distribution: APP_DISTRIBUTION_TYPES.PRIVATE,
|
|
96
|
+
projectBase: v3_1.PROJECT_WITH_APP,
|
|
97
|
+
distribution: constants_1.APP_DISTRIBUTION_TYPES.PRIVATE,
|
|
95
98
|
};
|
|
96
99
|
const result = await tool.handler(input);
|
|
97
100
|
expect(result.content).toEqual([
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const DeployProject_1 = require("../DeployProject");
|
|
4
|
+
const project_1 = require("../../../utils/project");
|
|
5
|
+
const command_1 = require("../../../utils/command");
|
|
4
6
|
vi.mock('@modelcontextprotocol/sdk/server/mcp.js');
|
|
5
7
|
vi.mock('../../../utils/project');
|
|
6
8
|
vi.mock('../../../utils/command');
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
+
vi.mock('../../../utils/toolUsageTracking');
|
|
10
|
+
const mockRunCommandInDir = project_1.runCommandInDir;
|
|
11
|
+
const mockAddFlag = command_1.addFlag;
|
|
9
12
|
describe('mcp-server/tools/project/DeployProject', () => {
|
|
10
13
|
let mockMcpServer;
|
|
11
14
|
let tool;
|
|
@@ -18,7 +21,7 @@ describe('mcp-server/tools/project/DeployProject', () => {
|
|
|
18
21
|
};
|
|
19
22
|
mockRegisteredTool = {};
|
|
20
23
|
mockMcpServer.registerTool.mockReturnValue(mockRegisteredTool);
|
|
21
|
-
tool = new DeployProject(mockMcpServer);
|
|
24
|
+
tool = new DeployProject_1.DeployProject(mockMcpServer);
|
|
22
25
|
// Mock addFlag to simulate command building
|
|
23
26
|
mockAddFlag.mockImplementation((command, flag, value) => `${command} --${flag} "${value}"`);
|
|
24
27
|
});
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const GuidedWalkthroughTool_1 = require("../GuidedWalkthroughTool");
|
|
4
|
+
const command_1 = require("../../../utils/command");
|
|
3
5
|
vi.mock('@modelcontextprotocol/sdk/server/mcp.js');
|
|
4
6
|
vi.mock('../../../utils/command');
|
|
5
|
-
|
|
7
|
+
vi.mock('../../../utils/toolUsageTracking');
|
|
8
|
+
const mockExecAsync = command_1.execAsync;
|
|
6
9
|
describe('mcp-server/tools/project/GuidedWalkthroughTool', () => {
|
|
7
10
|
let mockMcpServer;
|
|
8
11
|
let tool;
|
|
@@ -15,7 +18,7 @@ describe('mcp-server/tools/project/GuidedWalkthroughTool', () => {
|
|
|
15
18
|
};
|
|
16
19
|
mockRegisteredTool = {};
|
|
17
20
|
mockMcpServer.registerTool.mockReturnValue(mockRegisteredTool);
|
|
18
|
-
tool = new GuidedWalkthroughTool(mockMcpServer);
|
|
21
|
+
tool = new GuidedWalkthroughTool_1.GuidedWalkthroughTool(mockMcpServer);
|
|
19
22
|
});
|
|
20
23
|
describe('register', () => {
|
|
21
24
|
it('should register tool with correct parameters', () => {
|