@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/commands/hubdb.js
CHANGED
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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.describe = exports.command = void 0;
|
|
7
|
+
const create_1 = __importDefault(require("./hubdb/create"));
|
|
8
|
+
const fetch_1 = __importDefault(require("./hubdb/fetch"));
|
|
9
|
+
const delete_1 = __importDefault(require("./hubdb/delete"));
|
|
10
|
+
const clear_1 = __importDefault(require("./hubdb/clear"));
|
|
11
|
+
const list_1 = __importDefault(require("./hubdb/list"));
|
|
12
|
+
const lang_1 = require("../lib/lang");
|
|
13
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
14
|
+
exports.command = 'hubdb';
|
|
15
|
+
exports.describe = (0, lang_1.i18n)('commands.hubdb.describe');
|
|
10
16
|
function hubdbBuilder(yargs) {
|
|
11
17
|
yargs
|
|
12
|
-
.command(
|
|
13
|
-
.command(
|
|
14
|
-
.command(
|
|
15
|
-
.command(
|
|
16
|
-
.command(
|
|
18
|
+
.command(clear_1.default)
|
|
19
|
+
.command(create_1.default)
|
|
20
|
+
.command(fetch_1.default)
|
|
21
|
+
.command(delete_1.default)
|
|
22
|
+
.command(list_1.default)
|
|
17
23
|
.demandCommand(1, '');
|
|
18
24
|
return yargs;
|
|
19
25
|
}
|
|
20
|
-
const builder = makeYargsBuilder(hubdbBuilder, command, describe);
|
|
26
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(hubdbBuilder, exports.command, exports.describe);
|
|
21
27
|
const hubdbCommand = {
|
|
22
|
-
command,
|
|
23
|
-
describe,
|
|
28
|
+
command: exports.command,
|
|
29
|
+
describe: exports.describe,
|
|
24
30
|
builder,
|
|
25
31
|
handler: () => { },
|
|
26
32
|
};
|
|
27
|
-
|
|
33
|
+
exports.default = hubdbCommand;
|
package/commands/init.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigArgs, CommonArgs, TestingArgs, AccountArgs, YargsCommandModule } from '../types/Yargs
|
|
1
|
+
import { ConfigArgs, CommonArgs, TestingArgs, AccountArgs, YargsCommandModule } from '../types/Yargs';
|
|
2
2
|
type InitArgs = CommonArgs & ConfigArgs & TestingArgs & AccountArgs & {
|
|
3
3
|
authType?: string;
|
|
4
4
|
'disable-tracking'?: boolean;
|
package/commands/init.js
CHANGED
|
@@ -1,116 +1,121 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
9
|
+
const auth_1 = require("@hubspot/local-dev-lib/constants/auth");
|
|
10
|
+
const gitignore_1 = require("@hubspot/local-dev-lib/gitignore");
|
|
11
|
+
const config_2 = require("@hubspot/local-dev-lib/constants/config");
|
|
12
|
+
const personalAccessKey_1 = require("@hubspot/local-dev-lib/personalAccessKey");
|
|
13
|
+
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
14
|
+
const text_1 = require("@hubspot/local-dev-lib/text");
|
|
15
|
+
const environments_1 = require("@hubspot/local-dev-lib/constants/environments");
|
|
16
|
+
const getAccountIdentifier_1 = require("@hubspot/local-dev-lib/config/getAccountIdentifier");
|
|
17
|
+
const commonOpts_1 = require("../lib/commonOpts");
|
|
18
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
19
|
+
const process_1 = require("../lib/process");
|
|
20
|
+
const index_1 = require("../lib/errorHandlers/index");
|
|
21
|
+
const usageTracking_1 = require("../lib/usageTracking");
|
|
22
|
+
const promptUtils_1 = require("../lib/prompts/promptUtils");
|
|
23
|
+
const personalAccessKeyPrompt_1 = require("../lib/prompts/personalAccessKeyPrompt");
|
|
24
|
+
const accountNamePrompt_1 = require("../lib/prompts/accountNamePrompt");
|
|
25
|
+
const oauth_1 = require("../lib/oauth");
|
|
26
|
+
const exitCodes_1 = require("../lib/enums/exitCodes");
|
|
27
|
+
const ui_1 = require("../lib/ui");
|
|
28
|
+
const logger_1 = require("../lib/ui/logger");
|
|
29
|
+
const en_1 = require("../lang/en");
|
|
30
|
+
const parsing_1 = require("../lib/parsing");
|
|
26
31
|
const TRACKING_STATUS = {
|
|
27
32
|
STARTED: 'started',
|
|
28
33
|
ERROR: 'error',
|
|
29
34
|
COMPLETE: 'complete',
|
|
30
35
|
};
|
|
31
36
|
async function personalAccessKeyConfigCreationFlow(env, account) {
|
|
32
|
-
const { personalAccessKey } = await personalAccessKeyPrompt({ env, account });
|
|
37
|
+
const { personalAccessKey } = await (0, personalAccessKeyPrompt_1.personalAccessKeyPrompt)({ env, account });
|
|
33
38
|
let updatedConfig;
|
|
34
39
|
try {
|
|
35
|
-
const token = await getAccessToken(personalAccessKey, env);
|
|
36
|
-
const defaultName = token.hubName ? toKebabCase(token.hubName) : undefined;
|
|
37
|
-
const { name } = await cliAccountNamePrompt(defaultName);
|
|
38
|
-
updatedConfig = await updateConfigWithAccessToken(token, personalAccessKey, env, name, true);
|
|
40
|
+
const token = await (0, personalAccessKey_1.getAccessToken)(personalAccessKey, env);
|
|
41
|
+
const defaultName = token.hubName ? (0, text_1.toKebabCase)(token.hubName) : undefined;
|
|
42
|
+
const { name } = await (0, accountNamePrompt_1.cliAccountNamePrompt)(defaultName);
|
|
43
|
+
updatedConfig = await (0, personalAccessKey_1.updateConfigWithAccessToken)(token, personalAccessKey, env, name, true);
|
|
39
44
|
}
|
|
40
45
|
catch (e) {
|
|
41
|
-
logError(e);
|
|
46
|
+
(0, index_1.logError)(e);
|
|
42
47
|
}
|
|
43
48
|
return updatedConfig;
|
|
44
49
|
}
|
|
45
50
|
async function oauthConfigCreationFlow(env) {
|
|
46
|
-
const configData = await promptUser(OAUTH_FLOW);
|
|
51
|
+
const configData = await (0, promptUtils_1.promptUser)(personalAccessKeyPrompt_1.OAUTH_FLOW);
|
|
47
52
|
const accountConfig = {
|
|
48
53
|
...configData,
|
|
49
54
|
env,
|
|
50
55
|
};
|
|
51
|
-
await authenticateWithOauth(accountConfig);
|
|
52
|
-
updateDefaultAccount(accountConfig.name);
|
|
56
|
+
await (0, oauth_1.authenticateWithOauth)(accountConfig);
|
|
57
|
+
(0, config_1.updateDefaultAccount)(accountConfig.name);
|
|
53
58
|
return accountConfig;
|
|
54
59
|
}
|
|
55
60
|
const AUTH_TYPE_NAMES = {
|
|
56
|
-
[PERSONAL_ACCESS_KEY_AUTH_METHOD.value]: PERSONAL_ACCESS_KEY_AUTH_METHOD.name,
|
|
57
|
-
[OAUTH_AUTH_METHOD.value]: OAUTH_AUTH_METHOD.name,
|
|
61
|
+
[auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value]: auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.name,
|
|
62
|
+
[auth_1.OAUTH_AUTH_METHOD.value]: auth_1.OAUTH_AUTH_METHOD.name,
|
|
58
63
|
};
|
|
59
64
|
const command = 'init';
|
|
60
|
-
const describe = commands.init.describe;
|
|
65
|
+
const describe = en_1.commands.init.describe;
|
|
61
66
|
async function handler(args) {
|
|
62
67
|
const { authType: authTypeFlagValue, c: configFlagValue, disableTracking, useHiddenConfig, userProvidedAccount, } = args;
|
|
63
68
|
let parsedUserProvidedAccountId;
|
|
64
69
|
try {
|
|
65
70
|
if (userProvidedAccount) {
|
|
66
|
-
parsedUserProvidedAccountId = parseStringToNumber(userProvidedAccount);
|
|
71
|
+
parsedUserProvidedAccountId = (0, parsing_1.parseStringToNumber)(userProvidedAccount);
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
catch (err) {
|
|
70
|
-
uiLogger.error(commands.init.errors.invalidAccountIdProvided);
|
|
71
|
-
process.exit(EXIT_CODES.ERROR);
|
|
75
|
+
logger_1.uiLogger.error(en_1.commands.init.errors.invalidAccountIdProvided);
|
|
76
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
72
77
|
}
|
|
73
78
|
const authType = (authTypeFlagValue && authTypeFlagValue.toLowerCase()) ||
|
|
74
|
-
PERSONAL_ACCESS_KEY_AUTH_METHOD.value;
|
|
75
|
-
const configPath = (configFlagValue &&
|
|
76
|
-
getConfigPath('', useHiddenConfig);
|
|
77
|
-
setLogLevel(args);
|
|
79
|
+
auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value;
|
|
80
|
+
const configPath = (configFlagValue && path_1.default.join((0, path_2.getCwd)(), configFlagValue)) ||
|
|
81
|
+
(0, config_1.getConfigPath)('', useHiddenConfig);
|
|
82
|
+
(0, commonOpts_1.setLogLevel)(args);
|
|
78
83
|
if (!disableTracking) {
|
|
79
|
-
trackCommandUsage('init', {
|
|
84
|
+
(0, usageTracking_1.trackCommandUsage)('init', {
|
|
80
85
|
authType,
|
|
81
86
|
});
|
|
82
87
|
}
|
|
83
|
-
const env = args.qa ? ENVIRONMENTS.QA : ENVIRONMENTS.PROD;
|
|
84
|
-
if (configFileExists(true)) {
|
|
85
|
-
uiLogger.error(commands.init.errors.globalConfigFileExists);
|
|
86
|
-
process.exit(EXIT_CODES.ERROR);
|
|
88
|
+
const env = args.qa ? environments_1.ENVIRONMENTS.QA : environments_1.ENVIRONMENTS.PROD;
|
|
89
|
+
if ((0, config_1.configFileExists)(true)) {
|
|
90
|
+
logger_1.uiLogger.error(en_1.commands.init.errors.globalConfigFileExists);
|
|
91
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
87
92
|
}
|
|
88
|
-
if (
|
|
89
|
-
uiLogger.error(commands.init.errors.configFileExists(configPath));
|
|
90
|
-
uiLogger.info(commands.init.logs.updateConfig);
|
|
91
|
-
process.exit(EXIT_CODES.ERROR);
|
|
93
|
+
if (fs_extra_1.default.existsSync(configPath)) {
|
|
94
|
+
logger_1.uiLogger.error(en_1.commands.init.errors.configFileExists(configPath));
|
|
95
|
+
logger_1.uiLogger.info(en_1.commands.init.logs.updateConfig);
|
|
96
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
92
97
|
}
|
|
93
98
|
if (!disableTracking) {
|
|
94
|
-
await trackAuthAction('init', authType, TRACKING_STATUS.STARTED, parsedUserProvidedAccountId);
|
|
99
|
+
await (0, usageTracking_1.trackAuthAction)('init', authType, TRACKING_STATUS.STARTED, parsedUserProvidedAccountId);
|
|
95
100
|
}
|
|
96
|
-
const doesOtherConfigFileExist = configFileExists(!useHiddenConfig);
|
|
101
|
+
const doesOtherConfigFileExist = (0, config_1.configFileExists)(!useHiddenConfig);
|
|
97
102
|
if (doesOtherConfigFileExist) {
|
|
98
|
-
const path = getConfigPath('', !useHiddenConfig);
|
|
99
|
-
uiLogger.error(commands.init.errors.bothConfigFilesNotAllowed(path));
|
|
100
|
-
process.exit(EXIT_CODES.ERROR);
|
|
103
|
+
const path = (0, config_1.getConfigPath)('', !useHiddenConfig);
|
|
104
|
+
logger_1.uiLogger.error(en_1.commands.init.errors.bothConfigFilesNotAllowed(path));
|
|
105
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
101
106
|
}
|
|
102
|
-
trackAuthAction('init', authType, TRACKING_STATUS.STARTED, parsedUserProvidedAccountId);
|
|
103
|
-
createEmptyConfigFile({ path: configPath }, useHiddenConfig);
|
|
107
|
+
(0, usageTracking_1.trackAuthAction)('init', authType, TRACKING_STATUS.STARTED, parsedUserProvidedAccountId);
|
|
108
|
+
(0, config_1.createEmptyConfigFile)({ path: configPath }, useHiddenConfig);
|
|
104
109
|
//Needed to load deprecated config
|
|
105
|
-
loadConfig(configPath, args);
|
|
106
|
-
handleExit(deleteEmptyConfigFile);
|
|
110
|
+
(0, config_1.loadConfig)(configPath, args);
|
|
111
|
+
(0, process_1.handleExit)(config_1.deleteEmptyConfigFile);
|
|
107
112
|
try {
|
|
108
113
|
let accountId;
|
|
109
114
|
let name;
|
|
110
|
-
if (authType === PERSONAL_ACCESS_KEY_AUTH_METHOD.value) {
|
|
115
|
+
if (authType === auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value) {
|
|
111
116
|
const personalAccessKeyResult = await personalAccessKeyConfigCreationFlow(env, parsedUserProvidedAccountId);
|
|
112
117
|
if (personalAccessKeyResult) {
|
|
113
|
-
accountId = getAccountIdentifier(personalAccessKeyResult);
|
|
118
|
+
accountId = (0, getAccountIdentifier_1.getAccountIdentifier)(personalAccessKeyResult);
|
|
114
119
|
name = personalAccessKeyResult.name;
|
|
115
120
|
}
|
|
116
121
|
}
|
|
@@ -119,48 +124,48 @@ async function handler(args) {
|
|
|
119
124
|
accountId = oauthResult.accountId;
|
|
120
125
|
name = oauthResult.name;
|
|
121
126
|
}
|
|
122
|
-
const configPath = getConfigPath();
|
|
127
|
+
const configPath = (0, config_1.getConfigPath)();
|
|
123
128
|
try {
|
|
124
|
-
checkAndAddConfigToGitignore(configPath);
|
|
129
|
+
(0, gitignore_1.checkAndAddConfigToGitignore)(configPath);
|
|
125
130
|
}
|
|
126
131
|
catch (e) {
|
|
127
|
-
debugError(e);
|
|
132
|
+
(0, index_1.debugError)(e);
|
|
128
133
|
}
|
|
129
|
-
uiLogger.log('');
|
|
130
|
-
uiLogger.success(commands.init.success.configFileCreated(configPath));
|
|
131
|
-
uiLogger.success(commands.init.success.configFileUpdated(AUTH_TYPE_NAMES[authType], name || accountId));
|
|
132
|
-
uiFeatureHighlight([
|
|
134
|
+
logger_1.uiLogger.log('');
|
|
135
|
+
logger_1.uiLogger.success(en_1.commands.init.success.configFileCreated(configPath));
|
|
136
|
+
logger_1.uiLogger.success(en_1.commands.init.success.configFileUpdated(AUTH_TYPE_NAMES[authType], name || accountId));
|
|
137
|
+
(0, ui_1.uiFeatureHighlight)([
|
|
133
138
|
'getStartedCommand',
|
|
134
139
|
'helpCommand',
|
|
135
140
|
'authCommand',
|
|
136
141
|
'accountsListCommand',
|
|
137
142
|
]);
|
|
138
143
|
if (!disableTracking) {
|
|
139
|
-
await trackAuthAction('init', authType, TRACKING_STATUS.COMPLETE, accountId);
|
|
144
|
+
await (0, usageTracking_1.trackAuthAction)('init', authType, TRACKING_STATUS.COMPLETE, accountId);
|
|
140
145
|
}
|
|
141
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
146
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
142
147
|
}
|
|
143
148
|
catch (err) {
|
|
144
|
-
logError(err);
|
|
149
|
+
(0, index_1.logError)(err);
|
|
145
150
|
if (!disableTracking) {
|
|
146
|
-
await trackAuthAction('init', authType, TRACKING_STATUS.ERROR, parsedUserProvidedAccountId);
|
|
151
|
+
await (0, usageTracking_1.trackAuthAction)('init', authType, TRACKING_STATUS.ERROR, parsedUserProvidedAccountId);
|
|
147
152
|
}
|
|
148
|
-
process.exit(EXIT_CODES.ERROR);
|
|
153
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
149
154
|
}
|
|
150
155
|
}
|
|
151
156
|
function initBuilder(yargs) {
|
|
152
157
|
yargs.options({
|
|
153
158
|
'auth-type': {
|
|
154
|
-
describe: commands.init.options.authType.describe,
|
|
159
|
+
describe: en_1.commands.init.options.authType.describe,
|
|
155
160
|
type: 'string',
|
|
156
161
|
choices: [
|
|
157
|
-
`${PERSONAL_ACCESS_KEY_AUTH_METHOD.value}`,
|
|
158
|
-
`${OAUTH_AUTH_METHOD.value}`,
|
|
162
|
+
`${auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value}`,
|
|
163
|
+
`${auth_1.OAUTH_AUTH_METHOD.value}`,
|
|
159
164
|
],
|
|
160
|
-
default: PERSONAL_ACCESS_KEY_AUTH_METHOD.value,
|
|
165
|
+
default: auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value,
|
|
161
166
|
},
|
|
162
167
|
account: {
|
|
163
|
-
describe: commands.init.options.account.describe,
|
|
168
|
+
describe: en_1.commands.init.options.account.describe,
|
|
164
169
|
type: 'string',
|
|
165
170
|
alias: 'a',
|
|
166
171
|
},
|
|
@@ -173,7 +178,7 @@ function initBuilder(yargs) {
|
|
|
173
178
|
yargs.conflicts('use-hidden-config', 'config');
|
|
174
179
|
return yargs;
|
|
175
180
|
}
|
|
176
|
-
const builder = makeYargsBuilder(initBuilder, command, commands.init.verboseDescribe(DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME, uiCommandReference('hs auth'), PERSONAL_ACCESS_KEY_AUTH_METHOD.value), {
|
|
181
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(initBuilder, command, en_1.commands.init.verboseDescribe(config_2.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME, (0, ui_1.uiCommandReference)('hs auth'), auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value), {
|
|
177
182
|
useGlobalOptions: true,
|
|
178
183
|
useConfigOptions: true,
|
|
179
184
|
useTestingOptions: true,
|
|
@@ -184,4 +189,4 @@ const initCommand = {
|
|
|
184
189
|
handler,
|
|
185
190
|
builder,
|
|
186
191
|
};
|
|
187
|
-
|
|
192
|
+
exports.default = initCommand;
|
package/commands/lint.d.ts
CHANGED
package/commands/lint.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const validate_1 = require("@hubspot/local-dev-lib/cms/validate");
|
|
4
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
5
|
+
const index_1 = require("../lib/errorHandlers/index");
|
|
6
|
+
const usageTracking_1 = require("../lib/usageTracking");
|
|
7
|
+
const lang_1 = require("../lib/lang");
|
|
8
|
+
const filesystem_1 = require("../lib/filesystem");
|
|
9
|
+
const exitCodes_1 = require("../lib/enums/exitCodes");
|
|
10
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
9
11
|
const command = 'lint <path>';
|
|
10
12
|
// Hiding since this command is still experimental
|
|
11
13
|
const describe = undefined; //'Lint a file or folder for HubL syntax';
|
|
@@ -15,7 +17,7 @@ function getErrorsFromHublValidationObject(validation) {
|
|
|
15
17
|
function printHublValidationError(err) {
|
|
16
18
|
const { severity, message, lineno, startPosition } = err;
|
|
17
19
|
const method = severity === 'FATAL' ? 'error' : 'warn';
|
|
18
|
-
logger[method]('[%d, %d]: %s', lineno, startPosition, message);
|
|
20
|
+
logger_1.logger[method]('[%d, %d]: %s', lineno, startPosition, message);
|
|
19
21
|
}
|
|
20
22
|
function printHublValidationResult({ file, validation }) {
|
|
21
23
|
let count = 0;
|
|
@@ -26,7 +28,7 @@ function printHublValidationResult({ file, validation }) {
|
|
|
26
28
|
if (!errors.length) {
|
|
27
29
|
return count;
|
|
28
30
|
}
|
|
29
|
-
logger.group(file);
|
|
31
|
+
logger_1.logger.group(file);
|
|
30
32
|
errors.forEach(err => {
|
|
31
33
|
if (err.reason !== 'SYNTAX_ERROR') {
|
|
32
34
|
return;
|
|
@@ -34,42 +36,42 @@ function printHublValidationResult({ file, validation }) {
|
|
|
34
36
|
++count;
|
|
35
37
|
printHublValidationError(err);
|
|
36
38
|
});
|
|
37
|
-
logger.groupEnd();
|
|
39
|
+
logger_1.logger.groupEnd();
|
|
38
40
|
return count;
|
|
39
41
|
}
|
|
40
42
|
async function handler(args) {
|
|
41
43
|
const { path: lintPath, derivedAccountId } = args;
|
|
42
|
-
const localPath = resolveLocalPath(lintPath);
|
|
43
|
-
const groupName = i18n(`commands.lint.groupName`, {
|
|
44
|
+
const localPath = (0, filesystem_1.resolveLocalPath)(lintPath);
|
|
45
|
+
const groupName = (0, lang_1.i18n)(`commands.lint.groupName`, {
|
|
44
46
|
path: localPath,
|
|
45
47
|
});
|
|
46
|
-
trackCommandUsage('lint', undefined, derivedAccountId);
|
|
47
|
-
logger.group(groupName);
|
|
48
|
+
(0, usageTracking_1.trackCommandUsage)('lint', undefined, derivedAccountId);
|
|
49
|
+
logger_1.logger.group(groupName);
|
|
48
50
|
let count = 0;
|
|
49
51
|
try {
|
|
50
|
-
await lint(derivedAccountId, localPath, (result) => {
|
|
52
|
+
await (0, validate_1.lint)(derivedAccountId, localPath, (result) => {
|
|
51
53
|
return (count += printHublValidationResult(result));
|
|
52
54
|
});
|
|
53
55
|
}
|
|
54
56
|
catch (err) {
|
|
55
|
-
logger.groupEnd();
|
|
56
|
-
logError(err, { accountId: derivedAccountId });
|
|
57
|
-
process.exit(EXIT_CODES.ERROR);
|
|
57
|
+
logger_1.logger.groupEnd();
|
|
58
|
+
(0, index_1.logError)(err, { accountId: derivedAccountId });
|
|
59
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
58
60
|
}
|
|
59
|
-
logger.groupEnd();
|
|
60
|
-
logger.log(i18n(`commands.lint.issuesFound`, {
|
|
61
|
+
logger_1.logger.groupEnd();
|
|
62
|
+
logger_1.logger.log((0, lang_1.i18n)(`commands.lint.issuesFound`, {
|
|
61
63
|
count,
|
|
62
64
|
}));
|
|
63
65
|
}
|
|
64
66
|
function lintBuilder(yargs) {
|
|
65
67
|
yargs.positional('path', {
|
|
66
|
-
describe: i18n(`commands.lint.positionals.path.describe`),
|
|
68
|
+
describe: (0, lang_1.i18n)(`commands.lint.positionals.path.describe`),
|
|
67
69
|
required: true,
|
|
68
70
|
type: 'string',
|
|
69
71
|
});
|
|
70
72
|
return yargs;
|
|
71
73
|
}
|
|
72
|
-
const builder = makeYargsBuilder(lintBuilder, command, describe, {
|
|
74
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(lintBuilder, command, describe, {
|
|
73
75
|
useGlobalOptions: true,
|
|
74
76
|
useConfigOptions: true,
|
|
75
77
|
useAccountOptions: true,
|
|
@@ -80,4 +82,4 @@ const lintCommand = {
|
|
|
80
82
|
handler,
|
|
81
83
|
builder,
|
|
82
84
|
};
|
|
83
|
-
|
|
85
|
+
exports.default = lintCommand;
|
package/commands/list.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs, YargsCommandModule } from '../types/Yargs
|
|
1
|
+
import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs, YargsCommandModule } from '../types/Yargs';
|
|
2
2
|
type ListArgs = CommonArgs & ConfigArgs & EnvironmentArgs & AccountArgs & {
|
|
3
3
|
path: string;
|
|
4
4
|
};
|
package/commands/list.js
CHANGED
|
@@ -1,59 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
7
|
+
const usageTracking_1 = require("../lib/usageTracking");
|
|
8
|
+
const filesystem_1 = require("../lib/filesystem");
|
|
9
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
10
|
+
const index_1 = require("../lib/errorHandlers/index");
|
|
11
|
+
const fileMapper_1 = require("@hubspot/local-dev-lib/api/fileMapper");
|
|
12
|
+
const constants_1 = require("../lib/constants");
|
|
13
|
+
const lang_1 = require("../lib/lang");
|
|
14
|
+
const exitCodes_1 = require("../lib/enums/exitCodes");
|
|
15
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
11
16
|
function addColorToContents(fileOrFolder) {
|
|
12
|
-
if (!isPathFolder(fileOrFolder)) {
|
|
13
|
-
return
|
|
17
|
+
if (!(0, filesystem_1.isPathFolder)(fileOrFolder)) {
|
|
18
|
+
return chalk_1.default.reset.cyan(fileOrFolder);
|
|
14
19
|
}
|
|
15
|
-
if (fileOrFolder === HUBSPOT_FOLDER || fileOrFolder === MARKETPLACE_FOLDER) {
|
|
16
|
-
return
|
|
20
|
+
if (fileOrFolder === constants_1.HUBSPOT_FOLDER || fileOrFolder === constants_1.MARKETPLACE_FOLDER) {
|
|
21
|
+
return chalk_1.default.reset.bold.blue(fileOrFolder);
|
|
17
22
|
}
|
|
18
|
-
return
|
|
23
|
+
return chalk_1.default.reset.blue(fileOrFolder);
|
|
19
24
|
}
|
|
20
25
|
function sortContents(a, b) {
|
|
21
26
|
// Pin @hubspot folder to top
|
|
22
|
-
if (a === HUBSPOT_FOLDER) {
|
|
27
|
+
if (a === constants_1.HUBSPOT_FOLDER) {
|
|
23
28
|
return -1;
|
|
24
29
|
}
|
|
25
|
-
else if (b === HUBSPOT_FOLDER) {
|
|
30
|
+
else if (b === constants_1.HUBSPOT_FOLDER) {
|
|
26
31
|
return 1;
|
|
27
32
|
}
|
|
28
33
|
// Pin @marketplace folder to top
|
|
29
|
-
if (a === MARKETPLACE_FOLDER) {
|
|
34
|
+
if (a === constants_1.MARKETPLACE_FOLDER) {
|
|
30
35
|
return -1;
|
|
31
36
|
}
|
|
32
|
-
else if (b === MARKETPLACE_FOLDER) {
|
|
37
|
+
else if (b === constants_1.MARKETPLACE_FOLDER) {
|
|
33
38
|
return 1;
|
|
34
39
|
}
|
|
35
40
|
return a.localeCompare(b);
|
|
36
41
|
}
|
|
37
42
|
const command = ['list [path]', 'ls [path]'];
|
|
38
|
-
const describe = i18n(`commands.list.describe`);
|
|
43
|
+
const describe = (0, lang_1.i18n)(`commands.list.describe`);
|
|
39
44
|
async function handler(args) {
|
|
40
45
|
const { path, derivedAccountId } = args;
|
|
41
46
|
const directoryPath = path || '/';
|
|
42
47
|
let contentsResp;
|
|
43
|
-
trackCommandUsage('list', undefined, derivedAccountId);
|
|
44
|
-
logger.debug(i18n(`commands.list.gettingPathContents`, {
|
|
48
|
+
(0, usageTracking_1.trackCommandUsage)('list', undefined, derivedAccountId);
|
|
49
|
+
logger_1.logger.debug((0, lang_1.i18n)(`commands.list.gettingPathContents`, {
|
|
45
50
|
path: directoryPath,
|
|
46
51
|
}));
|
|
47
52
|
try {
|
|
48
|
-
const { data } = await getDirectoryContentsByPath(derivedAccountId, directoryPath);
|
|
53
|
+
const { data } = await (0, fileMapper_1.getDirectoryContentsByPath)(derivedAccountId, directoryPath);
|
|
49
54
|
contentsResp = data;
|
|
50
55
|
}
|
|
51
56
|
catch (e) {
|
|
52
|
-
logError(e);
|
|
53
|
-
process.exit(EXIT_CODES.ERROR);
|
|
57
|
+
(0, index_1.logError)(e);
|
|
58
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
54
59
|
}
|
|
55
60
|
if (!contentsResp.folder) {
|
|
56
|
-
logger.info(i18n(`commands.list.noFilesFoundAtPath`, {
|
|
61
|
+
logger_1.logger.info((0, lang_1.i18n)(`commands.list.noFilesFoundAtPath`, {
|
|
57
62
|
path: directoryPath,
|
|
58
63
|
}));
|
|
59
64
|
return;
|
|
@@ -63,7 +68,7 @@ async function handler(args) {
|
|
|
63
68
|
? ['@hubspot', ...contentsResp.children]
|
|
64
69
|
: contentsResp.children;
|
|
65
70
|
if (contents.length === 0) {
|
|
66
|
-
logger.info(i18n(`commands.list.noFilesFoundAtPath`, {
|
|
71
|
+
logger_1.logger.info((0, lang_1.i18n)(`commands.list.noFilesFoundAtPath`, {
|
|
67
72
|
path: directoryPath,
|
|
68
73
|
}));
|
|
69
74
|
return;
|
|
@@ -72,18 +77,18 @@ async function handler(args) {
|
|
|
72
77
|
.map(addColorToContents)
|
|
73
78
|
.sort(sortContents)
|
|
74
79
|
.join('\n');
|
|
75
|
-
logger.log(folderContentsOutput);
|
|
76
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
80
|
+
logger_1.logger.log(folderContentsOutput);
|
|
81
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
77
82
|
}
|
|
78
83
|
function cmsListBuilder(yargs) {
|
|
79
84
|
yargs.positional('path', {
|
|
80
|
-
describe: i18n(`commands.list.positionals.path.describe`),
|
|
85
|
+
describe: (0, lang_1.i18n)(`commands.list.positionals.path.describe`),
|
|
81
86
|
type: 'string',
|
|
82
87
|
});
|
|
83
88
|
yargs.example([['$0 list'], ['$0 list /'], ['$0 list my-modules']]);
|
|
84
89
|
return yargs;
|
|
85
90
|
}
|
|
86
|
-
const builder = makeYargsBuilder(cmsListBuilder, command, describe, {
|
|
91
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(cmsListBuilder, command, describe, {
|
|
87
92
|
useGlobalOptions: true,
|
|
88
93
|
useConfigOptions: true,
|
|
89
94
|
useAccountOptions: true,
|
|
@@ -95,4 +100,4 @@ const cmsListCommand = {
|
|
|
95
100
|
handler,
|
|
96
101
|
builder,
|
|
97
102
|
};
|
|
98
|
-
|
|
103
|
+
exports.default = cmsListCommand;
|
package/commands/logs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonArgs, ConfigArgs, AccountArgs, YargsCommandModule, EnvironmentArgs } from '../types/Yargs
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, YargsCommandModule, EnvironmentArgs } from '../types/Yargs';
|
|
2
2
|
type LogsArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
3
|
endpoint?: string;
|
|
4
4
|
latest?: boolean;
|