@hubspot/cli 7.7.21-experimental.0 → 7.7.21-experimental.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/__tests__/migrate.test.js +29 -27
- package/api/migrate.js +22 -14
- package/bin/cli.js +101 -92
- package/bin/hs +2 -2
- package/bin/hscms +2 -2
- package/bin/silenceErrors.js +2 -1
- package/commands/__tests__/account.test.js +34 -29
- package/commands/__tests__/auth.test.js +16 -11
- package/commands/__tests__/cms.test.js +20 -15
- package/commands/__tests__/config.test.js +19 -14
- package/commands/__tests__/create.test.js +15 -10
- package/commands/__tests__/customObject.test.js +19 -14
- package/commands/__tests__/doctor.test.js +48 -43
- package/commands/__tests__/feedback.test.js +45 -7
- package/commands/__tests__/fetch.test.js +28 -29
- package/commands/__tests__/filemanager.test.js +19 -14
- package/commands/__tests__/function.test.js +21 -16
- package/commands/__tests__/getStarted.test.js +50 -55
- package/commands/__tests__/hubdb.test.js +22 -17
- package/commands/__tests__/init.test.js +17 -12
- package/commands/__tests__/lint.test.js +18 -13
- package/commands/__tests__/list.test.js +23 -18
- package/commands/__tests__/logs.test.js +27 -28
- package/commands/__tests__/mcp.test.js +19 -14
- package/commands/__tests__/mv.test.js +52 -14
- package/commands/__tests__/open.test.js +51 -13
- package/commands/__tests__/project.test.js +49 -44
- package/commands/__tests__/remove.test.js +51 -13
- package/commands/__tests__/sandbox.test.js +19 -14
- package/commands/__tests__/secret.test.js +21 -16
- package/commands/__tests__/testAccount.test.js +21 -16
- package/commands/__tests__/theme.test.js +20 -15
- package/commands/account/__tests__/auth.test.js +16 -11
- package/commands/account/__tests__/clean.test.js +17 -12
- package/commands/account/__tests__/createOverride.test.js +15 -10
- package/commands/account/__tests__/info.test.js +16 -11
- package/commands/account/__tests__/list.test.js +16 -11
- package/commands/account/__tests__/remove.test.js +18 -13
- package/commands/account/__tests__/removeOverride.js +13 -8
- package/commands/account/__tests__/rename.test.js +20 -15
- package/commands/account/__tests__/use.test.js +15 -10
- package/commands/account/auth.d.ts +1 -1
- package/commands/account/auth.js +67 -65
- package/commands/account/clean.d.ts +1 -1
- package/commands/account/clean.js +60 -55
- package/commands/account/createOverride.d.ts +1 -1
- package/commands/account/createOverride.js +57 -52
- package/commands/account/info.d.ts +1 -1
- package/commands/account/info.js +35 -33
- package/commands/account/list.d.ts +1 -1
- package/commands/account/list.js +45 -43
- package/commands/account/remove.d.ts +1 -1
- package/commands/account/remove.js +42 -37
- package/commands/account/removeOverride.d.ts +1 -1
- package/commands/account/removeOverride.js +43 -38
- package/commands/account/rename.d.ts +1 -1
- package/commands/account/rename.js +20 -18
- package/commands/account/use.d.ts +1 -1
- package/commands/account/use.js +31 -29
- package/commands/account.d.ts +1 -1
- package/commands/account.js +28 -23
- package/commands/app/__tests__/install.test.js +52 -0
- package/commands/app/__tests__/migrate.test.js +34 -29
- package/commands/app/install.d.ts +8 -0
- package/commands/app/install.js +127 -0
- package/commands/app/migrate.d.ts +2 -2
- package/commands/app/migrate.js +43 -40
- package/commands/app/secret/__tests__/add.test.js +11 -6
- package/commands/app/secret/__tests__/delete.test.js +11 -6
- package/commands/app/secret/__tests__/list.test.js +11 -6
- package/commands/app/secret/__tests__/update.test.js +11 -6
- package/commands/app/secret/add.d.ts +1 -1
- package/commands/app/secret/add.js +30 -28
- package/commands/app/secret/delete.d.ts +1 -1
- package/commands/app/secret/delete.js +36 -34
- package/commands/app/secret/list.d.ts +1 -1
- package/commands/app/secret/list.js +27 -25
- package/commands/app/secret/update.d.ts +1 -1
- package/commands/app/secret/update.js +34 -32
- package/commands/app/secret.d.ts +1 -1
- package/commands/app/secret.js +17 -12
- package/commands/app.d.ts +1 -1
- package/commands/app.js +16 -6
- package/commands/auth.d.ts +1 -1
- package/commands/auth.js +72 -70
- package/commands/cms/convertFields.d.ts +1 -1
- package/commands/cms/convertFields.js +39 -34
- package/commands/cms/getReactModule.d.ts +1 -1
- package/commands/cms/getReactModule.js +37 -32
- package/commands/cms/lighthouseScore.d.ts +1 -1
- package/commands/cms/lighthouseScore.js +72 -67
- package/commands/cms.d.ts +1 -1
- package/commands/cms.js +16 -11
- package/commands/completion.d.ts +1 -1
- package/commands/completion.js +15 -10
- package/commands/config/migrate.d.ts +1 -1
- package/commands/config/migrate.js +32 -27
- package/commands/config/set.d.ts +1 -1
- package/commands/config/set.js +25 -23
- package/commands/config.d.ts +1 -1
- package/commands/config.js +13 -8
- package/commands/create/api-sample.d.ts +1 -1
- package/commands/create/api-sample.js +33 -28
- package/commands/create/app.d.ts +1 -1
- package/commands/create/app.js +5 -3
- package/commands/create/function.d.ts +1 -1
- package/commands/create/function.js +11 -9
- package/commands/create/index.d.ts +1 -1
- package/commands/create/index.js +24 -19
- package/commands/create/module.d.ts +1 -1
- package/commands/create/module.js +14 -12
- package/commands/create/react-app.d.ts +1 -1
- package/commands/create/react-app.js +5 -3
- package/commands/create/template.d.ts +1 -1
- package/commands/create/template.js +14 -12
- package/commands/create/vue-app.d.ts +1 -1
- package/commands/create/vue-app.js +5 -3
- package/commands/create/webpack-serverless.d.ts +1 -1
- package/commands/create/webpack-serverless.js +5 -3
- package/commands/create/website-theme.d.ts +1 -1
- package/commands/create/website-theme.js +7 -5
- package/commands/create.d.ts +2 -2
- package/commands/create.js +35 -30
- package/commands/customObject/__tests__/create.test.js +18 -13
- package/commands/customObject/__tests__/schema.test.js +23 -18
- package/commands/customObject/create.d.ts +1 -1
- package/commands/customObject/create.js +30 -28
- package/commands/customObject/schema/__tests__/create.test.js +18 -13
- package/commands/customObject/schema/__tests__/delete.test.js +18 -13
- package/commands/customObject/schema/__tests__/fetch-all.test.js +18 -13
- package/commands/customObject/schema/__tests__/fetch.test.js +18 -13
- package/commands/customObject/schema/__tests__/list.test.js +18 -13
- package/commands/customObject/schema/__tests__/update.test.js +18 -13
- package/commands/customObject/schema/create.d.ts +1 -1
- package/commands/customObject/schema/create.js +30 -28
- package/commands/customObject/schema/delete.d.ts +1 -1
- package/commands/customObject/schema/delete.js +26 -24
- package/commands/customObject/schema/fetch-all.d.ts +1 -1
- package/commands/customObject/schema/fetch-all.js +24 -22
- package/commands/customObject/schema/fetch.d.ts +1 -1
- package/commands/customObject/schema/fetch.js +26 -24
- package/commands/customObject/schema/list.d.ts +1 -1
- package/commands/customObject/schema/list.js +15 -13
- package/commands/customObject/schema/update.d.ts +1 -1
- package/commands/customObject/schema/update.js +34 -32
- package/commands/customObject/schema.d.ts +1 -1
- package/commands/customObject/schema.js +22 -17
- package/commands/customObject.d.ts +1 -1
- package/commands/customObject.js +18 -13
- package/commands/doctor.d.ts +1 -1
- package/commands/doctor.js +33 -28
- package/commands/feedback.d.ts +1 -1
- package/commands/feedback.js +24 -19
- package/commands/fetch.d.ts +1 -1
- package/commands/fetch.js +30 -28
- package/commands/filemanager/__tests__/fetch.test.js +22 -17
- package/commands/filemanager/__tests__/upload.test.js +20 -15
- package/commands/filemanager/fetch.d.ts +1 -1
- package/commands/filemanager/fetch.js +25 -23
- package/commands/filemanager/upload.d.ts +1 -1
- package/commands/filemanager/upload.js +44 -39
- package/commands/filemanager.d.ts +1 -1
- package/commands/filemanager.js +13 -8
- package/commands/function/deploy.d.ts +1 -1
- package/commands/function/deploy.js +40 -35
- package/commands/function/list.d.ts +1 -1
- package/commands/function/list.js +29 -24
- package/commands/function/server.d.ts +1 -1
- package/commands/function/server.js +17 -15
- package/commands/function.d.ts +1 -1
- package/commands/function.js +18 -12
- package/commands/getStarted.d.ts +1 -1
- package/commands/getStarted.js +131 -140
- package/commands/hubdb/__tests__/clear.test.js +18 -13
- package/commands/hubdb/__tests__/create.test.js +18 -13
- package/commands/hubdb/__tests__/delete.test.js +18 -13
- package/commands/hubdb/__tests__/fetch.test.js +18 -13
- package/commands/hubdb/__tests__/list.test.js +28 -23
- package/commands/hubdb/clear.d.ts +1 -1
- package/commands/hubdb/clear.js +22 -20
- package/commands/hubdb/create.d.ts +1 -1
- package/commands/hubdb/create.js +35 -30
- package/commands/hubdb/delete.d.ts +1 -1
- package/commands/hubdb/delete.js +26 -24
- package/commands/hubdb/fetch.d.ts +1 -1
- package/commands/hubdb/fetch.js +19 -17
- package/commands/hubdb/list.d.ts +1 -1
- package/commands/hubdb/list.js +35 -33
- package/commands/hubdb.d.ts +1 -1
- package/commands/hubdb.js +24 -18
- package/commands/init.d.ts +1 -1
- package/commands/init.js +88 -83
- package/commands/lint.d.ts +1 -1
- package/commands/lint.js +26 -24
- package/commands/list.d.ts +1 -1
- package/commands/list.js +37 -32
- package/commands/logs.d.ts +1 -1
- package/commands/logs.js +37 -35
- package/commands/mcp/__tests__/setup.test.js +12 -7
- package/commands/mcp/__tests__/start.test.js +12 -7
- package/commands/mcp/setup.d.ts +1 -1
- package/commands/mcp/setup.js +20 -17
- package/commands/mcp/start.d.ts +5 -2
- package/commands/mcp/start.js +41 -31
- package/commands/mcp.d.ts +1 -1
- package/commands/mcp.js +12 -7
- package/commands/module/marketplace-validate.d.ts +1 -1
- package/commands/module/marketplace-validate.js +26 -21
- package/commands/module.d.ts +1 -1
- package/commands/module.js +13 -7
- package/commands/mv.d.ts +1 -1
- package/commands/mv.js +22 -20
- package/commands/open.d.ts +1 -1
- package/commands/open.js +21 -19
- package/commands/project/__tests__/add.test.js +15 -10
- package/commands/project/__tests__/create.test.js +19 -14
- package/commands/project/__tests__/deploy.test.js +143 -103
- package/commands/project/__tests__/devUnifiedFlow.test.js +157 -148
- package/commands/project/__tests__/download.test.js +19 -14
- package/commands/project/__tests__/installDeps.test.js +70 -32
- package/commands/project/__tests__/listBuilds.test.js +19 -14
- package/commands/project/__tests__/logs.test.js +94 -56
- package/commands/project/__tests__/migrate.test.js +30 -25
- package/commands/project/__tests__/migrateApp.test.js +22 -17
- package/commands/project/__tests__/open.test.js +21 -16
- package/commands/project/__tests__/profile.test.js +19 -14
- package/commands/project/__tests__/upload.test.js +23 -18
- package/commands/project/__tests__/watch.test.js +19 -14
- package/commands/project/add.d.ts +1 -1
- package/commands/project/add.js +36 -34
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/cloneApp.js +72 -67
- package/commands/project/create.d.ts +2 -2
- package/commands/project/create.js +68 -63
- package/commands/project/deploy.d.ts +3 -2
- package/commands/project/deploy.js +102 -91
- package/commands/project/dev/deprecatedFlow.d.ts +2 -2
- package/commands/project/dev/deprecatedFlow.js +58 -52
- package/commands/project/dev/index.d.ts +1 -1
- package/commands/project/dev/index.js +47 -44
- package/commands/project/dev/unifiedFlow.d.ts +3 -3
- package/commands/project/dev/unifiedFlow.js +74 -67
- package/commands/project/download.d.ts +1 -1
- package/commands/project/download.js +40 -35
- package/commands/project/installDeps.d.ts +1 -1
- package/commands/project/installDeps.js +34 -29
- package/commands/project/listBuilds.d.ts +1 -1
- package/commands/project/listBuilds.js +45 -40
- package/commands/project/logs.d.ts +1 -1
- package/commands/project/logs.js +54 -52
- package/commands/project/migrate.d.ts +1 -1
- package/commands/project/migrate.js +26 -24
- package/commands/project/migrateApp.d.ts +2 -2
- package/commands/project/migrateApp.js +20 -18
- package/commands/project/open.d.ts +1 -1
- package/commands/project/open.js +30 -25
- package/commands/project/profile/add.d.ts +1 -1
- package/commands/project/profile/add.js +73 -68
- package/commands/project/profile/delete.d.ts +1 -1
- package/commands/project/profile/delete.js +56 -51
- package/commands/project/profile.d.ts +1 -1
- package/commands/project/profile.js +14 -9
- package/commands/project/upload.d.ts +1 -1
- package/commands/project/upload.js +55 -50
- package/commands/project/validate.d.ts +1 -1
- package/commands/project/validate.js +40 -35
- package/commands/project/watch.d.ts +1 -1
- package/commands/project/watch.js +61 -59
- package/commands/project.d.ts +1 -1
- package/commands/project.js +43 -38
- package/commands/remove.d.ts +1 -1
- package/commands/remove.js +17 -15
- package/commands/sandbox/__tests__/create.test.js +20 -15
- package/commands/sandbox/__tests__/delete.test.js +20 -15
- package/commands/sandbox/create.d.ts +1 -1
- package/commands/sandbox/create.js +69 -67
- package/commands/sandbox/delete.d.ts +1 -1
- package/commands/sandbox/delete.js +96 -94
- package/commands/sandbox.d.ts +1 -1
- package/commands/sandbox.js +14 -9
- package/commands/secret/__tests__/addSecret.test.js +18 -13
- package/commands/secret/__tests__/deleteSecret.test.js +18 -13
- package/commands/secret/__tests__/listSecret.test.js +18 -13
- package/commands/secret/__tests__/updateSecret.test.js +18 -13
- package/commands/secret/addSecret.d.ts +1 -1
- package/commands/secret/addSecret.js +28 -26
- package/commands/secret/deleteSecret.d.ts +1 -1
- package/commands/secret/deleteSecret.js +29 -27
- package/commands/secret/listSecret.d.ts +1 -1
- package/commands/secret/listSecret.js +21 -19
- package/commands/secret/updateSecret.d.ts +1 -1
- package/commands/secret/updateSecret.js +27 -25
- package/commands/secret.d.ts +1 -1
- package/commands/secret.js +18 -13
- package/commands/testAccount/__tests__/create.test.js +22 -17
- package/commands/testAccount/__tests__/createConfig.test.js +11 -9
- package/commands/testAccount/__tests__/delete.test.js +20 -15
- package/commands/testAccount/create.d.ts +1 -1
- package/commands/testAccount/create.js +57 -62
- package/commands/testAccount/createConfig.d.ts +1 -3
- package/commands/testAccount/createConfig.js +47 -43
- package/commands/testAccount/delete.d.ts +1 -1
- package/commands/testAccount/delete.js +19 -17
- package/commands/testAccount.d.ts +1 -1
- package/commands/testAccount.js +15 -10
- package/commands/theme/__tests__/generate-selectors.test.js +12 -7
- package/commands/theme/__tests__/marketplace-validate.test.js +19 -14
- package/commands/theme/__tests__/preview.test.js +17 -12
- package/commands/theme/generate-selectors.d.ts +1 -1
- package/commands/theme/generate-selectors.js +28 -23
- package/commands/theme/marketplace-validate.d.ts +1 -1
- package/commands/theme/marketplace-validate.js +24 -19
- package/commands/theme/preview.d.ts +1 -1
- package/commands/theme/preview.js +65 -60
- package/commands/theme.d.ts +1 -1
- package/commands/theme.js +16 -11
- package/commands/upload.d.ts +1 -1
- package/commands/upload.js +82 -77
- package/commands/watch.d.ts +1 -1
- package/commands/watch.js +51 -45
- package/lang/en.d.ts +62 -23
- package/lang/en.js +434 -389
- package/lang/en.lyaml +0 -26
- package/lib/__tests__/accountTypes.test.js +22 -20
- package/lib/__tests__/buildAccount.test.js +90 -27
- package/lib/__tests__/commonOpts.test.js +22 -20
- package/lib/__tests__/dependencyManagement.test.js +51 -46
- package/lib/__tests__/developerTestAccounts.test.js +62 -27
- package/lib/__tests__/hasFeature.test.js +8 -6
- package/lib/__tests__/npm.test.js +20 -15
- package/lib/__tests__/oauth.test.js +28 -23
- package/lib/__tests__/parsing.test.js +20 -18
- package/lib/__tests__/polling.test.js +26 -24
- package/lib/__tests__/process.test.js +19 -14
- package/lib/__tests__/projectProfiles.test.js +39 -34
- package/lib/__tests__/sandboxSync.test.js +35 -30
- package/lib/__tests__/sandboxes.test.js +31 -29
- package/lib/__tests__/serverlessLogs.test.js +13 -8
- package/lib/__tests__/usageTracking.test.js +42 -47
- package/lib/__tests__/validation.test.js +20 -18
- package/lib/__tests__/yargsUtils.test.js +41 -6
- package/lib/accountTypes.js +34 -24
- package/lib/app/__tests__/migrate.test.js +99 -94
- package/lib/app/__tests__/migrate_legacy.test.js +31 -29
- package/lib/app/migrate.d.ts +3 -3
- package/lib/app/migrate.js +145 -127
- package/lib/app/migrate_legacy.d.ts +1 -1
- package/lib/app/migrate_legacy.js +78 -72
- package/lib/app/urls.js +9 -5
- package/lib/buildAccount.d.ts +8 -2
- package/lib/buildAccount.js +119 -61
- package/lib/commonOpts.d.ts +1 -1
- package/lib/commonOpts.js +59 -42
- package/lib/configMigrate.js +38 -34
- package/lib/configOptions.js +40 -34
- package/lib/constants.js +34 -31
- package/lib/customObject.js +6 -2
- package/lib/dependencyManagement.js +45 -37
- package/lib/developerTestAccounts.d.ts +1 -1
- package/lib/developerTestAccounts.js +39 -34
- package/lib/doctor/Diagnosis.d.ts +1 -1
- package/lib/doctor/Diagnosis.js +29 -25
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +1 -1
- package/lib/doctor/DiagnosticInfoBuilder.js +37 -30
- package/lib/doctor/Doctor.d.ts +1 -1
- package/lib/doctor/Doctor.js +101 -94
- package/lib/doctor/__tests__/Diagnosis.test.js +14 -9
- package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.js +34 -29
- package/lib/doctor/__tests__/Doctor.test.js +26 -24
- package/lib/enums/exitCodes.js +4 -1
- package/lib/errorHandlers/index.js +41 -32
- package/lib/errorHandlers/suppressError.d.ts +1 -1
- package/lib/errorHandlers/suppressError.js +31 -28
- package/lib/filesystem.js +15 -8
- package/lib/generateSelectors.js +29 -18
- package/lib/hasFeature.d.ts +1 -1
- package/lib/hasFeature.js +6 -3
- package/lib/interpolation.js +18 -11
- package/lib/lang.d.ts +1 -1
- package/lib/lang.js +27 -22
- package/lib/links.js +24 -16
- package/lib/marketplaceValidate.js +39 -29
- package/lib/mcp/setup.js +105 -72
- package/lib/middleware/__test__/configMiddleware.test.js +55 -20
- package/lib/middleware/__test__/gitMiddleware.test.js +42 -7
- package/lib/middleware/__test__/notificationsMiddleware.test.js +4 -2
- package/lib/middleware/__test__/requestMiddleware.test.js +11 -6
- package/lib/middleware/__test__/utils.test.js +11 -9
- package/lib/middleware/__test__/yargsChecksMiddleware.test.js +44 -9
- package/lib/middleware/autoUpdateMiddleware.js +40 -33
- package/lib/middleware/configMiddleware.js +42 -36
- package/lib/middleware/fireAlarmMiddleware.js +18 -12
- package/lib/middleware/gitMiddleware.js +8 -5
- package/lib/middleware/notificationsMiddleware.js +23 -16
- package/lib/middleware/requestMiddleware.js +10 -4
- package/lib/middleware/utils.js +4 -1
- package/lib/middleware/yargsChecksMiddleware.js +13 -10
- package/lib/npm.js +23 -14
- package/lib/oauth.js +35 -29
- package/lib/parsing.js +6 -3
- package/lib/polling.js +15 -11
- package/lib/process.js +19 -11
- package/lib/projectProfiles.d.ts +2 -2
- package/lib/projectProfiles.js +42 -32
- package/lib/projects/ProjectLogsManager.js +21 -18
- package/lib/projects/__tests__/AppDevModeInterface.test.js +145 -140
- package/lib/projects/__tests__/LocalDevProcess.test.js +73 -68
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +37 -32
- package/lib/projects/__tests__/ProjectLogsManager.test.js +58 -56
- package/lib/projects/__tests__/buildAndDeploy.test.js +9 -7
- package/lib/projects/__tests__/components.test.js +14 -9
- package/lib/projects/__tests__/projects.test.js +40 -35
- package/lib/projects/__tests__/structure.test.js +81 -43
- package/lib/projects/add/__tests__/legacyAddComponent.test.js +28 -26
- package/lib/projects/add/__tests__/v3AddComponent.test.js +30 -25
- package/lib/projects/add/legacyAddComponent.d.ts +1 -1
- package/lib/projects/add/legacyAddComponent.js +30 -24
- package/lib/projects/add/v3AddComponent.d.ts +1 -1
- package/lib/projects/add/v3AddComponent.js +42 -36
- package/lib/projects/buildAndDeploy.d.ts +1 -1
- package/lib/projects/buildAndDeploy.js +97 -88
- package/lib/projects/components.js +25 -19
- package/lib/projects/config.d.ts +1 -1
- package/lib/projects/config.js +41 -32
- package/lib/projects/create/__tests__/legacy.test.js +57 -22
- package/lib/projects/create/__tests__/v3.test.js +7 -5
- package/lib/projects/create/index.d.ts +3 -3
- package/lib/projects/create/index.js +22 -19
- package/lib/projects/create/legacy.d.ts +1 -1
- package/lib/projects/create/legacy.js +31 -25
- package/lib/projects/create/v3.d.ts +3 -3
- package/lib/projects/create/v3.js +59 -49
- package/lib/projects/ensureProjectExists.js +37 -31
- package/lib/projects/localDev/AppDevModeInterface.d.ts +3 -3
- package/lib/projects/localDev/AppDevModeInterface.js +60 -58
- package/lib/projects/localDev/DevServerManager.d.ts +1 -1
- package/lib/projects/localDev/DevServerManager.js +24 -24
- package/lib/projects/localDev/DevServerManagerV2.d.ts +2 -2
- package/lib/projects/localDev/DevServerManagerV2.js +20 -17
- package/lib/projects/localDev/LocalDevLogger.d.ts +1 -1
- package/lib/projects/localDev/LocalDevLogger.js +64 -59
- package/lib/projects/localDev/LocalDevManager.d.ts +1 -1
- package/lib/projects/localDev/LocalDevManager.js +111 -106
- package/lib/projects/localDev/LocalDevProcess.d.ts +4 -4
- package/lib/projects/localDev/LocalDevProcess.js +30 -25
- package/lib/projects/localDev/LocalDevState.d.ts +3 -3
- package/lib/projects/localDev/LocalDevState.js +5 -3
- package/lib/projects/localDev/LocalDevWatcher.d.ts +1 -1
- package/lib/projects/localDev/LocalDevWatcher.js +11 -6
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +1 -1
- package/lib/projects/localDev/LocalDevWebsocketServer.js +27 -25
- package/lib/projects/localDev/helpers.d.ts +4 -4
- package/lib/projects/localDev/helpers.js +174 -156
- package/lib/projects/structure.d.ts +4 -4
- package/lib/projects/structure.js +78 -32
- package/lib/projects/ui.js +13 -10
- package/lib/projects/upload.d.ts +3 -2
- package/lib/projects/upload.js +65 -55
- package/lib/projects/urls.js +24 -14
- package/lib/projects/watch.d.ts +1 -1
- package/lib/projects/watch.js +54 -48
- package/lib/prompts/__tests__/downloadProjectPrompt.test.js +11 -9
- package/lib/prompts/__tests__/projectsLogsPrompt.test.js +16 -11
- package/lib/prompts/accountNamePrompt.d.ts +1 -1
- package/lib/prompts/accountNamePrompt.js +31 -26
- package/lib/prompts/accountsPrompt.js +15 -12
- package/lib/prompts/cmsFieldPrompt.js +19 -13
- package/lib/prompts/createApiSamplePrompt.d.ts +1 -1
- package/lib/prompts/createApiSamplePrompt.js +12 -9
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +11 -10
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +88 -43
- package/lib/prompts/createFunctionPrompt.js +20 -17
- package/lib/prompts/createModulePrompt.js +15 -12
- package/lib/prompts/createTemplatePrompt.js +8 -5
- package/lib/prompts/downloadProjectPrompt.js +20 -17
- package/lib/prompts/installAppPrompt.js +26 -19
- package/lib/prompts/personalAccessKeyPrompt.d.ts +2 -2
- package/lib/prompts/personalAccessKeyPrompt.js +47 -40
- package/lib/prompts/previewPrompt.js +22 -15
- package/lib/prompts/projectAddPrompt.d.ts +1 -1
- package/lib/prompts/projectAddPrompt.js +18 -14
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +1 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +54 -48
- package/lib/prompts/projectNameAndDestPrompt.d.ts +1 -1
- package/lib/prompts/projectNameAndDestPrompt.js +29 -22
- package/lib/prompts/projectNamePrompt.js +14 -11
- package/lib/prompts/projectsLogsPrompt.js +8 -5
- package/lib/prompts/promptUtils.d.ts +1 -1
- package/lib/prompts/promptUtils.js +87 -70
- package/lib/prompts/sandboxesPrompt.d.ts +1 -1
- package/lib/prompts/sandboxesPrompt.js +30 -26
- package/lib/prompts/secretPrompt.js +15 -10
- package/lib/prompts/selectAppPrompt.js +14 -11
- package/lib/prompts/selectHubDBTablePrompt.js +30 -24
- package/lib/prompts/selectProjectTemplatePrompt.d.ts +1 -1
- package/lib/prompts/selectProjectTemplatePrompt.js +13 -10
- package/lib/prompts/selectPublicAppForMigrationPrompt.js +25 -22
- package/lib/prompts/setAsDefaultAccountPrompt.js +16 -13
- package/lib/prompts/uploadPrompt.js +17 -11
- package/lib/sandboxSync.d.ts +1 -1
- package/lib/sandboxSync.js +65 -58
- package/lib/sandboxes.d.ts +1 -1
- package/lib/sandboxes.js +76 -68
- package/lib/schema.js +23 -12
- package/lib/serverlessLogs.js +52 -45
- package/lib/testUtils.js +8 -4
- package/lib/ui/SpinniesManager.d.ts +1 -1
- package/lib/ui/SpinniesManager.js +34 -29
- package/lib/ui/boxen.js +14 -11
- package/lib/ui/git.js +20 -14
- package/lib/ui/index.js +74 -56
- package/lib/ui/logger.js +13 -10
- package/lib/ui/serverlessFunctionLogs.js +20 -14
- package/lib/ui/spinniesUtils.js +39 -24
- package/lib/ui/supportHyperlinks.js +6 -3
- package/lib/ui/supportsColor.js +17 -11
- package/lib/ui/table.js +13 -6
- package/lib/upload.js +21 -15
- package/lib/usageTracking.d.ts +11 -0
- package/lib/usageTracking.js +95 -95
- package/lib/utils/hasFlag.js +8 -2
- package/lib/validation.js +87 -48
- package/lib/yargsUtils.d.ts +1 -1
- package/lib/yargsUtils.js +16 -13
- package/mcp-server/server.js +8 -6
- package/mcp-server/tools/index.js +16 -13
- package/mcp-server/tools/project/AddFeatureToProject.d.ts +1 -1
- package/mcp-server/tools/project/AddFeatureToProject.js +41 -34
- package/mcp-server/tools/project/CreateProjectTool.d.ts +3 -3
- package/mcp-server/tools/project/CreateProjectTool.js +52 -45
- package/mcp-server/tools/project/DeployProject.d.ts +1 -1
- package/mcp-server/tools/project/DeployProject.js +24 -17
- package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +1 -1
- package/mcp-server/tools/project/GuidedWalkthroughTool.js +27 -20
- package/mcp-server/tools/project/UploadProjectTools.d.ts +1 -1
- package/mcp-server/tools/project/UploadProjectTools.js +21 -11
- package/mcp-server/tools/project/ValidateProjectTool.d.ts +1 -1
- package/mcp-server/tools/project/ValidateProjectTool.js +19 -12
- package/mcp-server/tools/project/__tests__/AddFeatureToProject.test.js +15 -12
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +16 -13
- package/mcp-server/tools/project/__tests__/DeployProject.test.js +9 -6
- package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.js +7 -4
- package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +7 -4
- package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.js +7 -4
- package/mcp-server/tools/project/constants.js +9 -3
- package/mcp-server/types.js +5 -1
- package/mcp-server/utils/__tests__/command.test.js +11 -9
- package/mcp-server/utils/__tests__/project.test.js +26 -18
- package/mcp-server/utils/command.d.ts +1 -1
- package/mcp-server/utils/command.js +11 -4
- package/mcp-server/utils/content.d.ts +1 -1
- package/mcp-server/utils/content.js +6 -2
- package/mcp-server/utils/project.js +17 -8
- package/mcp-server/utils/toolUsageTracking.d.ts +1 -0
- package/mcp-server/utils/toolUsageTracking.js +25 -0
- package/package.json +13 -17
- package/types/{cms.d.ts → Cms.d.ts} +1 -1
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +4 -4
- package/types/LocalDev.js +2 -1
- package/types/ProjectComponents.d.ts +2 -2
- package/types/ProjectComponents.js +2 -1
- package/types/Projects.d.ts +1 -1
- package/types/Projects.js +5 -2
- package/types/Prompts.js +2 -1
- package/types/Sandboxes.js +2 -0
- package/types/Yargs.js +2 -1
- package/types/sandboxes.js +0 -1
- /package/{types/cms.js → commands/app/__tests__/install.test.d.ts} +0 -0
- /package/types/{sandboxes.d.ts → Sandboxes.d.ts} +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const http_1 = require("@hubspot/local-dev-lib/http");
|
|
4
|
+
const Migration_1 = require("@hubspot/local-dev-lib/types/Migration");
|
|
5
|
+
const migrate_1 = require("../migrate");
|
|
4
6
|
vi.mock('@hubspot/local-dev-lib/http');
|
|
5
|
-
const httpMock = http;
|
|
7
|
+
const httpMock = http_1.http;
|
|
6
8
|
describe('api/migrate', () => {
|
|
7
9
|
const mockAccountId = 12345;
|
|
8
10
|
const mockPortalId = 12345;
|
|
@@ -39,8 +41,8 @@ describe('api/migrate', () => {
|
|
|
39
41
|
};
|
|
40
42
|
// @ts-expect-error Mock
|
|
41
43
|
httpMock.get.mockResolvedValue(mockResponse);
|
|
42
|
-
const result = await listAppsForMigration(mockAccountId, mockPlatformVersion);
|
|
43
|
-
expect(http.get).toHaveBeenCalledWith(mockAccountId, {
|
|
44
|
+
const result = await (0, migrate_1.listAppsForMigration)(mockAccountId, mockPlatformVersion);
|
|
45
|
+
expect(http_1.http.get).toHaveBeenCalledWith(mockAccountId, {
|
|
44
46
|
url: 'dfs/migrations/v2/list-apps',
|
|
45
47
|
params: {
|
|
46
48
|
platformVersion: convertedPlatformVersion,
|
|
@@ -54,8 +56,8 @@ describe('api/migrate', () => {
|
|
|
54
56
|
const mockResponse = { migrationId: mockMigrationId };
|
|
55
57
|
// @ts-expect-error Mock
|
|
56
58
|
httpMock.post.mockResolvedValue(mockResponse);
|
|
57
|
-
const result = await initializeMigration(mockAccountId, mockAppId, mockPlatformVersion);
|
|
58
|
-
expect(http.post).toHaveBeenCalledWith(mockAccountId, {
|
|
59
|
+
const result = await (0, migrate_1.initializeMigration)(mockAccountId, mockAppId, mockPlatformVersion);
|
|
60
|
+
expect(http_1.http.post).toHaveBeenCalledWith(mockAccountId, {
|
|
59
61
|
url: 'dfs/migrations/v2/migrations',
|
|
60
62
|
data: {
|
|
61
63
|
applicationId: mockAppId,
|
|
@@ -70,8 +72,8 @@ describe('api/migrate', () => {
|
|
|
70
72
|
const mockResponse = { migrationId: mockMigrationId };
|
|
71
73
|
// @ts-expect-error Mock
|
|
72
74
|
httpMock.post.mockResolvedValue(mockResponse);
|
|
73
|
-
const result = await continueMigration(mockPortalId, mockMigrationId, mockComponentUids, mockProjectName);
|
|
74
|
-
expect(http.post).toHaveBeenCalledWith(mockPortalId, {
|
|
75
|
+
const result = await (0, migrate_1.continueMigration)(mockPortalId, mockMigrationId, mockComponentUids, mockProjectName);
|
|
76
|
+
expect(http_1.http.post).toHaveBeenCalledWith(mockPortalId, {
|
|
75
77
|
url: 'dfs/migrations/v2/migrations/continue',
|
|
76
78
|
data: {
|
|
77
79
|
migrationId: mockMigrationId,
|
|
@@ -86,12 +88,12 @@ describe('api/migrate', () => {
|
|
|
86
88
|
it('should call http.get with correct parameters for in-progress status', async () => {
|
|
87
89
|
const mockResponse = {
|
|
88
90
|
id: mockMigrationId,
|
|
89
|
-
status: MIGRATION_STATUS.IN_PROGRESS,
|
|
91
|
+
status: Migration_1.MIGRATION_STATUS.IN_PROGRESS,
|
|
90
92
|
};
|
|
91
93
|
// @ts-expect-error Mock
|
|
92
94
|
httpMock.get.mockResolvedValue(mockResponse);
|
|
93
|
-
const result = await checkMigrationStatusV2(mockAccountId, mockMigrationId);
|
|
94
|
-
expect(http.get).toHaveBeenCalledWith(mockAccountId, {
|
|
95
|
+
const result = await (0, migrate_1.checkMigrationStatusV2)(mockAccountId, mockMigrationId);
|
|
96
|
+
expect(http_1.http.get).toHaveBeenCalledWith(mockAccountId, {
|
|
95
97
|
url: `dfs/migrations/v2/migrations/${mockMigrationId}/status`,
|
|
96
98
|
});
|
|
97
99
|
expect(result).toEqual(mockResponse);
|
|
@@ -99,7 +101,7 @@ describe('api/migrate', () => {
|
|
|
99
101
|
it('should handle input required status', async () => {
|
|
100
102
|
const mockResponse = {
|
|
101
103
|
id: mockMigrationId,
|
|
102
|
-
status: MIGRATION_STATUS.INPUT_REQUIRED,
|
|
104
|
+
status: Migration_1.MIGRATION_STATUS.INPUT_REQUIRED,
|
|
103
105
|
componentsRequiringUids: {
|
|
104
106
|
'component-1': {
|
|
105
107
|
componentType: 'type1',
|
|
@@ -109,30 +111,30 @@ describe('api/migrate', () => {
|
|
|
109
111
|
};
|
|
110
112
|
// @ts-expect-error Mock
|
|
111
113
|
httpMock.get.mockResolvedValue(mockResponse);
|
|
112
|
-
const result = await checkMigrationStatusV2(mockAccountId, mockMigrationId);
|
|
114
|
+
const result = await (0, migrate_1.checkMigrationStatusV2)(mockAccountId, mockMigrationId);
|
|
113
115
|
expect(result).toEqual(mockResponse);
|
|
114
116
|
});
|
|
115
117
|
it('should handle success status', async () => {
|
|
116
118
|
const mockResponse = {
|
|
117
119
|
id: mockMigrationId,
|
|
118
|
-
status: MIGRATION_STATUS.SUCCESS,
|
|
120
|
+
status: Migration_1.MIGRATION_STATUS.SUCCESS,
|
|
119
121
|
buildId: 98765,
|
|
120
122
|
};
|
|
121
123
|
// @ts-expect-error Mock
|
|
122
124
|
httpMock.get.mockResolvedValue(mockResponse);
|
|
123
|
-
const result = await checkMigrationStatusV2(mockAccountId, mockMigrationId);
|
|
125
|
+
const result = await (0, migrate_1.checkMigrationStatusV2)(mockAccountId, mockMigrationId);
|
|
124
126
|
expect(result).toEqual(mockResponse);
|
|
125
127
|
});
|
|
126
128
|
it('should handle failure status', async () => {
|
|
127
129
|
const mockResponse = {
|
|
128
130
|
id: mockMigrationId,
|
|
129
|
-
status: MIGRATION_STATUS.FAILURE,
|
|
131
|
+
status: Migration_1.MIGRATION_STATUS.FAILURE,
|
|
130
132
|
projectErrorDetail: 'Error details',
|
|
131
133
|
componentErrors: [],
|
|
132
134
|
};
|
|
133
135
|
// @ts-expect-error Mock
|
|
134
136
|
httpMock.get.mockResolvedValue(mockResponse);
|
|
135
|
-
const result = await checkMigrationStatusV2(mockAccountId, mockMigrationId);
|
|
137
|
+
const result = await (0, migrate_1.checkMigrationStatusV2)(mockAccountId, mockMigrationId);
|
|
136
138
|
expect(result).toEqual(mockResponse);
|
|
137
139
|
});
|
|
138
140
|
});
|
|
@@ -141,11 +143,11 @@ describe('isMigrationStatus', () => {
|
|
|
141
143
|
it.each([
|
|
142
144
|
{
|
|
143
145
|
id: 123,
|
|
144
|
-
status: MIGRATION_STATUS.IN_PROGRESS,
|
|
146
|
+
status: Migration_1.MIGRATION_STATUS.IN_PROGRESS,
|
|
145
147
|
},
|
|
146
148
|
{
|
|
147
149
|
id: 456,
|
|
148
|
-
status: MIGRATION_STATUS.INPUT_REQUIRED,
|
|
150
|
+
status: Migration_1.MIGRATION_STATUS.INPUT_REQUIRED,
|
|
149
151
|
componentsRequiringUids: {
|
|
150
152
|
'component-1': {
|
|
151
153
|
componentType: 'type1',
|
|
@@ -155,27 +157,27 @@ describe('isMigrationStatus', () => {
|
|
|
155
157
|
},
|
|
156
158
|
{
|
|
157
159
|
id: 789,
|
|
158
|
-
status: MIGRATION_STATUS.SUCCESS,
|
|
160
|
+
status: Migration_1.MIGRATION_STATUS.SUCCESS,
|
|
159
161
|
buildId: 98765,
|
|
160
162
|
},
|
|
161
163
|
{
|
|
162
164
|
id: 101,
|
|
163
|
-
status: MIGRATION_STATUS.FAILURE,
|
|
165
|
+
status: Migration_1.MIGRATION_STATUS.FAILURE,
|
|
164
166
|
projectErrorDetail: 'Error details',
|
|
165
167
|
componentErrors: [],
|
|
166
168
|
},
|
|
167
169
|
])('should return true for valid MigrationStatus object %j', status => {
|
|
168
|
-
expect(isMigrationStatus(status)).toBe(true);
|
|
170
|
+
expect((0, migrate_1.isMigrationStatus)(status)).toBe(true);
|
|
169
171
|
});
|
|
170
172
|
it.each([null, undefined, 123, 'string', true, false, []])('should return false for non-object value %j', value => {
|
|
171
|
-
expect(isMigrationStatus(value)).toBe(false);
|
|
173
|
+
expect((0, migrate_1.isMigrationStatus)(value)).toBe(false);
|
|
172
174
|
});
|
|
173
175
|
it.each([
|
|
174
176
|
{},
|
|
175
177
|
{ id: 123 },
|
|
176
|
-
{ status: MIGRATION_STATUS.IN_PROGRESS },
|
|
178
|
+
{ status: Migration_1.MIGRATION_STATUS.IN_PROGRESS },
|
|
177
179
|
{ foo: 'bar' },
|
|
178
180
|
])('should return false for invalid object %j', obj => {
|
|
179
|
-
expect(isMigrationStatus(obj)).toBe(false);
|
|
181
|
+
expect((0, migrate_1.isMigrationStatus)(obj)).toBe(false);
|
|
180
182
|
});
|
|
181
183
|
});
|
package/api/migrate.js
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CLI_UNMIGRATABLE_REASONS = void 0;
|
|
4
|
+
exports.isMigrationStatus = isMigrationStatus;
|
|
5
|
+
exports.listAppsForMigration = listAppsForMigration;
|
|
6
|
+
exports.initializeMigration = initializeMigration;
|
|
7
|
+
exports.continueMigration = continueMigration;
|
|
8
|
+
exports.checkMigrationStatusV2 = checkMigrationStatusV2;
|
|
9
|
+
const projects_1 = require("@hubspot/local-dev-lib/constants/projects");
|
|
10
|
+
const http_1 = require("@hubspot/local-dev-lib/http");
|
|
3
11
|
const MIGRATIONS_API_PATH_V2 = 'dfs/migrations/v2';
|
|
4
|
-
|
|
12
|
+
exports.CLI_UNMIGRATABLE_REASONS = {
|
|
5
13
|
PART_OF_PROJECT_ALREADY: 'PART_OF_PROJECT_ALREADY',
|
|
6
14
|
};
|
|
7
|
-
|
|
15
|
+
function isMigrationStatus(error) {
|
|
8
16
|
return (typeof error === 'object' &&
|
|
9
17
|
error !== null &&
|
|
10
18
|
'id' in error &&
|
|
11
19
|
'status' in error);
|
|
12
20
|
}
|
|
13
|
-
|
|
14
|
-
return http.get(accountId, {
|
|
21
|
+
async function listAppsForMigration(accountId, platformVersion) {
|
|
22
|
+
return http_1.http.get(accountId, {
|
|
15
23
|
url: `${MIGRATIONS_API_PATH_V2}/list-apps`,
|
|
16
24
|
params: {
|
|
17
25
|
platformVersion: mapPlatformVersionToEnum(platformVersion),
|
|
@@ -19,13 +27,13 @@ export async function listAppsForMigration(accountId, platformVersion) {
|
|
|
19
27
|
});
|
|
20
28
|
}
|
|
21
29
|
function mapPlatformVersionToEnum(platformVersion) {
|
|
22
|
-
if (platformVersion === PLATFORM_VERSIONS.unstable) {
|
|
23
|
-
return PLATFORM_VERSIONS.unstable.toUpperCase();
|
|
30
|
+
if (platformVersion === projects_1.PLATFORM_VERSIONS.unstable) {
|
|
31
|
+
return projects_1.PLATFORM_VERSIONS.unstable.toUpperCase();
|
|
24
32
|
}
|
|
25
33
|
return `V${platformVersion.replace('.', '_')}`;
|
|
26
34
|
}
|
|
27
|
-
|
|
28
|
-
return http.post(accountId, {
|
|
35
|
+
async function initializeMigration(accountId, applicationId, platformVersion) {
|
|
36
|
+
return http_1.http.post(accountId, {
|
|
29
37
|
url: `${MIGRATIONS_API_PATH_V2}/migrations`,
|
|
30
38
|
data: {
|
|
31
39
|
applicationId,
|
|
@@ -33,8 +41,8 @@ export async function initializeMigration(accountId, applicationId, platformVers
|
|
|
33
41
|
},
|
|
34
42
|
});
|
|
35
43
|
}
|
|
36
|
-
|
|
37
|
-
return http.post(portalId, {
|
|
44
|
+
async function continueMigration(portalId, migrationId, componentUids, projectName) {
|
|
45
|
+
return http_1.http.post(portalId, {
|
|
38
46
|
url: `${MIGRATIONS_API_PATH_V2}/migrations/continue`,
|
|
39
47
|
data: {
|
|
40
48
|
migrationId,
|
|
@@ -43,8 +51,8 @@ export async function continueMigration(portalId, migrationId, componentUids, pr
|
|
|
43
51
|
},
|
|
44
52
|
});
|
|
45
53
|
}
|
|
46
|
-
|
|
47
|
-
return http.get(accountId, {
|
|
54
|
+
async function checkMigrationStatusV2(accountId, id) {
|
|
55
|
+
return http_1.http.get(accountId, {
|
|
48
56
|
url: `${MIGRATIONS_API_PATH_V2}/migrations/${id}/status`,
|
|
49
57
|
});
|
|
50
58
|
}
|
package/bin/cli.js
CHANGED
|
@@ -1,81 +1,86 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const yargs_1 = __importDefault(require("yargs"));
|
|
8
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
9
|
+
const index_1 = require("../lib/errorHandlers/index");
|
|
10
|
+
const commonOpts_1 = require("../lib/commonOpts");
|
|
11
|
+
const usageTracking_1 = require("../lib/usageTracking");
|
|
12
|
+
const exitCodes_1 = require("../lib/enums/exitCodes");
|
|
13
|
+
const configMiddleware_1 = require("../lib/middleware/configMiddleware");
|
|
14
|
+
const autoUpdateMiddleware_1 = require("../lib/middleware/autoUpdateMiddleware");
|
|
15
|
+
const gitMiddleware_1 = require("../lib/middleware/gitMiddleware");
|
|
16
|
+
const yargsChecksMiddleware_1 = require("../lib/middleware/yargsChecksMiddleware");
|
|
17
|
+
const requestMiddleware_1 = require("../lib/middleware/requestMiddleware");
|
|
18
|
+
const fireAlarmMiddleware_1 = require("../lib/middleware/fireAlarmMiddleware");
|
|
19
|
+
const remove_1 = __importDefault(require("../commands/remove"));
|
|
20
|
+
const init_1 = __importDefault(require("../commands/init"));
|
|
21
|
+
const logs_1 = __importDefault(require("../commands/logs"));
|
|
22
|
+
const lint_1 = __importDefault(require("../commands/lint"));
|
|
23
|
+
const hubdb_1 = __importDefault(require("../commands/hubdb"));
|
|
24
|
+
const watch_1 = __importDefault(require("../commands/watch"));
|
|
25
|
+
const auth_1 = __importDefault(require("../commands/auth"));
|
|
26
|
+
const upload_1 = __importDefault(require("../commands/upload"));
|
|
27
|
+
const create_1 = __importDefault(require("../commands/create"));
|
|
28
|
+
const fetch_1 = __importDefault(require("../commands/fetch"));
|
|
29
|
+
const filemanager_1 = __importDefault(require("../commands/filemanager"));
|
|
30
|
+
const secret_1 = __importDefault(require("../commands/secret"));
|
|
31
|
+
const customObject_1 = __importDefault(require("../commands/customObject"));
|
|
32
|
+
const function_1 = __importDefault(require("../commands/function"));
|
|
33
|
+
const list_1 = __importDefault(require("../commands/list"));
|
|
34
|
+
const open_1 = __importDefault(require("../commands/open"));
|
|
35
|
+
const mv_1 = __importDefault(require("../commands/mv"));
|
|
36
|
+
const project_1 = __importDefault(require("../commands/project"));
|
|
37
|
+
const theme_1 = __importDefault(require("../commands/theme"));
|
|
38
|
+
const module_1 = __importDefault(require("../commands/module"));
|
|
39
|
+
const config_1 = __importDefault(require("../commands/config"));
|
|
40
|
+
const account_1 = __importDefault(require("../commands/account"));
|
|
41
|
+
const sandbox_1 = __importDefault(require("../commands/sandbox"));
|
|
42
|
+
const cms_1 = __importDefault(require("../commands/cms"));
|
|
43
|
+
const feedback_1 = __importDefault(require("../commands/feedback"));
|
|
44
|
+
const doctor_1 = __importDefault(require("../commands/doctor"));
|
|
45
|
+
const completion_1 = __importDefault(require("../commands/completion"));
|
|
46
|
+
const app_1 = __importDefault(require("../commands/app"));
|
|
47
|
+
const testAccount_1 = __importDefault(require("../commands/testAccount"));
|
|
48
|
+
const getStarted_1 = __importDefault(require("../commands/getStarted"));
|
|
49
|
+
const mcp_1 = __importDefault(require("../commands/mcp"));
|
|
45
50
|
function getTerminalWidth() {
|
|
46
|
-
const width =
|
|
51
|
+
const width = yargs_1.default.terminalWidth();
|
|
47
52
|
if (width >= 100)
|
|
48
53
|
return width * 0.9;
|
|
49
54
|
return width;
|
|
50
55
|
}
|
|
51
56
|
function handleFailure(msg, err, yargs) {
|
|
52
57
|
if (msg) {
|
|
53
|
-
logger.error(msg);
|
|
58
|
+
logger_1.logger.error(msg);
|
|
54
59
|
}
|
|
55
60
|
else if (err) {
|
|
56
|
-
logError(err);
|
|
61
|
+
(0, index_1.logError)(err);
|
|
57
62
|
}
|
|
58
63
|
if (msg === null) {
|
|
59
64
|
yargs.showHelp('log');
|
|
60
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
65
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
61
66
|
}
|
|
62
67
|
else {
|
|
63
|
-
process.exit(EXIT_CODES.ERROR);
|
|
68
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
|
-
const argv =
|
|
71
|
+
const argv = yargs_1.default
|
|
67
72
|
.usage('The command line interface to interact with HubSpot.')
|
|
68
73
|
// loadConfigMiddleware loads the new hidden config for all commands
|
|
69
74
|
.middleware([
|
|
70
|
-
setLogLevel,
|
|
71
|
-
setRequestHeaders,
|
|
72
|
-
handleDeprecatedEnvVariables,
|
|
73
|
-
loadConfigMiddleware,
|
|
74
|
-
injectAccountIdMiddleware,
|
|
75
|
-
autoUpdateCLI,
|
|
76
|
-
checkAndWarnGitInclusionMiddleware,
|
|
77
|
-
validateAccountOptions,
|
|
78
|
-
checkFireAlarms,
|
|
75
|
+
commonOpts_1.setLogLevel,
|
|
76
|
+
requestMiddleware_1.setRequestHeaders,
|
|
77
|
+
configMiddleware_1.handleDeprecatedEnvVariables,
|
|
78
|
+
configMiddleware_1.loadConfigMiddleware,
|
|
79
|
+
configMiddleware_1.injectAccountIdMiddleware,
|
|
80
|
+
autoUpdateMiddleware_1.autoUpdateCLI,
|
|
81
|
+
gitMiddleware_1.checkAndWarnGitInclusionMiddleware,
|
|
82
|
+
configMiddleware_1.validateAccountOptions,
|
|
83
|
+
fireAlarmMiddleware_1.checkFireAlarms,
|
|
79
84
|
])
|
|
80
85
|
.exitProcess(false)
|
|
81
86
|
.fail(handleFailure)
|
|
@@ -91,38 +96,38 @@ const argv = yargs(process.argv.slice(2))
|
|
|
91
96
|
hidden: true,
|
|
92
97
|
type: 'boolean',
|
|
93
98
|
})
|
|
94
|
-
.check(performChecks)
|
|
95
|
-
.command(
|
|
96
|
-
.command(
|
|
97
|
-
.command(
|
|
98
|
-
.command(
|
|
99
|
-
.command(
|
|
100
|
-
.command(
|
|
101
|
-
.command(
|
|
102
|
-
.command(
|
|
103
|
-
.command(
|
|
104
|
-
.command(
|
|
105
|
-
.command(
|
|
106
|
-
.command(
|
|
107
|
-
.command(
|
|
108
|
-
.command(
|
|
109
|
-
.command(
|
|
110
|
-
.command(
|
|
111
|
-
.command(
|
|
112
|
-
.command(
|
|
113
|
-
.command(
|
|
114
|
-
.command(
|
|
115
|
-
.command(
|
|
116
|
-
.command(
|
|
117
|
-
.command(
|
|
118
|
-
.command(
|
|
119
|
-
.command(
|
|
120
|
-
.command(
|
|
121
|
-
.command(
|
|
122
|
-
.command(
|
|
123
|
-
.command(
|
|
124
|
-
.command(
|
|
125
|
-
.command(
|
|
99
|
+
.check(yargsChecksMiddleware_1.performChecks)
|
|
100
|
+
.command(auth_1.default)
|
|
101
|
+
.command(init_1.default)
|
|
102
|
+
.command(logs_1.default)
|
|
103
|
+
.command(cms_1.default)
|
|
104
|
+
.command(lint_1.default)
|
|
105
|
+
.command(hubdb_1.default)
|
|
106
|
+
.command(watch_1.default)
|
|
107
|
+
.command(remove_1.default)
|
|
108
|
+
.command(upload_1.default)
|
|
109
|
+
.command(create_1.default)
|
|
110
|
+
.command(fetch_1.default)
|
|
111
|
+
.command(filemanager_1.default)
|
|
112
|
+
.command(secret_1.default)
|
|
113
|
+
.command(customObject_1.default)
|
|
114
|
+
.command(function_1.default)
|
|
115
|
+
.command(list_1.default)
|
|
116
|
+
.command(open_1.default)
|
|
117
|
+
.command(mv_1.default)
|
|
118
|
+
.command(project_1.default)
|
|
119
|
+
.command(theme_1.default)
|
|
120
|
+
.command(module_1.default)
|
|
121
|
+
.command(config_1.default)
|
|
122
|
+
.command(account_1.default)
|
|
123
|
+
.command(sandbox_1.default)
|
|
124
|
+
.command(feedback_1.default)
|
|
125
|
+
.command(doctor_1.default)
|
|
126
|
+
.command(completion_1.default)
|
|
127
|
+
.command(app_1.default)
|
|
128
|
+
.command(testAccount_1.default)
|
|
129
|
+
.command(getStarted_1.default)
|
|
130
|
+
.command(mcp_1.default)
|
|
126
131
|
.help()
|
|
127
132
|
.alias('h', 'help')
|
|
128
133
|
.recommendCommands()
|
|
@@ -130,8 +135,12 @@ const argv = yargs(process.argv.slice(2))
|
|
|
130
135
|
.wrap(getTerminalWidth())
|
|
131
136
|
.strict().argv;
|
|
132
137
|
if ('help' in argv && argv.help !== undefined) {
|
|
133
|
-
|
|
138
|
+
(async () => {
|
|
139
|
+
await (0, usageTracking_1.trackHelpUsage)((0, commonOpts_1.getCommandName)(argv));
|
|
140
|
+
})();
|
|
134
141
|
}
|
|
135
142
|
if ('convertFields' in argv && argv.convertFields !== undefined) {
|
|
136
|
-
|
|
143
|
+
(async () => {
|
|
144
|
+
await (0, usageTracking_1.trackConvertFieldsUsage)((0, commonOpts_1.getCommandName)(argv));
|
|
145
|
+
})();
|
|
137
146
|
}
|
package/bin/hs
CHANGED
package/bin/hscms
CHANGED
package/bin/silenceErrors.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
4
|
const SILENCED_ERRORS = ['DeprecationWarning:'];
|
|
3
5
|
const originalConsoleError = console.error;
|
|
4
6
|
console.error = msg => {
|
|
@@ -8,4 +10,3 @@ console.error = msg => {
|
|
|
8
10
|
}
|
|
9
11
|
originalConsoleError(msg);
|
|
10
12
|
};
|
|
11
|
-
export {};
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 yargs_1 = __importDefault(require("yargs"));
|
|
7
|
+
const auth_1 = __importDefault(require("../account/auth"));
|
|
8
|
+
const list_1 = __importDefault(require("../account/list"));
|
|
9
|
+
const rename_1 = __importDefault(require("../account/rename"));
|
|
10
|
+
const use_1 = __importDefault(require("../account/use"));
|
|
11
|
+
const info_1 = __importDefault(require("../account/info"));
|
|
12
|
+
const remove_1 = __importDefault(require("../account/remove"));
|
|
13
|
+
const clean_1 = __importDefault(require("../account/clean"));
|
|
14
|
+
const createOverride_1 = __importDefault(require("../account/createOverride"));
|
|
15
|
+
const removeOverride_1 = __importDefault(require("../account/removeOverride"));
|
|
16
|
+
const account_1 = __importDefault(require("../account"));
|
|
12
17
|
vi.mock('../account/auth');
|
|
13
18
|
vi.mock('../account/list');
|
|
14
19
|
vi.mock('../account/rename');
|
|
@@ -20,20 +25,20 @@ vi.mock('../account/createOverride');
|
|
|
20
25
|
vi.mock('../account/removeOverride');
|
|
21
26
|
vi.mock('../../lib/commonOpts');
|
|
22
27
|
const commandSpy = vi
|
|
23
|
-
.spyOn(
|
|
24
|
-
.mockReturnValue(
|
|
28
|
+
.spyOn(yargs_1.default, 'command')
|
|
29
|
+
.mockReturnValue(yargs_1.default);
|
|
25
30
|
const demandCommandSpy = vi
|
|
26
|
-
.spyOn(
|
|
27
|
-
.mockReturnValue(
|
|
31
|
+
.spyOn(yargs_1.default, 'demandCommand')
|
|
32
|
+
.mockReturnValue(yargs_1.default);
|
|
28
33
|
describe('commands/account', () => {
|
|
29
34
|
describe('command', () => {
|
|
30
35
|
it('should have the correct command structure', () => {
|
|
31
|
-
expect(
|
|
36
|
+
expect(account_1.default.command).toEqual(['account', 'accounts']);
|
|
32
37
|
});
|
|
33
38
|
});
|
|
34
39
|
describe('describe', () => {
|
|
35
40
|
it('should provide a description', () => {
|
|
36
|
-
expect(
|
|
41
|
+
expect(account_1.default.describe).toBeDefined();
|
|
37
42
|
});
|
|
38
43
|
});
|
|
39
44
|
describe('builder', () => {
|
|
@@ -42,27 +47,27 @@ describe('commands/account', () => {
|
|
|
42
47
|
demandCommandSpy.mockClear();
|
|
43
48
|
});
|
|
44
49
|
const subcommands = [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
auth_1.default,
|
|
51
|
+
list_1.default,
|
|
52
|
+
rename_1.default,
|
|
53
|
+
use_1.default,
|
|
54
|
+
info_1.default,
|
|
55
|
+
remove_1.default,
|
|
56
|
+
clean_1.default,
|
|
57
|
+
createOverride_1.default,
|
|
58
|
+
removeOverride_1.default,
|
|
54
59
|
];
|
|
55
60
|
it('should demand the command takes one positional argument', () => {
|
|
56
|
-
|
|
61
|
+
account_1.default.builder(yargs_1.default);
|
|
57
62
|
expect(demandCommandSpy).toHaveBeenCalledTimes(1);
|
|
58
63
|
expect(demandCommandSpy).toHaveBeenCalledWith(1, '');
|
|
59
64
|
});
|
|
60
65
|
it('should add the correct number of sub commands', () => {
|
|
61
|
-
|
|
66
|
+
account_1.default.builder(yargs_1.default);
|
|
62
67
|
expect(commandSpy).toHaveBeenCalledTimes(subcommands.length);
|
|
63
68
|
});
|
|
64
69
|
it.each(subcommands)('should attach the %s subcommand', module => {
|
|
65
|
-
|
|
70
|
+
account_1.default.builder(yargs_1.default);
|
|
66
71
|
expect(commandSpy).toHaveBeenCalledWith(module);
|
|
67
72
|
});
|
|
68
73
|
});
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 yargs_1 = __importDefault(require("yargs"));
|
|
7
|
+
const commonOpts_1 = require("../../lib/commonOpts");
|
|
8
|
+
const auth_1 = __importDefault(require("../auth"));
|
|
4
9
|
vi.mock('../../lib/commonOpts');
|
|
5
10
|
const optionsSpy = vi
|
|
6
11
|
.spyOn(mockYargs, 'options')
|
|
7
|
-
.mockReturnValue(
|
|
12
|
+
.mockReturnValue(yargs_1.default);
|
|
8
13
|
describe('commands/auth', () => {
|
|
9
14
|
describe('command', () => {
|
|
10
15
|
it('should have the correct command structure', () => {
|
|
11
|
-
expect(
|
|
16
|
+
expect(auth_1.default.command).toEqual('auth');
|
|
12
17
|
});
|
|
13
18
|
});
|
|
14
19
|
describe('describe', () => {
|
|
15
20
|
it('should provide a description', () => {
|
|
16
|
-
expect(
|
|
21
|
+
expect(auth_1.default.describe).toBeDefined();
|
|
17
22
|
});
|
|
18
23
|
});
|
|
19
24
|
describe('builder', () => {
|
|
20
25
|
it('should support the correct options', () => {
|
|
21
|
-
|
|
26
|
+
auth_1.default.builder(yargs_1.default);
|
|
22
27
|
expect(optionsSpy).toHaveBeenCalledTimes(1);
|
|
23
28
|
expect(optionsSpy).toHaveBeenCalledWith({
|
|
24
29
|
'auth-type': expect.objectContaining({
|
|
@@ -29,10 +34,10 @@ describe('commands/auth', () => {
|
|
|
29
34
|
account: expect.objectContaining({ type: 'string' }),
|
|
30
35
|
'personal-access-key': expect.objectContaining({ type: 'string' }),
|
|
31
36
|
});
|
|
32
|
-
expect(addConfigOptions).toHaveBeenCalledTimes(1);
|
|
33
|
-
expect(addConfigOptions).toHaveBeenCalledWith(
|
|
34
|
-
expect(addTestingOptions).toHaveBeenCalledTimes(1);
|
|
35
|
-
expect(addTestingOptions).toHaveBeenCalledWith(
|
|
37
|
+
expect(commonOpts_1.addConfigOptions).toHaveBeenCalledTimes(1);
|
|
38
|
+
expect(commonOpts_1.addConfigOptions).toHaveBeenCalledWith(yargs_1.default);
|
|
39
|
+
expect(commonOpts_1.addTestingOptions).toHaveBeenCalledTimes(1);
|
|
40
|
+
expect(commonOpts_1.addTestingOptions).toHaveBeenCalledWith(yargs_1.default);
|
|
36
41
|
});
|
|
37
42
|
});
|
|
38
43
|
});
|