@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
package/lib/validation.js
CHANGED
|
@@ -1,113 +1,152 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.validateAccount = validateAccount;
|
|
37
|
+
exports.validateCmsPublishMode = validateCmsPublishMode;
|
|
38
|
+
exports.fileExists = fileExists;
|
|
39
|
+
exports.checkAndConvertToJson = checkAndConvertToJson;
|
|
40
|
+
const fs = __importStar(require("fs"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
43
|
+
const files_1 = require("@hubspot/local-dev-lib/constants/files");
|
|
44
|
+
const auth_1 = require("@hubspot/local-dev-lib/constants/auth");
|
|
45
|
+
const text_1 = require("@hubspot/local-dev-lib/text");
|
|
46
|
+
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
47
|
+
const oauth_1 = require("@hubspot/local-dev-lib/oauth");
|
|
48
|
+
const personalAccessKey_1 = require("@hubspot/local-dev-lib/personalAccessKey");
|
|
49
|
+
const path_1 = require("@hubspot/local-dev-lib/path");
|
|
50
|
+
const commonOpts_1 = require("./commonOpts");
|
|
51
|
+
const index_1 = require("./errorHandlers/index");
|
|
52
|
+
async function validateAccount(options) {
|
|
14
53
|
const { derivedAccountId, userProvidedAccount } = options;
|
|
15
|
-
const accountId = getAccountId(derivedAccountId);
|
|
54
|
+
const accountId = (0, config_1.getAccountId)(derivedAccountId);
|
|
16
55
|
if (!accountId) {
|
|
17
56
|
if (userProvidedAccount) {
|
|
18
|
-
logger.error(`The account "${userProvidedAccount}" could not be found in the config`);
|
|
57
|
+
logger_1.logger.error(`The account "${userProvidedAccount}" could not be found in the config`);
|
|
19
58
|
}
|
|
20
59
|
else {
|
|
21
|
-
logger.error('An account needs to be supplied either via "--account" or through setting a "defaultPortal"');
|
|
60
|
+
logger_1.logger.error('An account needs to be supplied either via "--account" or through setting a "defaultPortal"');
|
|
22
61
|
}
|
|
23
62
|
return false;
|
|
24
63
|
}
|
|
25
|
-
if (userProvidedAccount && loadConfigFromEnvironment()) {
|
|
64
|
+
if (userProvidedAccount && (0, config_1.loadConfigFromEnvironment)()) {
|
|
26
65
|
throw new Error('Cannot specify an account when environment variables are supplied. Please unset the environment variables or do not use the "--account" flag.');
|
|
27
66
|
}
|
|
28
|
-
const accountConfig = getAccountConfig(accountId);
|
|
67
|
+
const accountConfig = (0, config_1.getAccountConfig)(accountId);
|
|
29
68
|
if (!accountConfig) {
|
|
30
|
-
logger.error(`The account ${accountId} has not been configured`);
|
|
69
|
+
logger_1.logger.error(`The account ${accountId} has not been configured`);
|
|
31
70
|
return false;
|
|
32
71
|
}
|
|
33
72
|
const { authType, auth, apiKey, personalAccessKey } = accountConfig;
|
|
34
73
|
if (typeof authType === 'string' && authType !== authType.toLowerCase()) {
|
|
35
|
-
logger.error(`Invalid "authType" value "${authType}" for account "${accountId}" in config file: ${getConfigPath()}. Valid values are ${commaSeparatedValues([
|
|
36
|
-
PERSONAL_ACCESS_KEY_AUTH_METHOD,
|
|
37
|
-
OAUTH_AUTH_METHOD,
|
|
38
|
-
API_KEY_AUTH_METHOD,
|
|
74
|
+
logger_1.logger.error(`Invalid "authType" value "${authType}" for account "${accountId}" in config file: ${(0, config_1.getConfigPath)()}. Valid values are ${(0, text_1.commaSeparatedValues)([
|
|
75
|
+
auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD,
|
|
76
|
+
auth_1.OAUTH_AUTH_METHOD,
|
|
77
|
+
auth_1.API_KEY_AUTH_METHOD,
|
|
39
78
|
].map(method => method.value))}.`);
|
|
40
79
|
}
|
|
41
80
|
if (authType === 'oauth2') {
|
|
42
81
|
if (typeof auth !== 'object') {
|
|
43
|
-
logger.error(`The OAuth2 auth configuration for account ${accountId} is missing`);
|
|
82
|
+
logger_1.logger.error(`The OAuth2 auth configuration for account ${accountId} is missing`);
|
|
44
83
|
return false;
|
|
45
84
|
}
|
|
46
85
|
const { clientId, clientSecret, tokenInfo } = auth;
|
|
47
86
|
if (!clientId || !clientSecret || !tokenInfo || !tokenInfo.refreshToken) {
|
|
48
|
-
logger.error(`The OAuth2 configuration for account ${accountId} is incorrect`);
|
|
49
|
-
logger.error('Run "hs auth --type=oauth2" to reauthenticate');
|
|
87
|
+
logger_1.logger.error(`The OAuth2 configuration for account ${accountId} is incorrect`);
|
|
88
|
+
logger_1.logger.error('Run "hs auth --type=oauth2" to reauthenticate');
|
|
50
89
|
return false;
|
|
51
90
|
}
|
|
52
|
-
const oauth = getOauthManager(accountId, accountConfig);
|
|
91
|
+
const oauth = (0, oauth_1.getOauthManager)(accountId, accountConfig);
|
|
53
92
|
try {
|
|
54
93
|
let accessToken;
|
|
55
94
|
if (oauth) {
|
|
56
95
|
accessToken = await oauth.accessToken();
|
|
57
96
|
}
|
|
58
97
|
if (!accessToken) {
|
|
59
|
-
logger.error(`The OAuth2 access token could not be found for accountId ${accountId}`);
|
|
98
|
+
logger_1.logger.error(`The OAuth2 access token could not be found for accountId ${accountId}`);
|
|
60
99
|
return false;
|
|
61
100
|
}
|
|
62
101
|
}
|
|
63
102
|
catch (e) {
|
|
64
|
-
logError(e);
|
|
103
|
+
(0, index_1.logError)(e);
|
|
65
104
|
return false;
|
|
66
105
|
}
|
|
67
106
|
}
|
|
68
107
|
else if (authType === 'personalaccesskey') {
|
|
69
108
|
if (!personalAccessKey) {
|
|
70
|
-
logger.error(`The account "${accountId}" is configured to use a access key for authentication and is missing a "personalAccessKey" in the configuration file`);
|
|
109
|
+
logger_1.logger.error(`The account "${accountId}" is configured to use a access key for authentication and is missing a "personalAccessKey" in the configuration file`);
|
|
71
110
|
return false;
|
|
72
111
|
}
|
|
73
112
|
try {
|
|
74
|
-
const accessToken = await accessTokenForPersonalAccessKey(accountId);
|
|
113
|
+
const accessToken = await (0, personalAccessKey_1.accessTokenForPersonalAccessKey)(accountId);
|
|
75
114
|
if (!accessToken) {
|
|
76
|
-
logger.error(`An OAuth2 access token for account "${accountId} could not be retrieved using the "personalAccessKey" provided`);
|
|
115
|
+
logger_1.logger.error(`An OAuth2 access token for account "${accountId} could not be retrieved using the "personalAccessKey" provided`);
|
|
77
116
|
return false;
|
|
78
117
|
}
|
|
79
118
|
}
|
|
80
119
|
catch (e) {
|
|
81
|
-
logError(e);
|
|
120
|
+
(0, index_1.logError)(e);
|
|
82
121
|
return false;
|
|
83
122
|
}
|
|
84
123
|
}
|
|
85
124
|
else if (!apiKey) {
|
|
86
|
-
logger.error(`The accountId ${accountId} is missing authentication configuration`);
|
|
125
|
+
logger_1.logger.error(`The accountId ${accountId} is missing authentication configuration`);
|
|
87
126
|
return false;
|
|
88
127
|
}
|
|
89
128
|
return true;
|
|
90
129
|
}
|
|
91
|
-
|
|
92
|
-
const cmsPublishMode = getCmsPublishMode(options);
|
|
93
|
-
if (CMS_PUBLISH_MODE[cmsPublishMode]) {
|
|
130
|
+
function validateCmsPublishMode(options) {
|
|
131
|
+
const cmsPublishMode = (0, commonOpts_1.getCmsPublishMode)(options);
|
|
132
|
+
if (files_1.CMS_PUBLISH_MODE[cmsPublishMode]) {
|
|
94
133
|
return true;
|
|
95
134
|
}
|
|
96
|
-
const modesMessage = `Available CMS publish modes are: ${Object.values(CMS_PUBLISH_MODE).join(', ')}.`;
|
|
135
|
+
const modesMessage = `Available CMS publish modes are: ${Object.values(files_1.CMS_PUBLISH_MODE).join(', ')}.`;
|
|
97
136
|
if (cmsPublishMode != null) {
|
|
98
|
-
logger.error([
|
|
137
|
+
logger_1.logger.error([
|
|
99
138
|
`The CMS publish mode "${cmsPublishMode}" is invalid.`,
|
|
100
139
|
modesMessage,
|
|
101
140
|
].join(' '));
|
|
102
141
|
}
|
|
103
142
|
else {
|
|
104
|
-
logger.error(['The CMS publish mode option is missing.', modesMessage].join(' '));
|
|
143
|
+
logger_1.logger.error(['The CMS publish mode option is missing.', modesMessage].join(' '));
|
|
105
144
|
}
|
|
106
145
|
return false;
|
|
107
146
|
}
|
|
108
|
-
|
|
147
|
+
function fileExists(_path) {
|
|
109
148
|
try {
|
|
110
|
-
const absoluteSrcPath = path.resolve(getCwd(), _path);
|
|
149
|
+
const absoluteSrcPath = path.resolve((0, path_1.getCwd)(), _path);
|
|
111
150
|
if (!absoluteSrcPath)
|
|
112
151
|
return false;
|
|
113
152
|
const stats = fs.statSync(absoluteSrcPath);
|
|
@@ -121,14 +160,14 @@ export function fileExists(_path) {
|
|
|
121
160
|
}
|
|
122
161
|
return true;
|
|
123
162
|
}
|
|
124
|
-
|
|
125
|
-
const filePath = getAbsoluteFilePath(_path);
|
|
163
|
+
function checkAndConvertToJson(_path) {
|
|
164
|
+
const filePath = (0, path_1.getAbsoluteFilePath)(_path);
|
|
126
165
|
if (!fileExists(filePath)) {
|
|
127
|
-
logger.error(`The path "${_path}" is not a path to a file`);
|
|
166
|
+
logger_1.logger.error(`The path "${_path}" is not a path to a file`);
|
|
128
167
|
return null;
|
|
129
168
|
}
|
|
130
|
-
if (getExt(_path) !== 'json') {
|
|
131
|
-
logger.error(`The file "${_path}" must be a valid JSON file`);
|
|
169
|
+
if ((0, path_1.getExt)(_path) !== 'json') {
|
|
170
|
+
logger_1.logger.error(`The file "${_path}" must be a valid JSON file`);
|
|
132
171
|
return null;
|
|
133
172
|
}
|
|
134
173
|
let result;
|
|
@@ -136,7 +175,7 @@ export function checkAndConvertToJson(_path) {
|
|
|
136
175
|
result = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
137
176
|
}
|
|
138
177
|
catch (e) {
|
|
139
|
-
logger.error(`The file "${_path}" contains invalid JSON`);
|
|
178
|
+
logger_1.logger.error(`The file "${_path}" contains invalid JSON`);
|
|
140
179
|
result = null;
|
|
141
180
|
}
|
|
142
181
|
return result;
|
package/lib/yargsUtils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Argv } from 'yargs';
|
|
2
|
-
import { hasFlag } from './utils/hasFlag
|
|
2
|
+
import { hasFlag } from './utils/hasFlag';
|
|
3
3
|
export { hasFlag };
|
|
4
4
|
export declare function makeYargsBuilder<T>(callback: (yargs: Argv) => Argv<T>, command: string | string[], describe?: string, options?: {
|
|
5
5
|
useGlobalOptions?: boolean;
|
package/lib/yargsUtils.js
CHANGED
|
@@ -1,36 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasFlag = void 0;
|
|
4
|
+
exports.makeYargsBuilder = makeYargsBuilder;
|
|
5
|
+
const commonOpts_1 = require("./commonOpts");
|
|
6
|
+
const hasFlag_1 = require("./utils/hasFlag");
|
|
7
|
+
Object.defineProperty(exports, "hasFlag", { enumerable: true, get: function () { return hasFlag_1.hasFlag; } });
|
|
8
|
+
function makeYargsBuilder(callback, command, describe, options = {}) {
|
|
6
9
|
return async function (yargs) {
|
|
7
10
|
if (options.useGlobalOptions) {
|
|
8
|
-
addGlobalOptions(yargs);
|
|
11
|
+
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
9
12
|
}
|
|
10
13
|
if (options.useAccountOptions) {
|
|
11
|
-
addAccountOptions(yargs);
|
|
14
|
+
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
12
15
|
}
|
|
13
16
|
if (options.useConfigOptions) {
|
|
14
|
-
addConfigOptions(yargs);
|
|
17
|
+
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
15
18
|
}
|
|
16
19
|
if (options.useEnvironmentOptions) {
|
|
17
|
-
addUseEnvironmentOptions(yargs);
|
|
20
|
+
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
18
21
|
}
|
|
19
22
|
if (options.useTestingOptions) {
|
|
20
|
-
addTestingOptions(yargs);
|
|
23
|
+
(0, commonOpts_1.addTestingOptions)(yargs);
|
|
21
24
|
}
|
|
22
25
|
if (options.useJSONOutputOptions) {
|
|
23
|
-
addJSONOutputOptions(yargs);
|
|
26
|
+
(0, commonOpts_1.addJSONOutputOptions)(yargs);
|
|
24
27
|
}
|
|
25
28
|
if (options.useCmsPublishModeOptions) {
|
|
26
29
|
const opts = typeof options.useCmsPublishModeOptions === 'object'
|
|
27
30
|
? options.useCmsPublishModeOptions
|
|
28
31
|
: { write: true };
|
|
29
|
-
addCmsPublishModeOptions(yargs, opts);
|
|
32
|
+
(0, commonOpts_1.addCmsPublishModeOptions)(yargs, opts);
|
|
30
33
|
}
|
|
31
34
|
const result = callback(yargs);
|
|
32
35
|
// Must go last to pick up available options
|
|
33
|
-
await addCustomHelpOutput(result, command, describe);
|
|
36
|
+
await (0, commonOpts_1.addCustomHelpOutput)(result, command, describe);
|
|
34
37
|
return result;
|
|
35
38
|
};
|
|
36
39
|
}
|
package/mcp-server/server.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
4
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
5
|
+
const tools_1 = require("./tools");
|
|
6
|
+
const server = new mcp_js_1.McpServer({
|
|
5
7
|
name: 'HubSpot CLI MCP Server',
|
|
6
8
|
version: '0.0.1',
|
|
7
9
|
description: 'Helps perform tasks for local development of HubSpot projects.',
|
|
@@ -10,7 +12,7 @@ const server = new McpServer({
|
|
|
10
12
|
prompts: {},
|
|
11
13
|
},
|
|
12
14
|
});
|
|
13
|
-
registerProjectTools(server);
|
|
15
|
+
(0, tools_1.registerProjectTools)(server);
|
|
14
16
|
// Start receiving messages on stdin and sending messages on stdout
|
|
15
|
-
const transport = new StdioServerTransport();
|
|
17
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
16
18
|
server.connect(transport);
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerProjectTools = registerProjectTools;
|
|
4
|
+
const UploadProjectTools_1 = require("./project/UploadProjectTools");
|
|
5
|
+
const CreateProjectTool_1 = require("./project/CreateProjectTool");
|
|
6
|
+
const GuidedWalkthroughTool_1 = require("./project/GuidedWalkthroughTool");
|
|
7
|
+
const DeployProject_1 = require("./project/DeployProject");
|
|
8
|
+
const AddFeatureToProject_1 = require("./project/AddFeatureToProject");
|
|
9
|
+
const ValidateProjectTool_1 = require("./project/ValidateProjectTool");
|
|
10
|
+
function registerProjectTools(mcpServer) {
|
|
8
11
|
return [
|
|
9
|
-
new UploadProjectTools(mcpServer).register(),
|
|
10
|
-
new CreateProjectTool(mcpServer).register(),
|
|
11
|
-
new GuidedWalkthroughTool(mcpServer).register(),
|
|
12
|
-
new DeployProject(mcpServer).register(),
|
|
13
|
-
new AddFeatureToProject(mcpServer).register(),
|
|
14
|
-
new ValidateProjectTool(mcpServer).register(),
|
|
12
|
+
new UploadProjectTools_1.UploadProjectTools(mcpServer).register(),
|
|
13
|
+
new CreateProjectTool_1.CreateProjectTool(mcpServer).register(),
|
|
14
|
+
new GuidedWalkthroughTool_1.GuidedWalkthroughTool(mcpServer).register(),
|
|
15
|
+
new DeployProject_1.DeployProject(mcpServer).register(),
|
|
16
|
+
new AddFeatureToProject_1.AddFeatureToProject(mcpServer).register(),
|
|
17
|
+
new ValidateProjectTool_1.ValidateProjectTool(mcpServer).register(),
|
|
15
18
|
];
|
|
16
19
|
}
|
|
@@ -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,61 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddFeatureToProject = 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 constants_2 = require("./constants");
|
|
9
|
+
const project_1 = require("../../utils/project");
|
|
10
|
+
const content_1 = require("../../utils/content");
|
|
11
|
+
const toolUsageTracking_1 = require("../../utils/toolUsageTracking");
|
|
8
12
|
const inputSchema = {
|
|
9
|
-
absoluteProjectPath,
|
|
10
|
-
addApp: z
|
|
13
|
+
absoluteProjectPath: constants_2.absoluteProjectPath,
|
|
14
|
+
addApp: zod_1.z
|
|
11
15
|
.boolean()
|
|
12
16
|
.describe('Should an app be added? If there is no app in the project, an app must be added to add a feature'),
|
|
13
|
-
distribution: z
|
|
14
|
-
.optional(z.union([
|
|
15
|
-
z.literal(APP_DISTRIBUTION_TYPES.MARKETPLACE),
|
|
16
|
-
z.literal(APP_DISTRIBUTION_TYPES.PRIVATE),
|
|
17
|
+
distribution: zod_1.z
|
|
18
|
+
.optional(zod_1.z.union([
|
|
19
|
+
zod_1.z.literal(constants_1.APP_DISTRIBUTION_TYPES.MARKETPLACE),
|
|
20
|
+
zod_1.z.literal(constants_1.APP_DISTRIBUTION_TYPES.PRIVATE),
|
|
17
21
|
]))
|
|
18
22
|
.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.'),
|
|
19
|
-
auth: z
|
|
20
|
-
.optional(z.union([
|
|
21
|
-
z.literal(APP_AUTH_TYPES.STATIC),
|
|
22
|
-
z.literal(APP_AUTH_TYPES.OAUTH),
|
|
23
|
+
auth: zod_1.z
|
|
24
|
+
.optional(zod_1.z.union([
|
|
25
|
+
zod_1.z.literal(constants_1.APP_AUTH_TYPES.STATIC),
|
|
26
|
+
zod_1.z.literal(constants_1.APP_AUTH_TYPES.OAUTH),
|
|
23
27
|
]))
|
|
24
28
|
.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.'),
|
|
25
|
-
features: z
|
|
26
|
-
.array(z
|
|
29
|
+
features: zod_1.z
|
|
30
|
+
.array(zod_1.z
|
|
27
31
|
.union([
|
|
28
|
-
z.literal('card'),
|
|
29
|
-
z.literal('settings'),
|
|
30
|
-
z.literal('app-function'),
|
|
31
|
-
z.literal('webhooks'),
|
|
32
|
+
zod_1.z.literal('card'),
|
|
33
|
+
zod_1.z.literal('settings'),
|
|
34
|
+
zod_1.z.literal('app-function'),
|
|
35
|
+
zod_1.z.literal('webhooks'),
|
|
32
36
|
])
|
|
33
37
|
.describe('The features to include in the project, multiple options can be selected'))
|
|
34
38
|
.optional(),
|
|
35
39
|
};
|
|
36
40
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
37
|
-
const inputSchemaZodObject = z.object({
|
|
41
|
+
const inputSchemaZodObject = zod_1.z.object({
|
|
38
42
|
...inputSchema,
|
|
39
43
|
});
|
|
40
|
-
|
|
44
|
+
const toolName = 'add-feature-to-hubspot-project';
|
|
45
|
+
class AddFeatureToProject extends types_1.Tool {
|
|
41
46
|
constructor(mcpServer) {
|
|
42
47
|
super(mcpServer);
|
|
43
48
|
}
|
|
44
49
|
async handler({ absoluteProjectPath, distribution, auth, features, addApp, }) {
|
|
45
50
|
try {
|
|
51
|
+
await (0, toolUsageTracking_1.trackToolUsage)(toolName);
|
|
46
52
|
let command = `hs project add`;
|
|
47
53
|
const content = [];
|
|
48
54
|
if (distribution) {
|
|
49
|
-
command = addFlag(command, 'distribution', distribution);
|
|
55
|
+
command = (0, command_1.addFlag)(command, 'distribution', distribution);
|
|
50
56
|
}
|
|
51
57
|
else if (addApp) {
|
|
52
|
-
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}`));
|
|
58
|
+
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}`));
|
|
53
59
|
}
|
|
54
60
|
if (auth) {
|
|
55
|
-
command = addFlag(command, 'auth', auth);
|
|
61
|
+
command = (0, command_1.addFlag)(command, 'auth', auth);
|
|
56
62
|
}
|
|
57
63
|
else if (addApp) {
|
|
58
|
-
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}`));
|
|
64
|
+
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}`));
|
|
59
65
|
}
|
|
60
66
|
if (content.length > 0) {
|
|
61
67
|
return {
|
|
@@ -63,19 +69,20 @@ export class AddFeatureToProject extends Tool {
|
|
|
63
69
|
};
|
|
64
70
|
}
|
|
65
71
|
// If features isn't provided, pass an empty array to bypass the prompt
|
|
66
|
-
command = addFlag(command, 'features', features || []);
|
|
67
|
-
const { stdout, stderr } = await runCommandInDir(absoluteProjectPath, command);
|
|
68
|
-
return formatTextContents(stdout, stderr);
|
|
72
|
+
command = (0, command_1.addFlag)(command, 'features', features || []);
|
|
73
|
+
const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, command);
|
|
74
|
+
return (0, content_1.formatTextContents)(stdout, stderr);
|
|
69
75
|
}
|
|
70
76
|
catch (error) {
|
|
71
|
-
return formatTextContents(error instanceof Error ? error.message : `${error}`);
|
|
77
|
+
return (0, content_1.formatTextContents)(error instanceof Error ? error.message : `${error}`);
|
|
72
78
|
}
|
|
73
79
|
}
|
|
74
80
|
register() {
|
|
75
|
-
return this.mcpServer.registerTool(
|
|
81
|
+
return this.mcpServer.registerTool(toolName, {
|
|
76
82
|
title: 'Add feature to HubSpot Project',
|
|
77
83
|
description: 'Adds a feature to an existing HubSpot project',
|
|
78
84
|
inputSchema,
|
|
79
85
|
}, this.handler);
|
|
80
86
|
}
|
|
81
87
|
}
|
|
88
|
+
exports.AddFeatureToProject = AddFeatureToProject;
|
|
@@ -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<{
|
|
@@ -13,16 +13,16 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
13
13
|
projectBase: "app" | "empty";
|
|
14
14
|
absoluteCurrentWorkingDirectory: string;
|
|
15
15
|
destination: string;
|
|
16
|
-
auth?: "oauth" | "static" | undefined;
|
|
17
16
|
name?: string | undefined;
|
|
17
|
+
auth?: "oauth" | "static" | undefined;
|
|
18
18
|
distribution?: "marketplace" | "private" | undefined;
|
|
19
19
|
features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
|
|
20
20
|
}, {
|
|
21
21
|
projectBase: "app" | "empty";
|
|
22
22
|
absoluteCurrentWorkingDirectory: string;
|
|
23
23
|
destination: string;
|
|
24
|
-
auth?: "oauth" | "static" | undefined;
|
|
25
24
|
name?: string | undefined;
|
|
25
|
+
auth?: "oauth" | "static" | undefined;
|
|
26
26
|
distribution?: "marketplace" | "private" | undefined;
|
|
27
27
|
features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
|
|
28
28
|
}>;
|