@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,122 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 fs_extra_1 = __importDefault(require("fs-extra"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
9
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
10
|
+
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
11
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
12
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
13
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
14
|
+
const validation_1 = require("../../lib/validation");
|
|
15
|
+
const en_1 = require("../../lang/en");
|
|
16
|
+
const createDeveloperTestAccountConfigPrompt_1 = require("../../lib/prompts/createDeveloperTestAccountConfigPrompt");
|
|
17
|
+
const errorHandlers_1 = require("../../lib/errorHandlers");
|
|
18
|
+
const SpinniesManager_1 = __importDefault(require("../../lib/ui/SpinniesManager"));
|
|
19
|
+
const buildAccount_1 = require("../../lib/buildAccount");
|
|
16
20
|
const command = 'create';
|
|
17
|
-
const describe = commands.testAccount.create.describe;
|
|
21
|
+
const describe = en_1.commands.testAccount.create.describe;
|
|
18
22
|
async function handler(args) {
|
|
19
23
|
const { derivedAccountId, configPath, formatOutputAsJson } = args;
|
|
20
|
-
trackCommandUsage('test-account-create', {}, derivedAccountId);
|
|
24
|
+
(0, usageTracking_1.trackCommandUsage)('test-account-create', {}, derivedAccountId);
|
|
21
25
|
let accountConfigPath = configPath;
|
|
22
26
|
let testAccountConfig;
|
|
23
27
|
if (!accountConfigPath) {
|
|
24
|
-
const createTestAccountFromConfig = await listPrompt(commands.testAccount.create.createTestAccountFromConfigPrompt, {
|
|
28
|
+
const createTestAccountFromConfig = await (0, promptUtils_1.listPrompt)(en_1.commands.testAccount.create.createTestAccountFromConfigPrompt, {
|
|
25
29
|
choices: [
|
|
26
30
|
{
|
|
27
|
-
name: commands.testAccount.create.createFromConfigOption,
|
|
31
|
+
name: en_1.commands.testAccount.create.createFromConfigOption,
|
|
28
32
|
value: true,
|
|
29
33
|
},
|
|
30
34
|
{
|
|
31
|
-
name: commands.testAccount.create.createFromScratchOption,
|
|
35
|
+
name: en_1.commands.testAccount.create.createFromScratchOption,
|
|
32
36
|
value: false,
|
|
33
37
|
},
|
|
34
38
|
],
|
|
35
39
|
});
|
|
36
40
|
if (createTestAccountFromConfig) {
|
|
37
|
-
const configPathPromptResult = await promptUser({
|
|
41
|
+
const configPathPromptResult = await (0, promptUtils_1.promptUser)({
|
|
38
42
|
name: 'configPath',
|
|
39
|
-
message: commands.testAccount.create.configPathPrompt,
|
|
43
|
+
message: en_1.commands.testAccount.create.configPathPrompt,
|
|
40
44
|
type: 'input',
|
|
41
45
|
});
|
|
42
46
|
accountConfigPath = configPathPromptResult.configPath;
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
if (accountConfigPath) {
|
|
46
|
-
const absoluteConfigPath =
|
|
47
|
-
if (!fileExists(absoluteConfigPath)) {
|
|
48
|
-
uiLogger.error(commands.testAccount.create.errors.configFileNotFound(absoluteConfigPath));
|
|
49
|
-
process.exit(EXIT_CODES.ERROR);
|
|
50
|
+
const absoluteConfigPath = path_1.default.resolve((0, path_2.getCwd)(), accountConfigPath);
|
|
51
|
+
if (!(0, validation_1.fileExists)(absoluteConfigPath)) {
|
|
52
|
+
logger_1.uiLogger.error(en_1.commands.testAccount.create.errors.configFileNotFound(absoluteConfigPath));
|
|
53
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
50
54
|
}
|
|
51
55
|
try {
|
|
52
|
-
testAccountConfig = JSON.parse(
|
|
56
|
+
testAccountConfig = JSON.parse(fs_extra_1.default.readFileSync(absoluteConfigPath, 'utf8'));
|
|
53
57
|
}
|
|
54
58
|
catch (err) {
|
|
55
|
-
uiLogger.error(commands.testAccount.create.errors.configFileParseFailed(absoluteConfigPath));
|
|
56
|
-
process.exit(EXIT_CODES.ERROR);
|
|
59
|
+
logger_1.uiLogger.error(en_1.commands.testAccount.create.errors.configFileParseFailed(absoluteConfigPath));
|
|
60
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
63
|
else {
|
|
60
|
-
testAccountConfig = await createDeveloperTestAccountConfigPrompt();
|
|
64
|
+
testAccountConfig = await (0, createDeveloperTestAccountConfigPrompt_1.createDeveloperTestAccountConfigPrompt)();
|
|
61
65
|
}
|
|
62
66
|
const jsonOutput = {};
|
|
63
67
|
let testAccountId;
|
|
64
|
-
|
|
68
|
+
SpinniesManager_1.default.init({
|
|
65
69
|
succeedColor: 'white',
|
|
66
70
|
});
|
|
67
|
-
|
|
68
|
-
text: commands.testAccount.create.polling.start(testAccountConfig.accountName),
|
|
71
|
+
SpinniesManager_1.default.add('createTestAccount', {
|
|
72
|
+
text: en_1.commands.testAccount.create.polling.start(testAccountConfig.accountName),
|
|
69
73
|
});
|
|
70
74
|
try {
|
|
71
|
-
const
|
|
75
|
+
const result = await (0, buildAccount_1.createDeveloperTestAccountV3)(derivedAccountId, testAccountConfig);
|
|
72
76
|
if (formatOutputAsJson) {
|
|
73
|
-
jsonOutput.accountName =
|
|
74
|
-
jsonOutput.accountId =
|
|
75
|
-
jsonOutput.personalAccessKey =
|
|
77
|
+
jsonOutput.accountName = result.accountName;
|
|
78
|
+
jsonOutput.accountId = result.accountId;
|
|
79
|
+
jsonOutput.personalAccessKey = result.personalAccessKey;
|
|
76
80
|
}
|
|
77
|
-
testAccountId =
|
|
81
|
+
testAccountId = result.accountId;
|
|
78
82
|
}
|
|
79
83
|
catch (err) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
SpinniesManager.update('createTestAccount', {
|
|
84
|
-
text: commands.testAccount.create.polling.syncing,
|
|
85
|
-
});
|
|
86
|
-
try {
|
|
87
|
-
await poll(() => fetchDeveloperTestAccountGateSyncStatus(derivedAccountId, testAccountId), {
|
|
88
|
-
successStates: ['SUCCESS'],
|
|
89
|
-
errorStates: [],
|
|
84
|
+
SpinniesManager_1.default.fail('createTestAccount', {
|
|
85
|
+
text: en_1.commands.testAccount.create.polling.createFailure,
|
|
90
86
|
});
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
catch (err) {
|
|
96
|
-
debugError(err);
|
|
97
|
-
SpinniesManager.fail('createTestAccount', {
|
|
98
|
-
text: commands.testAccount.create.polling.failure,
|
|
87
|
+
(0, errorHandlers_1.logError)(err);
|
|
88
|
+
SpinniesManager_1.default.fail('createTestAccount', {
|
|
89
|
+
text: en_1.commands.testAccount.create.polling.createFailure,
|
|
99
90
|
});
|
|
91
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
100
92
|
}
|
|
93
|
+
SpinniesManager_1.default.succeed('createTestAccount', {
|
|
94
|
+
text: en_1.commands.testAccount.create.polling.success(testAccountConfig.accountName, testAccountId),
|
|
95
|
+
});
|
|
101
96
|
if (formatOutputAsJson) {
|
|
102
|
-
uiLogger.json(jsonOutput);
|
|
97
|
+
logger_1.uiLogger.json(jsonOutput);
|
|
103
98
|
}
|
|
104
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
99
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
105
100
|
}
|
|
106
101
|
function createTestAccountBuilder(yargs) {
|
|
107
102
|
yargs.option('config-path', {
|
|
108
103
|
type: 'string',
|
|
109
|
-
description: commands.testAccount.create.options.configPath,
|
|
104
|
+
description: en_1.commands.testAccount.create.options.configPath,
|
|
110
105
|
});
|
|
111
106
|
yargs.example([
|
|
112
107
|
[
|
|
113
108
|
'$0 create --config-path ./test-account-config.json',
|
|
114
|
-
commands.testAccount.create.example('./test-account-config.json'),
|
|
109
|
+
en_1.commands.testAccount.create.example('./test-account-config.json'),
|
|
115
110
|
],
|
|
116
111
|
]);
|
|
117
112
|
return yargs;
|
|
118
113
|
}
|
|
119
|
-
const builder = makeYargsBuilder(createTestAccountBuilder, command, describe, {
|
|
114
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(createTestAccountBuilder, command, describe, {
|
|
120
115
|
useGlobalOptions: true,
|
|
121
116
|
useEnvironmentOptions: true,
|
|
122
117
|
useAccountOptions: true,
|
|
@@ -130,4 +125,4 @@ const createTestAccountCommand = {
|
|
|
130
125
|
handler,
|
|
131
126
|
builder,
|
|
132
127
|
};
|
|
133
|
-
|
|
128
|
+
exports.default = createTestAccountCommand;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { CommonArgs, YargsCommandModule } from '../../types/Yargs
|
|
2
|
-
import { HubConfig } from '../../lib/prompts/createDeveloperTestAccountConfigPrompt.js';
|
|
1
|
+
import { CommonArgs, YargsCommandModule } from '../../types/Yargs';
|
|
3
2
|
type CreateTestAccountConfigArgs = CommonArgs & {
|
|
4
3
|
name?: string;
|
|
5
4
|
description?: string;
|
|
6
|
-
tiers?: HubConfig[];
|
|
7
5
|
path?: string;
|
|
8
6
|
};
|
|
9
7
|
declare const createTestAccountConfigCommand: YargsCommandModule<unknown, CreateTestAccountConfigArgs>;
|
|
@@ -1,37 +1,45 @@
|
|
|
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 fs_extra_1 = __importDefault(require("fs-extra"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
9
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
10
|
+
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
11
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
12
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
13
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
14
|
+
const en_1 = require("../../lang/en");
|
|
15
|
+
const createDeveloperTestAccountConfigPrompt_1 = require("../../lib/prompts/createDeveloperTestAccountConfigPrompt");
|
|
16
|
+
const validation_1 = require("../../lib/validation");
|
|
12
17
|
const command = 'create-config';
|
|
13
|
-
const describe = commands.testAccount.createConfig.describe;
|
|
18
|
+
const describe = en_1.commands.testAccount.createConfig.describe;
|
|
14
19
|
async function handler(args) {
|
|
15
|
-
const { derivedAccountId, name,
|
|
16
|
-
trackCommandUsage('test-account-create-config', {}, derivedAccountId);
|
|
20
|
+
const { derivedAccountId, name, description, path: configPath } = args;
|
|
21
|
+
(0, usageTracking_1.trackCommandUsage)('test-account-create-config', {}, derivedAccountId);
|
|
17
22
|
let accountConfigPath = configPath;
|
|
18
|
-
const testAccountConfig = await createDeveloperTestAccountConfigPrompt({
|
|
23
|
+
const testAccountConfig = await (0, createDeveloperTestAccountConfigPrompt_1.createDeveloperTestAccountConfigPrompt)({
|
|
19
24
|
name,
|
|
20
25
|
description,
|
|
21
|
-
tiers,
|
|
22
26
|
});
|
|
23
27
|
if (!accountConfigPath) {
|
|
24
|
-
const pathPromptResult = await promptUser({
|
|
28
|
+
const pathPromptResult = await (0, promptUtils_1.promptUser)({
|
|
25
29
|
name: 'path',
|
|
26
|
-
message: commands.testAccount.createConfig.pathPrompt,
|
|
30
|
+
message: en_1.commands.testAccount.createConfig.pathPrompt,
|
|
27
31
|
type: 'input',
|
|
28
|
-
default: '
|
|
29
|
-
|
|
32
|
+
default: testAccountConfig.accountName.toLowerCase().replace(/\s+/g, '-') +
|
|
33
|
+
'.json',
|
|
34
|
+
validate: path => {
|
|
30
35
|
if (!path) {
|
|
31
|
-
return commands.testAccount.createConfig.errors.pathError;
|
|
36
|
+
return en_1.commands.testAccount.createConfig.errors.pathError;
|
|
32
37
|
}
|
|
33
38
|
else if (!path.endsWith('.json')) {
|
|
34
|
-
return commands.testAccount.createConfig.errors.pathFormatError;
|
|
39
|
+
return en_1.commands.testAccount.createConfig.errors.pathFormatError;
|
|
40
|
+
}
|
|
41
|
+
else if ((0, validation_1.fileExists)(path)) {
|
|
42
|
+
return en_1.commands.testAccount.createConfig.errors.pathExistsError;
|
|
35
43
|
}
|
|
36
44
|
return true;
|
|
37
45
|
},
|
|
@@ -39,49 +47,45 @@ async function handler(args) {
|
|
|
39
47
|
accountConfigPath = pathPromptResult.path;
|
|
40
48
|
}
|
|
41
49
|
if (!accountConfigPath) {
|
|
42
|
-
uiLogger.error(commands.testAccount.createConfig.errors.pathError);
|
|
43
|
-
process.exit(EXIT_CODES.ERROR);
|
|
50
|
+
logger_1.uiLogger.error(en_1.commands.testAccount.createConfig.errors.pathError);
|
|
51
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
44
52
|
}
|
|
45
|
-
if (fileExists(accountConfigPath)) {
|
|
46
|
-
uiLogger.error(commands.testAccount.createConfig.errors.pathExistsError);
|
|
47
|
-
process.exit(EXIT_CODES.ERROR);
|
|
53
|
+
if ((0, validation_1.fileExists)(accountConfigPath)) {
|
|
54
|
+
logger_1.uiLogger.error(en_1.commands.testAccount.createConfig.errors.pathExistsError);
|
|
55
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
48
56
|
}
|
|
49
57
|
try {
|
|
50
|
-
|
|
58
|
+
fs_extra_1.default.writeFileSync(path_1.default.resolve((0, path_2.getCwd)(), accountConfigPath), JSON.stringify(testAccountConfig, null, 2), 'utf8');
|
|
51
59
|
}
|
|
52
60
|
catch (err) {
|
|
53
|
-
uiLogger.error(commands.testAccount.createConfig.errors.failedToCreate);
|
|
54
|
-
process.exit(EXIT_CODES.ERROR);
|
|
61
|
+
logger_1.uiLogger.error(en_1.commands.testAccount.createConfig.errors.failedToCreate);
|
|
62
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
55
63
|
}
|
|
56
|
-
uiLogger.success(commands.testAccount.createConfig.success.configFileCreated(accountConfigPath));
|
|
57
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
64
|
+
logger_1.uiLogger.success(en_1.commands.testAccount.createConfig.success.configFileCreated(accountConfigPath));
|
|
65
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
58
66
|
}
|
|
59
67
|
function createTestAccountConfigBuilder(yargs) {
|
|
60
68
|
yargs.option('name', {
|
|
61
69
|
type: 'string',
|
|
62
|
-
description: commands.testAccount.createConfig.options.name,
|
|
70
|
+
description: en_1.commands.testAccount.createConfig.options.name,
|
|
63
71
|
});
|
|
64
72
|
yargs.option('description', {
|
|
65
73
|
type: 'string',
|
|
66
|
-
description: commands.testAccount.createConfig.options.description,
|
|
67
|
-
});
|
|
68
|
-
yargs.option('tiers', {
|
|
69
|
-
type: 'array',
|
|
70
|
-
description: commands.testAccount.createConfig.options.tiers,
|
|
74
|
+
description: en_1.commands.testAccount.createConfig.options.description,
|
|
71
75
|
});
|
|
72
76
|
yargs.option('path', {
|
|
73
77
|
type: 'string',
|
|
74
|
-
description: commands.testAccount.createConfig.options.path,
|
|
78
|
+
description: en_1.commands.testAccount.createConfig.options.path,
|
|
75
79
|
});
|
|
76
80
|
yargs.example([
|
|
77
81
|
[
|
|
78
|
-
'$0 create-config --name my-account',
|
|
79
|
-
commands.testAccount.createConfig.example('my-account'),
|
|
82
|
+
'$0 test-account create-config --name my-account',
|
|
83
|
+
en_1.commands.testAccount.createConfig.example('my-account'),
|
|
80
84
|
],
|
|
81
85
|
]);
|
|
82
86
|
return yargs;
|
|
83
87
|
}
|
|
84
|
-
const builder = makeYargsBuilder(createTestAccountConfigBuilder, command, describe, {
|
|
88
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(createTestAccountConfigBuilder, command, describe, {
|
|
85
89
|
useGlobalOptions: true,
|
|
86
90
|
});
|
|
87
91
|
const createTestAccountConfigCommand = {
|
|
@@ -90,4 +94,4 @@ const createTestAccountConfigCommand = {
|
|
|
90
94
|
handler,
|
|
91
95
|
builder,
|
|
92
96
|
};
|
|
93
|
-
|
|
97
|
+
exports.default = createTestAccountConfigCommand;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, TestingArgs, YargsCommandModule } from '../../types/Yargs
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, TestingArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
2
|
type DeleteTestAccountArgs = CommonArgs & AccountArgs & ConfigArgs & TestingArgs & EnvironmentArgs & {
|
|
3
3
|
testAccountId: number;
|
|
4
4
|
};
|
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const developerTestAccounts_1 = require("@hubspot/local-dev-lib/api/developerTestAccounts");
|
|
4
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
5
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
6
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
7
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
8
|
+
const en_1 = require("../../lang/en");
|
|
7
9
|
const command = 'delete <test-account-id>';
|
|
8
|
-
const describe = commands.testAccount.delete.describe;
|
|
10
|
+
const describe = en_1.commands.testAccount.delete.describe;
|
|
9
11
|
async function handler(args) {
|
|
10
12
|
const { derivedAccountId, testAccountId } = args;
|
|
11
|
-
trackCommandUsage('test-account-delete', {}, derivedAccountId);
|
|
13
|
+
(0, usageTracking_1.trackCommandUsage)('test-account-delete', {}, derivedAccountId);
|
|
12
14
|
try {
|
|
13
|
-
await deleteDeveloperTestAccount(derivedAccountId, testAccountId, true);
|
|
14
|
-
uiLogger.success(commands.testAccount.delete.success.testAccountDeleted(testAccountId));
|
|
15
|
+
await (0, developerTestAccounts_1.deleteDeveloperTestAccount)(derivedAccountId, testAccountId, true);
|
|
16
|
+
logger_1.uiLogger.success(en_1.commands.testAccount.delete.success.testAccountDeleted(testAccountId));
|
|
15
17
|
}
|
|
16
18
|
catch (err) {
|
|
17
|
-
uiLogger.error(commands.testAccount.delete.errors.failedToDelete);
|
|
18
|
-
process.exit(EXIT_CODES.ERROR);
|
|
19
|
+
logger_1.uiLogger.error(en_1.commands.testAccount.delete.errors.failedToDelete);
|
|
20
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
19
21
|
}
|
|
20
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
22
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
21
23
|
}
|
|
22
24
|
function deleteTestAccountBuilder(yargs) {
|
|
23
25
|
yargs.positional('test-account-id', {
|
|
24
26
|
type: 'number',
|
|
25
|
-
description: commands.testAccount.delete.positionals.testAccountId,
|
|
27
|
+
description: en_1.commands.testAccount.delete.positionals.testAccountId,
|
|
26
28
|
required: true,
|
|
27
29
|
});
|
|
28
30
|
yargs.example([
|
|
29
|
-
['$0 delete 1234567890', commands.testAccount.delete.example(1234567890)],
|
|
31
|
+
['$0 delete 1234567890', en_1.commands.testAccount.delete.example(1234567890)],
|
|
30
32
|
]);
|
|
31
33
|
return yargs;
|
|
32
34
|
}
|
|
33
|
-
const builder = makeYargsBuilder(deleteTestAccountBuilder, command, describe, {
|
|
35
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(deleteTestAccountBuilder, command, describe, {
|
|
34
36
|
useGlobalOptions: true,
|
|
35
37
|
useEnvironmentOptions: true,
|
|
36
38
|
useAccountOptions: true,
|
|
@@ -43,4 +45,4 @@ const deleteTestAccountCommand = {
|
|
|
43
45
|
handler,
|
|
44
46
|
builder,
|
|
45
47
|
};
|
|
46
|
-
|
|
48
|
+
exports.default = deleteTestAccountCommand;
|
package/commands/testAccount.js
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const create_1 = __importDefault(require("./testAccount/create"));
|
|
7
|
+
const createConfig_1 = __importDefault(require("./testAccount/createConfig"));
|
|
8
|
+
const delete_1 = __importDefault(require("./testAccount/delete"));
|
|
9
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
10
|
+
const en_1 = require("../lang/en");
|
|
6
11
|
const command = ['test-account', 'test-accounts'];
|
|
7
12
|
const describe = undefined; //commands.testAccount.describe;
|
|
8
13
|
function testAccountBuilder(yargs) {
|
|
9
14
|
yargs
|
|
10
|
-
.command(
|
|
11
|
-
.command(
|
|
12
|
-
.command(
|
|
15
|
+
.command(create_1.default)
|
|
16
|
+
.command(createConfig_1.default)
|
|
17
|
+
.command(delete_1.default)
|
|
13
18
|
.demandCommand(1, '');
|
|
14
19
|
return yargs;
|
|
15
20
|
}
|
|
16
|
-
const builder = makeYargsBuilder(testAccountBuilder, command, commands.testAccount.describe);
|
|
21
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(testAccountBuilder, command, en_1.commands.testAccount.describe);
|
|
17
22
|
const testAccountCommand = {
|
|
18
23
|
command,
|
|
19
24
|
describe,
|
|
20
25
|
builder,
|
|
21
26
|
handler: () => { },
|
|
22
27
|
};
|
|
23
|
-
|
|
28
|
+
exports.default = testAccountCommand;
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const yargs_1 = __importDefault(require("yargs"));
|
|
7
|
+
const generate_selectors_1 = __importDefault(require("../generate-selectors"));
|
|
3
8
|
const positionalSpy = vi
|
|
4
|
-
.spyOn(
|
|
5
|
-
.mockReturnValue(
|
|
9
|
+
.spyOn(yargs_1.default, 'positional')
|
|
10
|
+
.mockReturnValue(yargs_1.default);
|
|
6
11
|
describe('commands/theme/generate-selectors', () => {
|
|
7
12
|
describe('command', () => {
|
|
8
13
|
it('should have the correct command structure', () => {
|
|
9
|
-
expect(
|
|
14
|
+
expect(generate_selectors_1.default.command).toEqual('generate-selectors <path>');
|
|
10
15
|
});
|
|
11
16
|
});
|
|
12
17
|
describe('describe', () => {
|
|
13
18
|
it('should provide a description', () => {
|
|
14
|
-
expect(
|
|
19
|
+
expect(generate_selectors_1.default.describe).toBeDefined();
|
|
15
20
|
});
|
|
16
21
|
});
|
|
17
22
|
describe('builder', () => {
|
|
18
23
|
it('should support the correct options', () => {
|
|
19
|
-
|
|
24
|
+
generate_selectors_1.default.builder(yargs_1.default);
|
|
20
25
|
expect(positionalSpy).toHaveBeenCalledTimes(1);
|
|
21
26
|
expect(positionalSpy).toHaveBeenCalledWith('path', {
|
|
22
27
|
describe: expect.any(String),
|
|
@@ -1,36 +1,41 @@
|
|
|
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 marketplace_validate_1 = __importDefault(require("../marketplace-validate"));
|
|
4
9
|
vi.mock('../../../lib/commonOpts');
|
|
5
10
|
const positionalSpy = vi
|
|
6
|
-
.spyOn(
|
|
7
|
-
.mockReturnValue(
|
|
11
|
+
.spyOn(yargs_1.default, 'positional')
|
|
12
|
+
.mockReturnValue(yargs_1.default);
|
|
8
13
|
describe('commands/theme/marketplace-validate', () => {
|
|
9
14
|
describe('command', () => {
|
|
10
15
|
it('should have the correct command structure', () => {
|
|
11
|
-
expect(
|
|
16
|
+
expect(marketplace_validate_1.default.command).toEqual('marketplace-validate <path>');
|
|
12
17
|
});
|
|
13
18
|
});
|
|
14
19
|
describe('describe', () => {
|
|
15
20
|
it('should provide a description', () => {
|
|
16
|
-
expect(
|
|
21
|
+
expect(marketplace_validate_1.default.describe).toBeDefined();
|
|
17
22
|
});
|
|
18
23
|
});
|
|
19
24
|
describe('builder', () => {
|
|
20
25
|
it('should support the correct options', () => {
|
|
21
|
-
|
|
26
|
+
marketplace_validate_1.default.builder(yargs_1.default);
|
|
22
27
|
expect(positionalSpy).toHaveBeenCalledTimes(1);
|
|
23
28
|
expect(positionalSpy).toHaveBeenCalledWith('path', {
|
|
24
29
|
describe: expect.any(String),
|
|
25
30
|
required: true,
|
|
26
31
|
type: 'string',
|
|
27
32
|
});
|
|
28
|
-
expect(addAccountOptions).toHaveBeenCalledTimes(1);
|
|
29
|
-
expect(addAccountOptions).toHaveBeenCalledWith(
|
|
30
|
-
expect(addConfigOptions).toHaveBeenCalledTimes(1);
|
|
31
|
-
expect(addConfigOptions).toHaveBeenCalledWith(
|
|
32
|
-
expect(addUseEnvironmentOptions).toHaveBeenCalledTimes(1);
|
|
33
|
-
expect(addUseEnvironmentOptions).toHaveBeenCalledWith(
|
|
33
|
+
expect(commonOpts_1.addAccountOptions).toHaveBeenCalledTimes(1);
|
|
34
|
+
expect(commonOpts_1.addAccountOptions).toHaveBeenCalledWith(yargs_1.default);
|
|
35
|
+
expect(commonOpts_1.addConfigOptions).toHaveBeenCalledTimes(1);
|
|
36
|
+
expect(commonOpts_1.addConfigOptions).toHaveBeenCalledWith(yargs_1.default);
|
|
37
|
+
expect(commonOpts_1.addUseEnvironmentOptions).toHaveBeenCalledTimes(1);
|
|
38
|
+
expect(commonOpts_1.addUseEnvironmentOptions).toHaveBeenCalledWith(yargs_1.default);
|
|
34
39
|
});
|
|
35
40
|
});
|
|
36
41
|
});
|
|
@@ -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 preview_1 = __importDefault(require("../preview"));
|
|
4
9
|
vi.mock('../../../lib/commonOpts');
|
|
5
10
|
const optionSpy = vi
|
|
6
|
-
.spyOn(
|
|
7
|
-
.mockReturnValue(
|
|
11
|
+
.spyOn(yargs_1.default, 'option')
|
|
12
|
+
.mockReturnValue(yargs_1.default);
|
|
8
13
|
describe('commands/theme/preview', () => {
|
|
9
14
|
describe('command', () => {
|
|
10
15
|
it('should have the correct command structure', () => {
|
|
11
|
-
expect(
|
|
16
|
+
expect(preview_1.default.command).toEqual('preview [--src] [--dest]');
|
|
12
17
|
});
|
|
13
18
|
});
|
|
14
19
|
describe('describe', () => {
|
|
15
20
|
it('should provide a description', () => {
|
|
16
|
-
expect(
|
|
21
|
+
expect(preview_1.default.describe).toBeDefined();
|
|
17
22
|
});
|
|
18
23
|
});
|
|
19
24
|
describe('builder', () => {
|
|
20
25
|
it('should support the correct options', () => {
|
|
21
|
-
|
|
26
|
+
preview_1.default.builder(yargs_1.default);
|
|
22
27
|
expect(optionSpy).toHaveBeenCalledWith('src', {
|
|
23
28
|
describe: expect.any(String),
|
|
24
29
|
type: 'string',
|
|
@@ -51,10 +56,10 @@ describe('commands/theme/preview', () => {
|
|
|
51
56
|
hidden: true,
|
|
52
57
|
type: 'boolean',
|
|
53
58
|
});
|
|
54
|
-
expect(addAccountOptions).toHaveBeenCalledTimes(1);
|
|
55
|
-
expect(addAccountOptions).toHaveBeenCalledWith(
|
|
56
|
-
expect(addConfigOptions).toHaveBeenCalledTimes(1);
|
|
57
|
-
expect(addConfigOptions).toHaveBeenCalledWith(
|
|
59
|
+
expect(commonOpts_1.addAccountOptions).toHaveBeenCalledTimes(1);
|
|
60
|
+
expect(commonOpts_1.addAccountOptions).toHaveBeenCalledWith(yargs_1.default);
|
|
61
|
+
expect(commonOpts_1.addConfigOptions).toHaveBeenCalledTimes(1);
|
|
62
|
+
expect(commonOpts_1.addConfigOptions).toHaveBeenCalledWith(yargs_1.default);
|
|
58
63
|
});
|
|
59
64
|
});
|
|
60
65
|
});
|