@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/ui/spinniesUtils.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
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.SPINNERS = exports.VALID_STATUSES = void 0;
|
|
7
|
+
exports.purgeSpinnerOptions = purgeSpinnerOptions;
|
|
8
|
+
exports.purgeSpinnersOptions = purgeSpinnersOptions;
|
|
9
|
+
exports.colorOptions = colorOptions;
|
|
10
|
+
exports.prefixOptions = prefixOptions;
|
|
11
|
+
exports.breakText = breakText;
|
|
12
|
+
exports.getLinesLength = getLinesLength;
|
|
13
|
+
exports.writeStream = writeStream;
|
|
14
|
+
exports.cleanStream = cleanStream;
|
|
15
|
+
exports.terminalSupportsUnicode = terminalSupportsUnicode;
|
|
1
16
|
/*
|
|
2
17
|
https://github.com/jbcarpanelli/spinnies
|
|
3
18
|
|
|
@@ -7,9 +22,9 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
7
22
|
|
|
8
23
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
9
24
|
**/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
25
|
+
const readline_1 = __importDefault(require("readline"));
|
|
26
|
+
const strip_ansi_1 = __importDefault(require("strip-ansi"));
|
|
27
|
+
exports.VALID_STATUSES = [
|
|
13
28
|
'succeed',
|
|
14
29
|
'fail',
|
|
15
30
|
'spinning',
|
|
@@ -34,7 +49,7 @@ const VALID_COLORS = [
|
|
|
34
49
|
'cyanBright',
|
|
35
50
|
'whiteBright',
|
|
36
51
|
];
|
|
37
|
-
|
|
52
|
+
exports.SPINNERS = {
|
|
38
53
|
dots: {
|
|
39
54
|
interval: 50,
|
|
40
55
|
frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'],
|
|
@@ -44,11 +59,11 @@ export const SPINNERS = {
|
|
|
44
59
|
frames: ['-', '_'],
|
|
45
60
|
},
|
|
46
61
|
};
|
|
47
|
-
|
|
62
|
+
function purgeSpinnerOptions(options) {
|
|
48
63
|
const { text, status, indent } = options;
|
|
49
64
|
const opts = { text, status, indent };
|
|
50
65
|
const colors = colorOptions(options);
|
|
51
|
-
if (!VALID_STATUSES.includes(status))
|
|
66
|
+
if (!exports.VALID_STATUSES.includes(status))
|
|
52
67
|
delete opts.status;
|
|
53
68
|
if (typeof text !== 'string')
|
|
54
69
|
delete opts.text;
|
|
@@ -56,7 +71,7 @@ export function purgeSpinnerOptions(options) {
|
|
|
56
71
|
delete opts.indent;
|
|
57
72
|
return { ...colors, ...opts };
|
|
58
73
|
}
|
|
59
|
-
|
|
74
|
+
function purgeSpinnersOptions({ spinner, disableSpins, ...others }) {
|
|
60
75
|
const colors = colorOptions(others);
|
|
61
76
|
const prefixes = prefixOptions(others);
|
|
62
77
|
const disableSpinsOption = typeof disableSpins === 'boolean' ? { disableSpins } : {};
|
|
@@ -65,8 +80,8 @@ export function purgeSpinnersOptions({ spinner, disableSpins, ...others }) {
|
|
|
65
80
|
}
|
|
66
81
|
function turnToValidSpinner(spinner = {}) {
|
|
67
82
|
const platformSpinner = terminalSupportsUnicode()
|
|
68
|
-
? SPINNERS.dots
|
|
69
|
-
: SPINNERS.dashes;
|
|
83
|
+
? exports.SPINNERS.dots
|
|
84
|
+
: exports.SPINNERS.dashes;
|
|
70
85
|
if (typeof spinner !== 'object') {
|
|
71
86
|
return platformSpinner;
|
|
72
87
|
}
|
|
@@ -86,7 +101,7 @@ function turnToValidSpinner(spinner = {}) {
|
|
|
86
101
|
}
|
|
87
102
|
return { interval, frames };
|
|
88
103
|
}
|
|
89
|
-
|
|
104
|
+
function colorOptions({ color, succeedColor, failColor, spinnerColor, }) {
|
|
90
105
|
const colors = {
|
|
91
106
|
color,
|
|
92
107
|
succeedColor,
|
|
@@ -100,7 +115,7 @@ export function colorOptions({ color, succeedColor, failColor, spinnerColor, })
|
|
|
100
115
|
});
|
|
101
116
|
return colors;
|
|
102
117
|
}
|
|
103
|
-
|
|
118
|
+
function prefixOptions({ succeedPrefix, failPrefix, }) {
|
|
104
119
|
if (terminalSupportsUnicode()) {
|
|
105
120
|
succeedPrefix = succeedPrefix || '✓';
|
|
106
121
|
failPrefix = failPrefix || '✖';
|
|
@@ -111,7 +126,7 @@ export function prefixOptions({ succeedPrefix, failPrefix, }) {
|
|
|
111
126
|
}
|
|
112
127
|
return { succeedPrefix, failPrefix };
|
|
113
128
|
}
|
|
114
|
-
|
|
129
|
+
function breakText(text, prefixLength) {
|
|
115
130
|
return text
|
|
116
131
|
.split('\n')
|
|
117
132
|
.map((line, index) => index === 0 ? breakLine(line, prefixLength) : breakLine(line, 0))
|
|
@@ -123,26 +138,26 @@ function breakLine(line, prefixLength) {
|
|
|
123
138
|
? `${line.substring(0, columns - prefixLength - 1)}\n${breakLine(line.substring(columns - prefixLength - 1, line.length), 0)}`
|
|
124
139
|
: line;
|
|
125
140
|
}
|
|
126
|
-
|
|
127
|
-
return
|
|
141
|
+
function getLinesLength(text, prefixLength) {
|
|
142
|
+
return (0, strip_ansi_1.default)(text)
|
|
128
143
|
.split('\n')
|
|
129
144
|
.map((line, index) => index === 0 ? line.length + prefixLength : line.length);
|
|
130
145
|
}
|
|
131
|
-
|
|
146
|
+
function writeStream(stream, output, rawLines) {
|
|
132
147
|
stream.write(output);
|
|
133
|
-
|
|
148
|
+
readline_1.default.moveCursor(stream, 0, -rawLines.length);
|
|
134
149
|
}
|
|
135
|
-
|
|
150
|
+
function cleanStream(stream, rawLines) {
|
|
136
151
|
rawLines.forEach((lineLength, index) => {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
152
|
+
readline_1.default.moveCursor(stream, lineLength, index);
|
|
153
|
+
readline_1.default.clearLine(stream, 1);
|
|
154
|
+
readline_1.default.moveCursor(stream, -lineLength, -index);
|
|
140
155
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
156
|
+
readline_1.default.moveCursor(stream, 0, rawLines.length);
|
|
157
|
+
readline_1.default.clearScreenDown(stream);
|
|
158
|
+
readline_1.default.moveCursor(stream, 0, -rawLines.length);
|
|
144
159
|
}
|
|
145
|
-
|
|
160
|
+
function terminalSupportsUnicode() {
|
|
146
161
|
// The default command prompt and powershell in Windows do not support Unicode characters.
|
|
147
162
|
// However, the VSCode integrated terminal and the Windows Terminal both do.
|
|
148
163
|
return (process.platform !== 'win32' ||
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.supportsHyperlinkModule = void 0;
|
|
4
|
+
const hasFlag_1 = require("../utils/hasFlag");
|
|
2
5
|
//See https://github.com/jamestalmage/supports-hyperlinks (License: https://github.com/jamestalmage/supports-hyperlinks/blob/master/license)
|
|
3
6
|
function parseVersion(versionString) {
|
|
4
7
|
if (/^\d{3,4}$/.test(versionString)) {
|
|
@@ -19,7 +22,7 @@ function parseVersion(versionString) {
|
|
|
19
22
|
}
|
|
20
23
|
function supportsHyperlink(stream) {
|
|
21
24
|
const { env } = process;
|
|
22
|
-
if (hasFlag('noHyperlinks')) {
|
|
25
|
+
if ((0, hasFlag_1.hasFlag)('noHyperlinks')) {
|
|
23
26
|
return false;
|
|
24
27
|
}
|
|
25
28
|
if (stream && !stream.isTTY) {
|
|
@@ -52,7 +55,7 @@ function supportsHyperlink(stream) {
|
|
|
52
55
|
}
|
|
53
56
|
return false;
|
|
54
57
|
}
|
|
55
|
-
|
|
58
|
+
exports.supportsHyperlinkModule = {
|
|
56
59
|
supportsHyperlink,
|
|
57
60
|
stdout: supportsHyperlink(process.stdout),
|
|
58
61
|
stderr: supportsHyperlink(process.stderr),
|
package/lib/ui/supportsColor.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
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.supportsColor = void 0;
|
|
7
|
+
const process_1 = __importDefault(require("process"));
|
|
8
|
+
const os_1 = __importDefault(require("os"));
|
|
9
|
+
const tty_1 = __importDefault(require("tty"));
|
|
10
|
+
const hasFlag_1 = require("../utils/hasFlag");
|
|
11
|
+
const { env } = process_1.default;
|
|
6
12
|
function translateLevel(level) {
|
|
7
13
|
if (level === 0) {
|
|
8
14
|
return {
|
|
@@ -27,13 +33,13 @@ function _supportsColor(haveStream, { streamIsTTY } = {}) {
|
|
|
27
33
|
if (env.TERM === 'dumb') {
|
|
28
34
|
return min;
|
|
29
35
|
}
|
|
30
|
-
if (hasFlag('noColor')) {
|
|
36
|
+
if ((0, hasFlag_1.hasFlag)('noColor')) {
|
|
31
37
|
return 0;
|
|
32
38
|
}
|
|
33
|
-
if (
|
|
39
|
+
if (process_1.default.platform === 'win32') {
|
|
34
40
|
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
35
41
|
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
36
|
-
const osRelease =
|
|
42
|
+
const osRelease = os_1.default.release().split('.');
|
|
37
43
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
38
44
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
39
45
|
}
|
|
@@ -90,8 +96,8 @@ function createSupportsColor(stream, options = {}) {
|
|
|
90
96
|
});
|
|
91
97
|
return translateLevel(level);
|
|
92
98
|
}
|
|
93
|
-
|
|
99
|
+
exports.supportsColor = {
|
|
94
100
|
createSupportsColor,
|
|
95
|
-
stdout: createSupportsColor({ isTTY:
|
|
96
|
-
stderr: createSupportsColor({ isTTY:
|
|
101
|
+
stdout: createSupportsColor({ isTTY: tty_1.default.isatty(1) }),
|
|
102
|
+
stderr: createSupportsColor({ isTTY: tty_1.default.isatty(2) }),
|
|
97
103
|
};
|
package/lib/ui/table.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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.getTableContents = getTableContents;
|
|
7
|
+
exports.getTableHeader = getTableHeader;
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const table_1 = require("table");
|
|
3
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
11
|
function isObject(item) {
|
|
5
12
|
return item && typeof item === 'object' && !Array.isArray(item);
|
|
@@ -52,12 +59,12 @@ const tableConfigDefaults = {
|
|
|
52
59
|
return false;
|
|
53
60
|
},
|
|
54
61
|
};
|
|
55
|
-
|
|
62
|
+
function getTableContents(
|
|
56
63
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
64
|
tableData = [], tableConfig = {}) {
|
|
58
65
|
const mergedConfig = mergeDeep({}, tableConfigDefaults, tableConfig);
|
|
59
|
-
return table(tableData, mergedConfig);
|
|
66
|
+
return (0, table_1.table)(tableData, mergedConfig);
|
|
60
67
|
}
|
|
61
|
-
|
|
62
|
-
return headerItems.map(headerItem =>
|
|
68
|
+
function getTableHeader(headerItems) {
|
|
69
|
+
return headerItems.map(headerItem => chalk_1.default.bold(headerItem));
|
|
63
70
|
}
|
package/lib/upload.js
CHANGED
|
@@ -1,43 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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.getUploadableFileList = getUploadableFileList;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const fs_1 = require("@hubspot/local-dev-lib/fs");
|
|
9
|
+
const ignoreRules_1 = require("@hubspot/local-dev-lib/ignoreRules");
|
|
10
|
+
const handleFieldsJS_1 = require("@hubspot/local-dev-lib/cms/handleFieldsJS");
|
|
11
|
+
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
12
|
+
const cmsFieldPrompt_1 = require("./prompts/cmsFieldPrompt");
|
|
13
|
+
const index_1 = require("./errorHandlers/index");
|
|
8
14
|
/*
|
|
9
15
|
* Walks the src folder for files, filters them based on ignore filter.
|
|
10
16
|
* If convertFields is true then will check for any JS fields conflicts (i.e., JS fields file and fields.json file) and prompt to resolve
|
|
11
17
|
*/
|
|
12
|
-
|
|
18
|
+
async function getUploadableFileList(src, convertFields) {
|
|
13
19
|
let filePaths = [];
|
|
14
20
|
try {
|
|
15
|
-
filePaths = await walk(src);
|
|
21
|
+
filePaths = await (0, fs_1.walk)(src);
|
|
16
22
|
}
|
|
17
23
|
catch (e) {
|
|
18
|
-
logError(e);
|
|
24
|
+
(0, index_1.logError)(e);
|
|
19
25
|
}
|
|
20
26
|
const allowedFiles = filePaths
|
|
21
27
|
.filter(file => {
|
|
22
|
-
if (!isAllowedExtension(file)) {
|
|
28
|
+
if (!(0, path_2.isAllowedExtension)(file)) {
|
|
23
29
|
return false;
|
|
24
30
|
}
|
|
25
31
|
return true;
|
|
26
32
|
})
|
|
27
|
-
.filter(createIgnoreFilter(false));
|
|
33
|
+
.filter((0, ignoreRules_1.createIgnoreFilter)(false));
|
|
28
34
|
if (!convertFields) {
|
|
29
35
|
return allowedFiles;
|
|
30
36
|
}
|
|
31
37
|
const uploadableFiles = [];
|
|
32
38
|
let skipFiles = [];
|
|
33
39
|
for (const filePath of allowedFiles) {
|
|
34
|
-
const fileName =
|
|
40
|
+
const fileName = path_1.default.basename(filePath);
|
|
35
41
|
if (skipFiles.includes(filePath))
|
|
36
42
|
continue;
|
|
37
|
-
const isConvertable = isConvertableFieldJs(src, filePath, convertFields);
|
|
43
|
+
const isConvertable = (0, handleFieldsJS_1.isConvertableFieldJs)(src, filePath, convertFields);
|
|
38
44
|
if (isConvertable || fileName == 'fields.json') {
|
|
39
45
|
// This prompt checks if there are multiple field files in the folder and gets user to choose.
|
|
40
|
-
const [choice, updatedSkipFiles] = await fieldsJsPrompt(filePath, src, skipFiles);
|
|
46
|
+
const [choice, updatedSkipFiles] = await (0, cmsFieldPrompt_1.fieldsJsPrompt)(filePath, src, skipFiles);
|
|
41
47
|
skipFiles = updatedSkipFiles;
|
|
42
48
|
// If they chose something other than the current file, move on.
|
|
43
49
|
if (choice !== filePath)
|
package/lib/usageTracking.d.ts
CHANGED
|
@@ -13,6 +13,17 @@ type Meta = {
|
|
|
13
13
|
file?: boolean;
|
|
14
14
|
successful?: boolean;
|
|
15
15
|
};
|
|
16
|
+
export declare const EventClass: {
|
|
17
|
+
USAGE: string;
|
|
18
|
+
INTERACTION: string;
|
|
19
|
+
VIEW: string;
|
|
20
|
+
ACTIVATION: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function getNodeVersionData(): {
|
|
23
|
+
nodeVersion: string;
|
|
24
|
+
nodeMajorVersion: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function getPlatform(): string;
|
|
16
27
|
export declare function trackCommandUsage(command: string, meta?: Meta, accountId?: number): Promise<void>;
|
|
17
28
|
export declare function trackHelpUsage(command: string): Promise<void>;
|
|
18
29
|
export declare function trackConvertFieldsUsage(command: string): Promise<void>;
|
package/lib/usageTracking.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventClass = void 0;
|
|
4
|
+
exports.getNodeVersionData = getNodeVersionData;
|
|
5
|
+
exports.getPlatform = getPlatform;
|
|
6
|
+
exports.trackCommandUsage = trackCommandUsage;
|
|
7
|
+
exports.trackHelpUsage = trackHelpUsage;
|
|
8
|
+
exports.trackConvertFieldsUsage = trackConvertFieldsUsage;
|
|
9
|
+
exports.trackAuthAction = trackAuthAction;
|
|
10
|
+
exports.trackCommandMetadataUsage = trackCommandMetadataUsage;
|
|
11
|
+
const trackUsage_1 = require("@hubspot/local-dev-lib/trackUsage");
|
|
12
|
+
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
13
|
+
const auth_1 = require("@hubspot/local-dev-lib/constants/auth");
|
|
14
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
15
|
+
const package_json_1 = require("../package.json");
|
|
16
|
+
const errorHandlers_1 = require("./errorHandlers");
|
|
17
|
+
exports.EventClass = {
|
|
9
18
|
USAGE: 'USAGE',
|
|
10
19
|
INTERACTION: 'INTERACTION',
|
|
11
20
|
VIEW: 'VIEW',
|
|
@@ -27,129 +36,120 @@ function getPlatform() {
|
|
|
27
36
|
return process.platform;
|
|
28
37
|
}
|
|
29
38
|
}
|
|
30
|
-
|
|
31
|
-
if (!isTrackingAllowed()) {
|
|
39
|
+
async function trackCommandUsage(command, meta = {}, accountId) {
|
|
40
|
+
if (!(0, config_1.isTrackingAllowed)()) {
|
|
32
41
|
return;
|
|
33
42
|
}
|
|
34
|
-
logger.debug('Attempting to track usage of "%s" command', command);
|
|
43
|
+
logger_1.logger.debug('Attempting to track usage of "%s" command', command);
|
|
35
44
|
let authType = 'unknown';
|
|
36
45
|
if (accountId) {
|
|
37
|
-
const accountConfig = getAccountConfig(accountId);
|
|
46
|
+
const accountConfig = (0, config_1.getAccountConfig)(accountId);
|
|
38
47
|
authType =
|
|
39
48
|
accountConfig && accountConfig.authType
|
|
40
49
|
? accountConfig.authType
|
|
41
|
-
: API_KEY_AUTH_METHOD.value;
|
|
50
|
+
: auth_1.API_KEY_AUTH_METHOD.value;
|
|
42
51
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
command,
|
|
50
|
-
authType,
|
|
51
|
-
...meta,
|
|
52
|
-
};
|
|
53
|
-
try {
|
|
54
|
-
await trackUsage('cli-interaction', EventClass.INTERACTION, usageTrackingEvent, accountId);
|
|
55
|
-
logger.debug('Sent usage tracking command event: %o', usageTrackingEvent);
|
|
56
|
-
}
|
|
57
|
-
catch (e) {
|
|
58
|
-
debugError(e);
|
|
59
|
-
}
|
|
52
|
+
return trackCliInteraction({
|
|
53
|
+
action: 'cli-command',
|
|
54
|
+
command,
|
|
55
|
+
authType,
|
|
56
|
+
...meta,
|
|
57
|
+
accountId,
|
|
60
58
|
});
|
|
61
59
|
}
|
|
62
|
-
|
|
63
|
-
if (!isTrackingAllowed()) {
|
|
60
|
+
async function trackHelpUsage(command) {
|
|
61
|
+
if (!(0, config_1.isTrackingAllowed)()) {
|
|
64
62
|
return;
|
|
65
63
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
logger.debug('Tracking help usage of "%s" sub-command', command);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
logger.debug('Tracking help usage of main command');
|
|
72
|
-
}
|
|
73
|
-
await trackUsage('cli-interaction', EventClass.INTERACTION, {
|
|
74
|
-
action: 'cli-help',
|
|
75
|
-
os: getPlatform(),
|
|
76
|
-
...getNodeVersionData(),
|
|
77
|
-
version,
|
|
78
|
-
command,
|
|
79
|
-
});
|
|
64
|
+
if (command) {
|
|
65
|
+
logger_1.logger.debug('Tracking help usage of "%s" sub-command', command);
|
|
80
66
|
}
|
|
81
|
-
|
|
82
|
-
|
|
67
|
+
else {
|
|
68
|
+
logger_1.logger.debug('Tracking help usage of main command');
|
|
83
69
|
}
|
|
70
|
+
return trackCliInteraction({
|
|
71
|
+
action: 'cli-help',
|
|
72
|
+
command,
|
|
73
|
+
});
|
|
84
74
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
logger.debug('Attempting to track usage of "%s" command', command);
|
|
91
|
-
await trackUsage('cli-interaction', EventClass.INTERACTION, {
|
|
92
|
-
action: 'cli-process-fields',
|
|
93
|
-
os: getPlatform(),
|
|
94
|
-
...getNodeVersionData(),
|
|
95
|
-
version,
|
|
96
|
-
command,
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
catch (e) {
|
|
100
|
-
debugError(e);
|
|
101
|
-
}
|
|
75
|
+
async function trackConvertFieldsUsage(command) {
|
|
76
|
+
return trackCliInteraction({
|
|
77
|
+
action: 'cli-process-fields',
|
|
78
|
+
command,
|
|
79
|
+
});
|
|
102
80
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
const usageTrackingEvent = {
|
|
81
|
+
async function trackAuthAction(command, authType, step, accountId) {
|
|
82
|
+
return trackCliInteraction({
|
|
108
83
|
action: 'cli-auth',
|
|
109
|
-
os: getPlatform(),
|
|
110
|
-
...getNodeVersionData(),
|
|
111
|
-
version,
|
|
112
84
|
command,
|
|
113
85
|
authType,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
catch (e) {
|
|
121
|
-
debugError(e);
|
|
122
|
-
}
|
|
86
|
+
accountId,
|
|
87
|
+
meta: {
|
|
88
|
+
step,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
123
91
|
}
|
|
124
|
-
|
|
125
|
-
if (!isTrackingAllowed()) {
|
|
92
|
+
async function trackCommandMetadataUsage(command, meta = {}, accountId) {
|
|
93
|
+
if (!(0, config_1.isTrackingAllowed)()) {
|
|
126
94
|
return;
|
|
127
95
|
}
|
|
128
|
-
logger.debug('Attempting to track metadata usage of "%s" command', command);
|
|
96
|
+
logger_1.logger.debug('Attempting to track metadata usage of "%s" command', command);
|
|
129
97
|
let authType = 'unknown';
|
|
130
98
|
if (accountId) {
|
|
131
|
-
const accountConfig = getAccountConfig(accountId);
|
|
99
|
+
const accountConfig = (0, config_1.getAccountConfig)(accountId);
|
|
132
100
|
authType =
|
|
133
101
|
accountConfig && accountConfig.authType
|
|
134
102
|
? accountConfig.authType
|
|
135
|
-
: API_KEY_AUTH_METHOD.value;
|
|
103
|
+
: auth_1.API_KEY_AUTH_METHOD.value;
|
|
136
104
|
}
|
|
137
|
-
|
|
105
|
+
return trackCliInteraction({
|
|
106
|
+
action: 'cli-command-metadata',
|
|
107
|
+
command,
|
|
108
|
+
authType,
|
|
109
|
+
accountId,
|
|
110
|
+
meta,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
async function trackCliInteraction({ action, accountId, command, authType, meta = {}, }) {
|
|
114
|
+
try {
|
|
115
|
+
if (!(0, config_1.isTrackingAllowed)()) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
138
118
|
const usageTrackingEvent = {
|
|
139
|
-
action
|
|
119
|
+
action,
|
|
140
120
|
os: getPlatform(),
|
|
141
121
|
...getNodeVersionData(),
|
|
142
|
-
version,
|
|
122
|
+
version: package_json_1.version,
|
|
143
123
|
command,
|
|
144
124
|
authType,
|
|
145
125
|
...meta,
|
|
146
126
|
};
|
|
127
|
+
if (process.env.HUBSPOT_MCP_AI_AGENT) {
|
|
128
|
+
try {
|
|
129
|
+
await (0, trackUsage_1.trackUsage)('cli-interaction', exports.EventClass.INTERACTION, {
|
|
130
|
+
...usageTrackingEvent,
|
|
131
|
+
action: 'cli-mcp-server',
|
|
132
|
+
type: process.env.HUBSPOT_MCP_AI_AGENT,
|
|
133
|
+
}, accountId);
|
|
134
|
+
logger_1.logger.debug('Sent AI usage tracking command event: %o', {
|
|
135
|
+
...usageTrackingEvent,
|
|
136
|
+
action: 'cli-mcp-server',
|
|
137
|
+
type: process.env.HUBSPOT_MCP_AI_AGENT,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
(0, errorHandlers_1.debugError)(error);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
147
144
|
try {
|
|
148
|
-
|
|
149
|
-
logger.debug('Sent usage tracking command event: %o', usageTrackingEvent);
|
|
145
|
+
return (0, trackUsage_1.trackUsage)('cli-interaction', exports.EventClass.INTERACTION, usageTrackingEvent, accountId);
|
|
150
146
|
}
|
|
151
|
-
catch (
|
|
152
|
-
debugError(
|
|
147
|
+
catch (error) {
|
|
148
|
+
(0, errorHandlers_1.debugError)(error);
|
|
153
149
|
}
|
|
154
|
-
|
|
150
|
+
logger_1.logger.debug('Sent usage tracking command event: %o', usageTrackingEvent);
|
|
151
|
+
}
|
|
152
|
+
catch (e) {
|
|
153
|
+
(0, errorHandlers_1.debugError)(e);
|
|
154
|
+
}
|
|
155
155
|
}
|
package/lib/utils/hasFlag.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
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.hasFlag = hasFlag;
|
|
7
|
+
const process_1 = __importDefault(require("process"));
|
|
2
8
|
// See https://github.com/sindresorhus/has-flag/blob/main/index.js (License: https://github.com/sindresorhus/has-flag/blob/main/license)
|
|
3
|
-
|
|
9
|
+
function hasFlag(flag, argv = process_1.default.argv) {
|
|
4
10
|
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
|
|
5
11
|
const position = argv.indexOf(prefix + flag);
|
|
6
12
|
const terminatorPosition = argv.indexOf('--');
|