@hubspot/cli 7.11.8-experimental.0 → 8.0.0-beta.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 +19 -1
- package/api/migrate.d.ts +1 -1
- package/api/migrate.js +2 -1
- package/bin/cli.js +12 -27
- package/commands/__tests__/customObject.test.js +0 -2
- package/commands/__tests__/doctor.test.js +0 -2
- package/commands/__tests__/getStarted.test.js +0 -4
- package/commands/__tests__/project.test.js +0 -4
- package/commands/__tests__/upgrade.test.js +309 -0
- package/commands/account/__tests__/auth.test.js +180 -0
- package/commands/account/__tests__/list.test.js +128 -3
- package/commands/account/__tests__/rename.test.js +0 -2
- package/commands/account/__tests__/use.test.js +138 -0
- package/commands/account/auth.js +1 -1
- package/commands/account/clean.js +4 -3
- package/commands/account/createOverride.js +3 -2
- package/commands/account/info.js +2 -2
- package/commands/account/list.js +4 -4
- package/commands/account/remove.js +3 -2
- package/commands/account/removeOverride.js +3 -2
- package/commands/account/use.js +4 -3
- package/commands/app/__tests__/migrate.test.js +8 -25
- package/commands/app/migrate.js +10 -16
- package/commands/app/secret/__tests__/add.test.js +112 -0
- package/commands/app/secret/add.js +13 -13
- package/commands/auth.js +8 -2
- package/commands/cms/__tests__/fetch.test.js +114 -15
- package/commands/cms/__tests__/upload.test.js +308 -0
- package/commands/cms/__tests__/watch.test.js +212 -0
- package/commands/cms/app/create.js +2 -3
- package/commands/cms/convertFields.js +1 -1
- package/commands/cms/fetch.js +3 -2
- package/commands/cms/function/deploy.js +2 -2
- package/commands/cms/function/list.js +2 -3
- package/commands/cms/lighthouseScore.js +19 -27
- package/commands/cms/module/marketplace-validate.js +0 -1
- package/commands/cms/theme/__tests__/preview.test.js +2 -8
- package/commands/cms/theme/create.js +1 -1
- package/commands/cms/theme/marketplace-validate.js +0 -1
- package/commands/cms/theme/preview.d.ts +0 -1
- package/commands/cms/theme/preview.js +12 -52
- package/commands/cms/upload.js +3 -3
- package/commands/cms/watch.js +3 -3
- package/commands/customObject.js +0 -2
- package/commands/doctor.js +10 -2
- package/commands/filemanager/__tests__/upload.test.js +161 -0
- package/commands/getStarted.js +13 -3
- package/commands/hubdb/__tests__/list.test.js +0 -9
- package/commands/hubdb/list.js +6 -8
- package/commands/init.js +8 -2
- package/commands/mcp/__tests__/start.test.js +113 -3
- package/commands/mcp/setup.js +0 -7
- package/commands/mcp/start.d.ts +1 -1
- package/commands/mcp/start.js +0 -7
- package/commands/project/__tests__/add.test.js +0 -2
- package/commands/project/__tests__/create.test.js +2 -2
- package/commands/project/__tests__/deploy.test.js +0 -4
- package/commands/project/__tests__/dev.test.js +273 -0
- package/commands/project/__tests__/devUnifiedFlow.test.js +2 -5
- package/commands/project/__tests__/installDeps.test.js +0 -2
- package/commands/project/__tests__/lint.test.js +0 -5
- package/commands/project/__tests__/logs.test.js +24 -31
- package/commands/project/__tests__/migrate.test.js +7 -12
- package/commands/project/__tests__/updateDeps.test.js +0 -2
- package/commands/project/__tests__/upload.test.js +191 -0
- package/commands/project/__tests__/validate.test.js +314 -31
- package/commands/project/cloneApp.d.ts +1 -7
- package/commands/project/cloneApp.js +1 -149
- package/commands/project/create.js +3 -4
- package/commands/project/deploy.js +18 -7
- package/commands/project/dev/deprecatedFlow.js +0 -2
- package/commands/project/dev/index.js +23 -11
- package/commands/project/dev/unifiedFlow.d.ts +1 -1
- package/commands/project/dev/unifiedFlow.js +1 -4
- package/commands/project/list.js +4 -4
- package/commands/project/listBuilds.js +2 -7
- package/commands/project/logs.js +19 -12
- package/commands/project/migrate.js +3 -3
- package/commands/project/profile/add.js +1 -1
- package/commands/project/profile/delete.js +1 -1
- package/commands/project/upload.d.ts +1 -1
- package/commands/project/upload.js +13 -4
- package/commands/project/validate.js +85 -13
- package/commands/project/watch.js +7 -7
- package/commands/project.js +0 -4
- package/commands/sandbox/__tests__/create.test.js +0 -2
- package/commands/secret/__tests__/addSecret.test.js +140 -7
- package/commands/secret/addSecret.js +3 -1
- package/commands/testAccount/__tests__/create.test.js +6 -1
- package/commands/testAccount/__tests__/importData.test.js +0 -1
- package/commands/testAccount/create.d.ts +1 -0
- package/commands/testAccount/create.js +13 -5
- package/commands/upgrade.d.ts +8 -0
- package/commands/upgrade.js +119 -0
- package/lang/en.d.ts +88 -10
- package/lang/en.js +105 -26
- package/lib/__tests__/buildAccount.test.js +0 -13
- package/lib/__tests__/cliUpgradeUtils.test.js +131 -0
- package/lib/__tests__/commonOpts.test.js +0 -1
- package/lib/__tests__/dependencyManagement.test.js +633 -13
- package/lib/__tests__/developerTestAccounts.test.js +0 -1
- package/lib/__tests__/hasFeature.test.js +0 -6
- package/lib/__tests__/importData.test.js +0 -1
- package/lib/__tests__/npmCli.test.js +84 -0
- package/lib/__tests__/oauth.test.js +1 -11
- package/lib/__tests__/process.test.js +0 -1
- package/lib/__tests__/sandboxSync.test.js +0 -1
- package/lib/__tests__/sandboxes.test.js +0 -1
- package/lib/__tests__/serverlessLogs.test.js +0 -1
- package/lib/__tests__/usageTracking.test.js +39 -6
- package/lib/__tests__/validation.test.js +0 -1
- package/lib/app/__tests__/migrate.test.js +137 -12
- package/lib/app/migrate.d.ts +5 -2
- package/lib/app/migrate.js +30 -11
- package/lib/app/urls.d.ts +1 -1
- package/lib/buildAccount.d.ts +1 -1
- package/lib/cliUpgradeUtils.d.ts +22 -0
- package/lib/cliUpgradeUtils.js +62 -0
- package/lib/cmsAssets/api-sample.js +2 -5
- package/lib/cmsAssets/function.js +1 -9
- package/lib/cmsAssets/module.js +1 -9
- package/lib/cmsAssets/template.js +1 -9
- package/lib/configOptions.d.ts +0 -1
- package/lib/configOptions.js +1 -5
- package/lib/constants.d.ts +6 -0
- package/lib/constants.js +10 -4
- package/lib/dependencyManagement.d.ts +9 -0
- package/lib/dependencyManagement.js +127 -26
- package/lib/developerTestAccounts.d.ts +1 -1
- package/lib/doctor/Diagnosis.d.ts +1 -0
- package/lib/doctor/Diagnosis.js +7 -0
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +2 -1
- package/lib/doctor/DiagnosticInfoBuilder.js +8 -4
- package/lib/doctor/Doctor.d.ts +12 -0
- package/lib/doctor/Doctor.js +283 -33
- package/lib/doctor/__tests__/Diagnosis.test.js +1 -0
- package/lib/doctor/__tests__/Doctor.test.js +201 -51
- package/lib/errorHandlers/__tests__/index.test.d.ts +1 -0
- package/lib/errorHandlers/__tests__/index.test.js +278 -0
- package/lib/errorHandlers/index.d.ts +1 -0
- package/lib/errorHandlers/index.js +14 -2
- package/lib/http.js +3 -1
- package/lib/links.js +2 -3
- package/lib/mcp/__tests__/setup.test.js +69 -2
- package/lib/mcp/setup.d.ts +1 -0
- package/lib/mcp/setup.js +37 -4
- package/lib/middleware/__tests__/configMiddleware.test.js +1 -43
- package/lib/middleware/__tests__/usageTrackingMiddleware.test.d.ts +1 -0
- package/lib/middleware/__tests__/usageTrackingMiddleware.test.js +44 -0
- package/lib/middleware/__tests__/yargsChecksMiddleware.test.js +0 -5
- package/lib/middleware/autoUpdateMiddleware.js +58 -57
- package/lib/middleware/configMiddleware.d.ts +0 -3
- package/lib/middleware/configMiddleware.js +0 -11
- package/lib/middleware/fireAlarmMiddleware.js +1 -1
- package/lib/middleware/spinniesMiddleware.d.ts +1 -0
- package/lib/middleware/spinniesMiddleware.js +4 -0
- package/lib/middleware/usageTrackingMiddleware.d.ts +13 -0
- package/lib/middleware/usageTrackingMiddleware.js +16 -0
- package/lib/{npm.d.ts → npm/npmCli.d.ts} +8 -3
- package/lib/npm/npmCli.js +59 -0
- package/lib/npm/packageJson.d.ts +24 -0
- package/lib/npm/packageJson.js +102 -0
- package/lib/npm/workspaces.d.ts +12 -0
- package/lib/npm/workspaces.js +48 -0
- package/lib/oauth.js +1 -3
- package/lib/projects/__tests__/AppDevModeInterface.test.js +40 -18
- package/lib/projects/__tests__/DevServerManager.test.js +1 -0
- package/lib/projects/__tests__/DevSessionManager.test.d.ts +1 -0
- package/lib/projects/__tests__/DevSessionManager.test.js +250 -0
- package/lib/projects/__tests__/LocalDevProcess.test.js +19 -6
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +0 -2
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.js +0 -1
- package/lib/projects/__tests__/components.test.js +6 -22
- package/lib/projects/__tests__/deploy.test.js +0 -1
- package/lib/projects/__tests__/localDevProjectHelpers.test.js +3 -5
- package/lib/projects/__tests__/pollProjectBuildAndDeploy.test.d.ts +1 -0
- package/lib/projects/__tests__/pollProjectBuildAndDeploy.test.js +328 -0
- package/lib/projects/__tests__/projectProfiles.test.d.ts +1 -0
- package/lib/projects/__tests__/projectProfiles.test.js +441 -0
- package/lib/projects/__tests__/projects.test.js +0 -1
- package/lib/projects/__tests__/structure.test.js +0 -1
- package/lib/projects/__tests__/uieLinting.test.js +2 -11
- package/lib/projects/__tests__/upload.test.js +104 -3
- package/lib/projects/add/__tests__/legacyAddComponent.test.js +0 -2
- package/lib/projects/add/__tests__/v2AddComponent.test.js +2 -4
- package/lib/projects/add/v2AddComponent.js +2 -3
- package/lib/projects/components.d.ts +1 -1
- package/lib/projects/components.js +4 -4
- package/lib/projects/create/__tests__/legacy.test.js +0 -1
- package/lib/projects/create/__tests__/v2.test.js +0 -1
- package/lib/projects/create/v2.d.ts +1 -1
- package/lib/projects/create/v2.js +1 -1
- package/lib/projects/ensureProjectExists.js +0 -1
- package/lib/projects/localDev/AppDevModeInterface.js +9 -2
- package/lib/projects/localDev/DevSessionManager.d.ts +18 -0
- package/lib/projects/localDev/DevSessionManager.js +95 -0
- package/lib/projects/localDev/LocalDevLogger.d.ts +4 -0
- package/lib/projects/localDev/LocalDevLogger.js +18 -7
- package/lib/projects/localDev/LocalDevManager_DEPRECATED.d.ts +4 -3
- package/lib/projects/localDev/LocalDevManager_DEPRECATED.js +23 -12
- package/lib/projects/localDev/LocalDevProcess.d.ts +2 -1
- package/lib/projects/localDev/LocalDevProcess.js +18 -7
- package/lib/projects/localDev/LocalDevState.d.ts +3 -2
- package/lib/projects/localDev/helpers/account.d.ts +1 -1
- package/lib/projects/localDev/helpers/devSessionsApi.d.ts +9 -0
- package/lib/projects/localDev/helpers/devSessionsApi.js +19 -0
- package/lib/projects/localDev/helpers/project.d.ts +1 -1
- package/lib/projects/localDev/helpers/project.js +1 -2
- package/lib/projects/pollProjectBuildAndDeploy.js +4 -5
- package/lib/projects/projectProfiles.d.ts +17 -0
- package/lib/projects/projectProfiles.js +140 -0
- package/lib/projects/structure.d.ts +1 -1
- package/lib/projects/uieLinting.js +6 -8
- package/lib/projects/upload.d.ts +9 -1
- package/lib/projects/upload.js +11 -5
- package/lib/projects/urls.d.ts +1 -0
- package/lib/projects/urls.js +3 -3
- package/lib/prompts/__tests__/createDeveloperTestAccountConfigPrompt.test.js +8 -4
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +2 -0
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +19 -13
- package/lib/sandboxSync.d.ts +1 -1
- package/lib/sandboxes.d.ts +1 -1
- package/lib/serverlessLogs.js +0 -1
- package/lib/theme/__tests__/migrate.test.js +12 -4
- package/lib/theme/migrate.js +2 -3
- package/lib/ui/__tests__/SpinniesManager.test.js +0 -1
- package/lib/usageTracking.js +18 -0
- package/mcp-server/tools/cms/HsCreateFunctionTool.d.ts +2 -2
- package/mcp-server/tools/cms/HsCreateFunctionTool.js +2 -1
- package/mcp-server/tools/cms/HsCreateModuleTool.js +2 -1
- package/mcp-server/tools/cms/HsCreateTemplateTool.js +2 -1
- package/mcp-server/tools/cms/HsFunctionLogsTool.js +2 -2
- package/mcp-server/tools/cms/HsListFunctionsTool.js +2 -2
- package/mcp-server/tools/cms/HsListTool.js +2 -2
- package/mcp-server/tools/cms/__tests__/HsCreateFunctionTool.test.js +4 -4
- package/mcp-server/tools/cms/__tests__/HsCreateModuleTool.test.js +4 -4
- package/mcp-server/tools/cms/__tests__/HsCreateTemplateTool.test.js +4 -4
- package/mcp-server/tools/cms/__tests__/HsFunctionLogsTool.test.js +4 -4
- package/mcp-server/tools/cms/__tests__/HsListFunctionsTool.test.js +4 -4
- package/mcp-server/tools/cms/__tests__/HsListTool.test.js +4 -4
- package/mcp-server/tools/project/AddFeatureToProjectTool.js +4 -3
- package/mcp-server/tools/project/CreateProjectTool.js +4 -3
- package/mcp-server/tools/project/CreateTestAccountTool.d.ts +7 -2
- package/mcp-server/tools/project/CreateTestAccountTool.js +19 -9
- package/mcp-server/tools/project/DocFetchTool.js +2 -1
- package/mcp-server/tools/project/DocsSearchTool.js +2 -1
- package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.js +4 -4
- package/mcp-server/tools/project/GetApplicationInfoTool.js +5 -5
- package/mcp-server/tools/project/GetConfigValuesTool.js +2 -1
- package/mcp-server/tools/project/UploadProjectTools.js +6 -3
- package/mcp-server/tools/project/ValidateProjectTool.js +2 -1
- package/mcp-server/tools/project/__tests__/AddFeatureToProjectTool.test.js +4 -2
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +4 -2
- package/mcp-server/tools/project/__tests__/CreateTestAccountTool.test.js +23 -4
- package/mcp-server/tools/project/__tests__/DeployProjectTool.test.js +3 -1
- package/mcp-server/tools/project/__tests__/DocFetchTool.test.js +0 -1
- package/mcp-server/tools/project/__tests__/DocsSearchTool.test.js +3 -1
- package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.js +4 -2
- package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.js +8 -5
- package/mcp-server/tools/project/__tests__/GetBuildLogsTool.test.js +3 -1
- package/mcp-server/tools/project/__tests__/GetBuildStatusTool.test.js +3 -1
- package/mcp-server/tools/project/__tests__/GetConfigValuesTool.test.js +7 -3
- package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.js +3 -1
- package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +17 -3
- package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.js +3 -1
- package/mcp-server/utils/__tests__/content.test.js +0 -3
- package/mcp-server/utils/__tests__/feedbackTracking.test.js +0 -3
- package/mcp-server/utils/__tests__/project.test.js +65 -4
- package/mcp-server/utils/project.js +6 -2
- package/package.json +15 -17
- package/types/Cms.d.ts +1 -1
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +3 -2
- package/types/PackageJson.d.ts +10 -0
- package/types/PackageJson.js +1 -0
- package/types/ProjectComponents.d.ts +1 -1
- package/ui/components/BoxWithTitle.js +1 -1
- package/ui/components/Table.d.ts +89 -0
- package/ui/components/Table.js +246 -0
- package/ui/lib/table.d.ts +2 -0
- package/ui/lib/table.js +11 -0
- package/ui/playground/Playground.d.ts +5 -0
- package/ui/{views/UiSandbox.js → playground/Playground.js} +4 -4
- package/ui/{lib/ui-testing-utils.d.ts → playground/fixtures.d.ts} +1 -1
- package/ui/{lib/ui-testing-utils.js → playground/fixtures.js} +33 -1
- package/ui/render.d.ts +19 -0
- package/ui/render.js +44 -0
- package/commands/__tests__/create.test.js +0 -53
- package/commands/create.d.ts +0 -4
- package/commands/create.js +0 -137
- package/commands/customObject/__tests__/schema.test.js +0 -53
- package/commands/customObject/schema/create.d.ts +0 -4
- package/commands/customObject/schema/create.js +0 -34
- package/commands/customObject/schema/delete.d.ts +0 -4
- package/commands/customObject/schema/delete.js +0 -37
- package/commands/customObject/schema/fetch-all.d.ts +0 -4
- package/commands/customObject/schema/fetch-all.js +0 -32
- package/commands/customObject/schema/fetch.d.ts +0 -4
- package/commands/customObject/schema/fetch.js +0 -36
- package/commands/customObject/schema/list.d.ts +0 -4
- package/commands/customObject/schema/list.js +0 -26
- package/commands/customObject/schema/update.d.ts +0 -4
- package/commands/customObject/schema/update.js +0 -39
- package/commands/customObject/schema.d.ts +0 -3
- package/commands/customObject/schema.js +0 -31
- package/commands/fetch.d.ts +0 -4
- package/commands/fetch.js +0 -52
- package/commands/function/deploy.d.ts +0 -4
- package/commands/function/deploy.js +0 -31
- package/commands/function/list.d.ts +0 -4
- package/commands/function/list.js +0 -33
- package/commands/function/server.d.ts +0 -4
- package/commands/function/server.js +0 -57
- package/commands/function.d.ts +0 -3
- package/commands/function.js +0 -32
- package/commands/lint.d.ts +0 -4
- package/commands/lint.js +0 -31
- package/commands/list.d.ts +0 -4
- package/commands/list.js +0 -31
- package/commands/logs.d.ts +0 -4
- package/commands/logs.js +0 -58
- package/commands/module/marketplace-validate.d.ts +0 -4
- package/commands/module/marketplace-validate.js +0 -31
- package/commands/module.d.ts +0 -3
- package/commands/module.js +0 -23
- package/commands/mv.d.ts +0 -4
- package/commands/mv.js +0 -35
- package/commands/project/__tests__/migrateApp.test.js +0 -78
- package/commands/project/migrateApp.d.ts +0 -4
- package/commands/project/migrateApp.js +0 -55
- package/commands/remove.d.ts +0 -4
- package/commands/remove.js +0 -31
- package/commands/theme/generate-selectors.d.ts +0 -4
- package/commands/theme/generate-selectors.js +0 -30
- package/commands/theme/marketplace-validate.d.ts +0 -4
- package/commands/theme/marketplace-validate.js +0 -33
- package/commands/theme/preview.d.ts +0 -4
- package/commands/theme/preview.js +0 -59
- package/commands/theme.d.ts +0 -3
- package/commands/theme.js +0 -29
- package/commands/upload.d.ts +0 -4
- package/commands/upload.js +0 -62
- package/commands/watch.d.ts +0 -4
- package/commands/watch.js +0 -73
- package/lib/__tests__/npm.test.js +0 -57
- package/lib/__tests__/projectProfiles.test.js +0 -129
- package/lib/app/__tests__/migrate_legacy.test.js +0 -143
- package/lib/app/migrate_legacy.d.ts +0 -4
- package/lib/app/migrate_legacy.js +0 -121
- package/lib/npm.js +0 -33
- package/lib/projectProfiles.d.ts +0 -7
- package/lib/projectProfiles.js +0 -73
- package/lib/ui/table.d.ts +0 -3
- package/lib/ui/table.js +0 -63
- package/ui/index.d.ts +0 -1
- package/ui/index.js +0 -6
- package/ui/views/UiSandbox.d.ts +0 -5
- /package/commands/__tests__/{create.test.d.ts → upgrade.test.d.ts} +0 -0
- /package/commands/{customObject/__tests__/schema.test.d.ts → cms/__tests__/upload.test.d.ts} +0 -0
- /package/commands/{project/__tests__/migrateApp.test.d.ts → cms/__tests__/watch.test.d.ts} +0 -0
- /package/{lib/__tests__/npm.test.d.ts → commands/project/__tests__/dev.test.d.ts} +0 -0
- /package/lib/__tests__/{projectProfiles.test.d.ts → cliUpgradeUtils.test.d.ts} +0 -0
- /package/lib/{app/__tests__/migrate_legacy.test.d.ts → __tests__/npmCli.test.d.ts} +0 -0
|
@@ -1,9 +1,41 @@
|
|
|
1
1
|
import yargs from 'yargs';
|
|
2
|
-
import {
|
|
2
|
+
import { addSecret, fetchSecrets } from '@hubspot/local-dev-lib/api/secrets';
|
|
3
|
+
import { secretNamePrompt, secretValuePrompt, } from '../../../lib/prompts/secretPrompt.js';
|
|
4
|
+
import { trackCommandUsage } from '../../../lib/usageTracking.js';
|
|
5
|
+
import { logError, ApiErrorContext } from '../../../lib/errorHandlers/index.js';
|
|
6
|
+
import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
|
|
3
7
|
import addSecretCommand from '../addSecret.js';
|
|
4
8
|
vi.mock('../../../lib/commonOpts');
|
|
9
|
+
vi.mock('@hubspot/local-dev-lib/api/secrets');
|
|
10
|
+
vi.mock('../../../lib/prompts/secretPrompt.js');
|
|
11
|
+
vi.mock('../../../lib/errorHandlers/index.js');
|
|
12
|
+
vi.mock('@hubspot/local-dev-lib/config');
|
|
13
|
+
const addSecretMock = vi.mocked(addSecret);
|
|
14
|
+
const fetchSecretsMock = vi.mocked(fetchSecrets);
|
|
15
|
+
const secretNamePromptMock = vi.mocked(secretNamePrompt);
|
|
16
|
+
const secretValuePromptMock = vi.mocked(secretValuePrompt);
|
|
17
|
+
const trackCommandUsageMock = vi.mocked(trackCommandUsage);
|
|
18
|
+
const logErrorMock = vi.mocked(logError);
|
|
19
|
+
const processExitSpy = vi.spyOn(process, 'exit');
|
|
5
20
|
describe('commands/secret/addSecret', () => {
|
|
6
21
|
const yargsMock = yargs;
|
|
22
|
+
const uiLogger = global.mockUiLogger;
|
|
23
|
+
beforeEach(() => {
|
|
24
|
+
vi.clearAllMocks();
|
|
25
|
+
// @ts-expect-error Mock implementation
|
|
26
|
+
processExitSpy.mockImplementation(() => { });
|
|
27
|
+
fetchSecretsMock.mockResolvedValue({
|
|
28
|
+
data: { results: [] },
|
|
29
|
+
status: 200,
|
|
30
|
+
statusText: 'OK',
|
|
31
|
+
headers: {},
|
|
32
|
+
// @ts-expect-error
|
|
33
|
+
config: {},
|
|
34
|
+
});
|
|
35
|
+
secretValuePromptMock.mockResolvedValue({ secretValue: 'test-value' });
|
|
36
|
+
// @ts-expect-error
|
|
37
|
+
addSecretMock.mockResolvedValue(undefined);
|
|
38
|
+
});
|
|
7
39
|
describe('command', () => {
|
|
8
40
|
it('should have the correct command structure', () => {
|
|
9
41
|
expect(addSecretCommand.command).toEqual('add [name]');
|
|
@@ -18,12 +50,113 @@ describe('commands/secret/addSecret', () => {
|
|
|
18
50
|
it('should support the correct options', () => {
|
|
19
51
|
addSecretCommand.builder(yargsMock);
|
|
20
52
|
expect(yargsMock.positional).toHaveBeenCalledTimes(1);
|
|
21
|
-
expect(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
53
|
+
expect(yargsMock.positional).toHaveBeenCalledWith('name', expect.objectContaining({ type: 'string' }));
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
describe('handler', () => {
|
|
57
|
+
let args;
|
|
58
|
+
beforeEach(() => {
|
|
59
|
+
args = {
|
|
60
|
+
name: 'test-secret',
|
|
61
|
+
derivedAccountId: 123456,
|
|
62
|
+
d: false,
|
|
63
|
+
debug: false,
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
it('should track command usage', async () => {
|
|
67
|
+
await addSecretCommand.handler(args);
|
|
68
|
+
expect(trackCommandUsageMock).toHaveBeenCalledWith('secrets-add', {}, 123456);
|
|
69
|
+
});
|
|
70
|
+
it('should prompt for secret name when not provided', async () => {
|
|
71
|
+
delete args.name;
|
|
72
|
+
secretNamePromptMock.mockResolvedValue({ secretName: 'prompted-name' });
|
|
73
|
+
await addSecretCommand.handler(args);
|
|
74
|
+
expect(secretNamePromptMock).toHaveBeenCalledTimes(1);
|
|
75
|
+
expect(addSecretMock).toHaveBeenCalledWith(123456, 'prompted-name', 'test-value');
|
|
76
|
+
});
|
|
77
|
+
it('should use provided secret name', async () => {
|
|
78
|
+
await addSecretCommand.handler(args);
|
|
79
|
+
expect(secretNamePromptMock).not.toHaveBeenCalled();
|
|
80
|
+
expect(addSecretMock).toHaveBeenCalledWith(123456, 'test-secret', 'test-value');
|
|
81
|
+
});
|
|
82
|
+
it('should fetch existing secrets to check for duplicates', async () => {
|
|
83
|
+
await addSecretCommand.handler(args);
|
|
84
|
+
expect(fetchSecretsMock).toHaveBeenCalledWith(123456);
|
|
85
|
+
});
|
|
86
|
+
it('should error and exit if secret already exists', async () => {
|
|
87
|
+
fetchSecretsMock.mockResolvedValue({
|
|
88
|
+
data: { results: ['test-secret', 'other-secret'] },
|
|
89
|
+
status: 200,
|
|
90
|
+
statusText: 'OK',
|
|
91
|
+
headers: {},
|
|
92
|
+
// @ts-expect-error
|
|
93
|
+
config: {},
|
|
94
|
+
});
|
|
95
|
+
await addSecretCommand.handler(args);
|
|
96
|
+
expect(uiLogger.error).toHaveBeenCalledWith(expect.stringContaining('test-secret'));
|
|
97
|
+
expect(processExitSpy).toHaveBeenCalledWith(EXIT_CODES.ERROR);
|
|
98
|
+
expect(addSecretMock).not.toHaveBeenCalled();
|
|
99
|
+
});
|
|
100
|
+
it('should allow adding secret if name does not exist', async () => {
|
|
101
|
+
fetchSecretsMock.mockResolvedValue({
|
|
102
|
+
data: { results: ['other-secret', 'another-secret'] },
|
|
103
|
+
status: 200,
|
|
104
|
+
statusText: 'OK',
|
|
105
|
+
headers: {},
|
|
106
|
+
// @ts-expect-error
|
|
107
|
+
config: {},
|
|
108
|
+
});
|
|
109
|
+
// @ts-expect-error doesn't matter
|
|
110
|
+
addSecretMock.mockResolvedValue(undefined);
|
|
111
|
+
await addSecretCommand.handler(args);
|
|
112
|
+
expect(addSecretMock).toHaveBeenCalledWith(123456, 'test-secret', 'test-value');
|
|
113
|
+
expect(uiLogger.success).toHaveBeenCalledWith(expect.stringContaining('test-secret'));
|
|
114
|
+
});
|
|
115
|
+
it('should prompt for secret value', async () => {
|
|
116
|
+
await addSecretCommand.handler(args);
|
|
117
|
+
expect(secretValuePromptMock).toHaveBeenCalledTimes(1);
|
|
118
|
+
});
|
|
119
|
+
it('should add secret successfully', async () => {
|
|
120
|
+
// @ts-expect-error doesn't matter
|
|
121
|
+
addSecretMock.mockResolvedValue(undefined);
|
|
122
|
+
await addSecretCommand.handler(args);
|
|
123
|
+
expect(addSecretMock).toHaveBeenCalledWith(123456, 'test-secret', 'test-value');
|
|
124
|
+
expect(uiLogger.success).toHaveBeenCalledWith(expect.stringContaining('test-secret'));
|
|
125
|
+
expect(uiLogger.success).toHaveBeenCalledWith(expect.stringContaining('123456'));
|
|
126
|
+
expect(processExitSpy).toHaveBeenCalledWith(EXIT_CODES.SUCCESS);
|
|
127
|
+
});
|
|
128
|
+
it('should handle errors when adding secret', async () => {
|
|
129
|
+
const error = new Error('API error');
|
|
130
|
+
addSecretMock.mockRejectedValueOnce(error);
|
|
131
|
+
await addSecretCommand.handler(args);
|
|
132
|
+
expect(uiLogger.error).toHaveBeenCalledWith(expect.stringContaining('test-secret'));
|
|
133
|
+
expect(logErrorMock).toHaveBeenCalledWith(error, expect.any(ApiErrorContext));
|
|
134
|
+
expect(processExitSpy).toHaveBeenCalledWith(EXIT_CODES.ERROR);
|
|
135
|
+
});
|
|
136
|
+
it('should handle errors when fetching existing secrets', async () => {
|
|
137
|
+
const error = new Error('Fetch error');
|
|
138
|
+
fetchSecretsMock.mockRejectedValueOnce(error);
|
|
139
|
+
await addSecretCommand.handler(args);
|
|
140
|
+
expect(uiLogger.error).toHaveBeenCalled();
|
|
141
|
+
expect(logErrorMock).toHaveBeenCalledWith(error, expect.any(ApiErrorContext));
|
|
142
|
+
expect(processExitSpy).toHaveBeenCalledWith(EXIT_CODES.ERROR);
|
|
143
|
+
});
|
|
144
|
+
it('should handle errors when prompting for name', async () => {
|
|
145
|
+
delete args.name;
|
|
146
|
+
const error = new Error('Prompt error');
|
|
147
|
+
secretNamePromptMock.mockRejectedValueOnce(error);
|
|
148
|
+
await addSecretCommand.handler(args);
|
|
149
|
+
expect(uiLogger.error).toHaveBeenCalled();
|
|
150
|
+
expect(logErrorMock).toHaveBeenCalledWith(error, expect.any(ApiErrorContext));
|
|
151
|
+
expect(processExitSpy).toHaveBeenCalledWith(EXIT_CODES.ERROR);
|
|
152
|
+
});
|
|
153
|
+
it('should handle errors when prompting for value', async () => {
|
|
154
|
+
const error = new Error('Value prompt error');
|
|
155
|
+
secretValuePromptMock.mockRejectedValueOnce(error);
|
|
156
|
+
await addSecretCommand.handler(args);
|
|
157
|
+
expect(uiLogger.error).toHaveBeenCalled();
|
|
158
|
+
expect(logErrorMock).toHaveBeenCalledWith(error, expect.any(ApiErrorContext));
|
|
159
|
+
expect(processExitSpy).toHaveBeenCalledWith(EXIT_CODES.ERROR);
|
|
27
160
|
});
|
|
28
161
|
});
|
|
29
162
|
});
|
|
@@ -20,7 +20,7 @@ async function handler(args) {
|
|
|
20
20
|
const { data: { results: secrets }, } = await fetchSecrets(derivedAccountId);
|
|
21
21
|
if (secrets.includes(secretName)) {
|
|
22
22
|
uiLogger.error(commands.secret.subcommands.add.errors.alreadyExists(secretName));
|
|
23
|
-
process.exit(EXIT_CODES.ERROR);
|
|
23
|
+
return process.exit(EXIT_CODES.ERROR);
|
|
24
24
|
}
|
|
25
25
|
const { secretValue } = await secretValuePrompt();
|
|
26
26
|
await addSecret(derivedAccountId, secretName, secretValue);
|
|
@@ -32,7 +32,9 @@ async function handler(args) {
|
|
|
32
32
|
request: 'add secret',
|
|
33
33
|
accountId: derivedAccountId,
|
|
34
34
|
}));
|
|
35
|
+
return process.exit(EXIT_CODES.ERROR);
|
|
35
36
|
}
|
|
37
|
+
process.exit(EXIT_CODES.SUCCESS);
|
|
36
38
|
}
|
|
37
39
|
function addSecretBuilder(yargs) {
|
|
38
40
|
yargs.positional('name', {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import yargs from 'yargs';
|
|
2
2
|
import { addAccountOptions, addConfigOptions, addUseEnvironmentOptions, addTestingOptions, addJSONOutputOptions, } from '../../../lib/commonOpts.js';
|
|
3
3
|
import testAccountCreateCommand from '../create.js';
|
|
4
|
-
import { ACCOUNT_LEVEL_CHOICES } from '../../../lib/constants.js';
|
|
4
|
+
import { ACCOUNT_LEVEL_CHOICES, ACCOUNT_LEVELS, } from '../../../lib/constants.js';
|
|
5
5
|
vi.mock('../../../lib/commonOpts');
|
|
6
6
|
describe('commands/testAccount/create', () => {
|
|
7
7
|
const yargsMock = yargs;
|
|
@@ -71,6 +71,11 @@ describe('commands/testAccount/create', () => {
|
|
|
71
71
|
description: 'CMS Hub tier. Options: FREE, STARTER, PROFESSIONAL, ENTERPRISE',
|
|
72
72
|
choices: ACCOUNT_LEVEL_CHOICES,
|
|
73
73
|
});
|
|
74
|
+
expect(yargsMock.option).toHaveBeenCalledWith('commerce-level', {
|
|
75
|
+
type: 'string',
|
|
76
|
+
description: 'Commerce Hub tier. Options: FREE, PROFESSIONAL, ENTERPRISE',
|
|
77
|
+
choices: ACCOUNT_LEVEL_CHOICES.filter(level => level !== ACCOUNT_LEVELS.STARTER),
|
|
78
|
+
});
|
|
74
79
|
});
|
|
75
80
|
it('should add examples for all usage scenarios', () => {
|
|
76
81
|
testAccountCreateCommand.builder(yargsMock);
|
|
@@ -10,7 +10,6 @@ import { importDataFilePathPrompt } from '../../../lib/prompts/importDataFilePat
|
|
|
10
10
|
import { confirmImportDataPrompt } from '../../../lib/prompts/confirmImportDataPrompt.js';
|
|
11
11
|
vi.mock('../../../lib/commonOpts');
|
|
12
12
|
vi.mock('../../../lib/importData');
|
|
13
|
-
vi.mock('../../../lib/usageTracking');
|
|
14
13
|
vi.mock('@hubspot/local-dev-lib/crm');
|
|
15
14
|
vi.mock('../../../lib/errorHandlers/index');
|
|
16
15
|
vi.mock('../../../lib/prompts/importDataFilePathPrompt');
|
|
@@ -9,6 +9,7 @@ type CreateTestAccountArgs = CommonArgs & AccountArgs & ConfigArgs & TestingArgs
|
|
|
9
9
|
serviceLevel?: AccountLevel;
|
|
10
10
|
salesLevel?: AccountLevel;
|
|
11
11
|
contentLevel?: AccountLevel;
|
|
12
|
+
commerceLevel?: AccountLevel;
|
|
12
13
|
};
|
|
13
14
|
declare const createTestAccountCommand: YargsCommandModule<unknown, CreateTestAccountArgs>;
|
|
14
15
|
export default createTestAccountCommand;
|
|
@@ -14,18 +14,19 @@ import { createDeveloperTestAccountConfigPrompt } from '../../lib/prompts/create
|
|
|
14
14
|
import { debugError, logError } from '../../lib/errorHandlers/index.js';
|
|
15
15
|
import SpinniesManager from '../../lib/ui/SpinniesManager.js';
|
|
16
16
|
import { createDeveloperTestAccountV2, saveAccountToConfig, } from '../../lib/buildAccount.js';
|
|
17
|
-
import { ACCOUNT_LEVEL_CHOICES } from '../../lib/constants.js';
|
|
17
|
+
import { ACCOUNT_LEVEL_CHOICES, ACCOUNT_LEVELS } from '../../lib/constants.js';
|
|
18
18
|
const command = 'create';
|
|
19
19
|
const describe = commands.testAccount.create.describe;
|
|
20
20
|
function hasAnyFlags(args) {
|
|
21
|
-
const { name, description, marketingLevel, opsLevel, serviceLevel, salesLevel, contentLevel, } = args;
|
|
21
|
+
const { name, description, marketingLevel, opsLevel, serviceLevel, salesLevel, contentLevel, commerceLevel, } = args;
|
|
22
22
|
return !!(name ||
|
|
23
23
|
description ||
|
|
24
24
|
marketingLevel ||
|
|
25
25
|
opsLevel ||
|
|
26
26
|
serviceLevel ||
|
|
27
27
|
salesLevel ||
|
|
28
|
-
contentLevel
|
|
28
|
+
contentLevel ||
|
|
29
|
+
commerceLevel);
|
|
29
30
|
}
|
|
30
31
|
async function readConfigFile(configPath) {
|
|
31
32
|
const absoluteConfigPath = path.resolve(getCwd(), configPath);
|
|
@@ -65,7 +66,7 @@ async function promptForConfigPath() {
|
|
|
65
66
|
return undefined;
|
|
66
67
|
}
|
|
67
68
|
async function buildTestAccountConfig(args) {
|
|
68
|
-
const { configPath, name, description, marketingLevel, opsLevel, serviceLevel, salesLevel, contentLevel, } = args;
|
|
69
|
+
const { configPath, name, description, marketingLevel, opsLevel, serviceLevel, salesLevel, contentLevel, commerceLevel, } = args;
|
|
69
70
|
if (configPath) {
|
|
70
71
|
return readConfigFile(configPath);
|
|
71
72
|
}
|
|
@@ -84,6 +85,7 @@ async function buildTestAccountConfig(args) {
|
|
|
84
85
|
serviceLevel,
|
|
85
86
|
salesLevel,
|
|
86
87
|
contentLevel,
|
|
88
|
+
commerceLevel,
|
|
87
89
|
});
|
|
88
90
|
}
|
|
89
91
|
async function handler(args) {
|
|
@@ -112,7 +114,7 @@ async function handler(args) {
|
|
|
112
114
|
process.exit(EXIT_CODES.ERROR);
|
|
113
115
|
}
|
|
114
116
|
SpinniesManager.succeed('createTestAccount', {
|
|
115
|
-
text: commands.testAccount.create.polling.success(testAccountConfig.accountName, resultJson.accountId),
|
|
117
|
+
text: commands.testAccount.create.polling.success(testAccountConfig.accountName, resultJson.accountId, derivedAccountId),
|
|
116
118
|
});
|
|
117
119
|
if (formatOutputAsJson) {
|
|
118
120
|
uiLogger.json(resultJson);
|
|
@@ -173,6 +175,11 @@ function createTestAccountBuilder(yargs) {
|
|
|
173
175
|
description: commands.testAccount.create.options.contentLevel,
|
|
174
176
|
choices: ACCOUNT_LEVEL_CHOICES,
|
|
175
177
|
});
|
|
178
|
+
yargs.option('commerce-level', {
|
|
179
|
+
type: 'string',
|
|
180
|
+
description: commands.testAccount.create.options.commerceLevel,
|
|
181
|
+
choices: ACCOUNT_LEVEL_CHOICES.filter(level => level !== ACCOUNT_LEVELS.STARTER),
|
|
182
|
+
});
|
|
176
183
|
yargs.conflicts('config-path', [
|
|
177
184
|
'name',
|
|
178
185
|
'description',
|
|
@@ -181,6 +188,7 @@ function createTestAccountBuilder(yargs) {
|
|
|
181
188
|
'service-level',
|
|
182
189
|
'sales-level',
|
|
183
190
|
'content-level',
|
|
191
|
+
'commerce-level',
|
|
184
192
|
]);
|
|
185
193
|
yargs.example([
|
|
186
194
|
['$0 test-account create', 'Interactive mode - prompts for all options'],
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CommonArgs, YargsCommandModule } from '../types/Yargs.js';
|
|
2
|
+
export type UpgradeArgs = CommonArgs & {
|
|
3
|
+
version?: string;
|
|
4
|
+
force?: boolean;
|
|
5
|
+
beta?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const upgradeCommand: YargsCommandModule<unknown, UpgradeArgs>;
|
|
8
|
+
export default upgradeCommand;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { isConfigFlagEnabled } from '@hubspot/local-dev-lib/config';
|
|
2
|
+
import { CONFIG_FLAGS } from '@hubspot/local-dev-lib/constants/config';
|
|
3
|
+
import { trackCommandUsage } from '../lib/usageTracking.js';
|
|
4
|
+
import { EXIT_CODES } from '../lib/enums/exitCodes.js';
|
|
5
|
+
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
6
|
+
import { uiLogger } from '../lib/ui/logger.js';
|
|
7
|
+
import { commands } from '../lang/en.js';
|
|
8
|
+
import { confirmPrompt } from '../lib/prompts/promptUtils.js';
|
|
9
|
+
import { canCliBeAutoUpgraded, installCliVersion, } from '../lib/cliUpgradeUtils.js';
|
|
10
|
+
import { getLatestCliVersion } from '../lib/cliUpgradeUtils.js';
|
|
11
|
+
import { pkg } from '../lib/jsonLoader.js';
|
|
12
|
+
import SpinniesManager from '../lib/ui/SpinniesManager.js';
|
|
13
|
+
import { debugError } from '../lib/errorHandlers/index.js';
|
|
14
|
+
const command = ['upgrade [version]', 'update [version]'];
|
|
15
|
+
const describe = commands.upgrade.describe;
|
|
16
|
+
const handler = async (args) => {
|
|
17
|
+
const { version, force, beta, derivedAccountId } = args;
|
|
18
|
+
trackCommandUsage('upgrade', {}, derivedAccountId);
|
|
19
|
+
SpinniesManager.init({
|
|
20
|
+
succeedColor: 'white',
|
|
21
|
+
});
|
|
22
|
+
let targetVersion = version;
|
|
23
|
+
try {
|
|
24
|
+
if (!targetVersion) {
|
|
25
|
+
// Get the latest versions
|
|
26
|
+
const { latest: latestCliVersion, next: nextCliVersion } = await getLatestCliVersion();
|
|
27
|
+
const latestVersion = beta ? nextCliVersion : latestCliVersion;
|
|
28
|
+
if (!latestVersion) {
|
|
29
|
+
uiLogger.error(commands.upgrade.errors.unableToDetermineLatestVersion);
|
|
30
|
+
return process.exit(EXIT_CODES.ERROR);
|
|
31
|
+
}
|
|
32
|
+
targetVersion = latestVersion;
|
|
33
|
+
}
|
|
34
|
+
const currentVersion = pkg.version;
|
|
35
|
+
// Show what version is available
|
|
36
|
+
if (targetVersion === currentVersion) {
|
|
37
|
+
if (version) {
|
|
38
|
+
uiLogger.log(commands.upgrade.alreadyOnVersion(currentVersion));
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
uiLogger.log(commands.upgrade.alreadyLatest(currentVersion, beta));
|
|
42
|
+
}
|
|
43
|
+
return process.exit(EXIT_CODES.SUCCESS);
|
|
44
|
+
}
|
|
45
|
+
// Check if globally installed
|
|
46
|
+
const isGlobal = await canCliBeAutoUpgraded();
|
|
47
|
+
if (!isGlobal) {
|
|
48
|
+
uiLogger.log(commands.upgrade.autoUpgradeNotAvailable(targetVersion));
|
|
49
|
+
return process.exit(EXIT_CODES.SUCCESS);
|
|
50
|
+
}
|
|
51
|
+
// Prompt for confirmation unless --force is used
|
|
52
|
+
if (!force) {
|
|
53
|
+
const shouldUpgrade = await confirmPrompt(commands.upgrade.confirmPrompt(currentVersion, targetVersion), { defaultAnswer: true });
|
|
54
|
+
if (!shouldUpgrade) {
|
|
55
|
+
uiLogger.log(commands.upgrade.cancelled);
|
|
56
|
+
return process.exit(EXIT_CODES.SUCCESS);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
SpinniesManager.add('upgrade', {
|
|
60
|
+
text: commands.upgrade.installing(targetVersion),
|
|
61
|
+
});
|
|
62
|
+
await installCliVersion(targetVersion);
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
debugError(e);
|
|
66
|
+
SpinniesManager.fail('upgrade', {
|
|
67
|
+
text: commands.upgrade.errors.installFailed,
|
|
68
|
+
});
|
|
69
|
+
uiLogger.log('');
|
|
70
|
+
uiLogger.error(commands.upgrade.errors.generic);
|
|
71
|
+
return process.exit(EXIT_CODES.ERROR);
|
|
72
|
+
}
|
|
73
|
+
SpinniesManager.succeed('upgrade', {
|
|
74
|
+
text: commands.upgrade.success(targetVersion),
|
|
75
|
+
});
|
|
76
|
+
let isAllowAutoUpdatesEnabled = false;
|
|
77
|
+
try {
|
|
78
|
+
// Default to false if the flag is not set. Users must explicitly enable auto-updates.
|
|
79
|
+
isAllowAutoUpdatesEnabled = isConfigFlagEnabled(CONFIG_FLAGS.ALLOW_AUTO_UPDATES, false);
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
debugError(e);
|
|
83
|
+
}
|
|
84
|
+
if (!isAllowAutoUpdatesEnabled && !beta) {
|
|
85
|
+
uiLogger.log('');
|
|
86
|
+
uiLogger.log(commands.upgrade.autoUpgradeMessage);
|
|
87
|
+
}
|
|
88
|
+
return process.exit(EXIT_CODES.SUCCESS);
|
|
89
|
+
};
|
|
90
|
+
function upgradeBuilder(yargs) {
|
|
91
|
+
yargs
|
|
92
|
+
.positional('[version]', {
|
|
93
|
+
describe: commands.upgrade.options.version,
|
|
94
|
+
type: 'string',
|
|
95
|
+
})
|
|
96
|
+
.option('force', {
|
|
97
|
+
alias: 'f',
|
|
98
|
+
describe: commands.upgrade.options.force,
|
|
99
|
+
type: 'boolean',
|
|
100
|
+
default: false,
|
|
101
|
+
})
|
|
102
|
+
.option('beta', {
|
|
103
|
+
alias: 'next',
|
|
104
|
+
describe: commands.upgrade.options.beta,
|
|
105
|
+
type: 'boolean',
|
|
106
|
+
default: false,
|
|
107
|
+
});
|
|
108
|
+
return yargs;
|
|
109
|
+
}
|
|
110
|
+
const builder = makeYargsBuilder(upgradeBuilder, command, describe, {
|
|
111
|
+
useGlobalOptions: true,
|
|
112
|
+
});
|
|
113
|
+
const upgradeCommand = {
|
|
114
|
+
command,
|
|
115
|
+
describe,
|
|
116
|
+
handler,
|
|
117
|
+
builder,
|
|
118
|
+
};
|
|
119
|
+
export default upgradeCommand;
|
package/lang/en.d.ts
CHANGED
|
@@ -2,9 +2,6 @@ import { HubSpotConfigAccount } from '@hubspot/local-dev-lib/types/Accounts';
|
|
|
2
2
|
export declare const commands: {
|
|
3
3
|
generalErrors: {
|
|
4
4
|
srcIsProject: (src: string, command: string) => string;
|
|
5
|
-
handleDeprecatedEnvVariables: {
|
|
6
|
-
portalEnvVarDeprecated: string;
|
|
7
|
-
};
|
|
8
5
|
validateConfigMiddleware: {
|
|
9
6
|
missingConfigFile: string;
|
|
10
7
|
configValidationFailed: (errors: string[]) => string;
|
|
@@ -411,7 +408,6 @@ export declare const commands: {
|
|
|
411
408
|
dest: string;
|
|
412
409
|
};
|
|
413
410
|
options: {
|
|
414
|
-
notify: string;
|
|
415
411
|
noSsl: string;
|
|
416
412
|
port: string;
|
|
417
413
|
};
|
|
@@ -1018,6 +1014,27 @@ export declare const commands: {
|
|
|
1018
1014
|
};
|
|
1019
1015
|
outputWritten: (filename: string) => string;
|
|
1020
1016
|
};
|
|
1017
|
+
upgrade: {
|
|
1018
|
+
describe: string;
|
|
1019
|
+
options: {
|
|
1020
|
+
version: string;
|
|
1021
|
+
force: string;
|
|
1022
|
+
beta: string;
|
|
1023
|
+
};
|
|
1024
|
+
alreadyLatest: (version: string, beta?: boolean) => string;
|
|
1025
|
+
alreadyOnVersion: (current: string) => string;
|
|
1026
|
+
autoUpgradeNotAvailable: (version: string) => string;
|
|
1027
|
+
confirmPrompt: (current: string, version: string) => string;
|
|
1028
|
+
cancelled: string;
|
|
1029
|
+
installing: (version: string) => string;
|
|
1030
|
+
success: (version: string) => string;
|
|
1031
|
+
autoUpgradeMessage: string;
|
|
1032
|
+
errors: {
|
|
1033
|
+
unableToDetermineLatestVersion: string;
|
|
1034
|
+
installFailed: string;
|
|
1035
|
+
generic: string;
|
|
1036
|
+
};
|
|
1037
|
+
};
|
|
1021
1038
|
filemanager: {
|
|
1022
1039
|
describe: string;
|
|
1023
1040
|
subcommands: {
|
|
@@ -1188,6 +1205,7 @@ export declare const commands: {
|
|
|
1188
1205
|
codex: string;
|
|
1189
1206
|
claudeCode: string;
|
|
1190
1207
|
cursor: string;
|
|
1208
|
+
gemini: string;
|
|
1191
1209
|
windsurf: string;
|
|
1192
1210
|
vsCode: string;
|
|
1193
1211
|
args: {
|
|
@@ -1197,7 +1215,6 @@ export declare const commands: {
|
|
|
1197
1215
|
success: (derivedTargets: string[]) => string;
|
|
1198
1216
|
errors: {
|
|
1199
1217
|
needsMcpAccess: (accountId?: number) => string;
|
|
1200
|
-
needsNode20: string;
|
|
1201
1218
|
errorParsingJsonFIle: (filename: string, errorMessage: string) => string;
|
|
1202
1219
|
};
|
|
1203
1220
|
spinners: {
|
|
@@ -1213,6 +1230,10 @@ export declare const commands: {
|
|
|
1213
1230
|
configuringCursor: string;
|
|
1214
1231
|
failedToConfigureCursor: string;
|
|
1215
1232
|
configuredCursor: string;
|
|
1233
|
+
configuringGemini: string;
|
|
1234
|
+
configuredGemini: string;
|
|
1235
|
+
geminiNotFound: string;
|
|
1236
|
+
geminiInstallFailed: string;
|
|
1216
1237
|
alreadyInstalled: string;
|
|
1217
1238
|
configuringWindsurf: string;
|
|
1218
1239
|
failedToConfigureWindsurf: string;
|
|
@@ -1229,7 +1250,6 @@ export declare const commands: {
|
|
|
1229
1250
|
};
|
|
1230
1251
|
start: {
|
|
1231
1252
|
errors: {
|
|
1232
|
-
needsNode20: string;
|
|
1233
1253
|
serverFileNotFound: (serverPath: string) => string;
|
|
1234
1254
|
failedToStart: string;
|
|
1235
1255
|
};
|
|
@@ -1349,6 +1369,9 @@ export declare const commands: {
|
|
|
1349
1369
|
examples: {
|
|
1350
1370
|
default: string;
|
|
1351
1371
|
};
|
|
1372
|
+
prompts: {
|
|
1373
|
+
selectProfile: string;
|
|
1374
|
+
};
|
|
1352
1375
|
options: {
|
|
1353
1376
|
profile: string;
|
|
1354
1377
|
projectAccount: string;
|
|
@@ -1550,6 +1573,7 @@ export declare const commands: {
|
|
|
1550
1573
|
examples: {
|
|
1551
1574
|
default: string;
|
|
1552
1575
|
withOptions: string;
|
|
1576
|
+
withProfile: string;
|
|
1553
1577
|
};
|
|
1554
1578
|
options: {
|
|
1555
1579
|
build: string;
|
|
@@ -1632,6 +1656,7 @@ export declare const commands: {
|
|
|
1632
1656
|
describe: string;
|
|
1633
1657
|
examples: {
|
|
1634
1658
|
default: string;
|
|
1659
|
+
withProfile: string;
|
|
1635
1660
|
};
|
|
1636
1661
|
logs: {
|
|
1637
1662
|
buildSucceeded: (buildId: number) => string;
|
|
@@ -1803,9 +1828,20 @@ export declare const commands: {
|
|
|
1803
1828
|
badVersion: string;
|
|
1804
1829
|
examples: {
|
|
1805
1830
|
default: string;
|
|
1831
|
+
withProfile: string;
|
|
1806
1832
|
};
|
|
1807
1833
|
success: (projectName: string) => string;
|
|
1808
|
-
failure: (projectName: string) => string;
|
|
1834
|
+
failure: (projectName: string, profileName?: string) => string;
|
|
1835
|
+
failureWithProfile: (profileName: string) => string;
|
|
1836
|
+
spinners: {
|
|
1837
|
+
validatingProfile: (profileName: string) => string;
|
|
1838
|
+
profileValidationFailed: (profileName: string) => string;
|
|
1839
|
+
profileValidationSucceeded: (profileName: string) => string;
|
|
1840
|
+
invalidWithProfile: (profileName: string) => string;
|
|
1841
|
+
validatingAllProfiles: string;
|
|
1842
|
+
allProfilesValidationSucceeded: string;
|
|
1843
|
+
allProfilesValidationFailed: string;
|
|
1844
|
+
};
|
|
1809
1845
|
options: {
|
|
1810
1846
|
profile: {
|
|
1811
1847
|
describe: string;
|
|
@@ -2127,7 +2163,7 @@ export declare const commands: {
|
|
|
2127
2163
|
polling: {
|
|
2128
2164
|
start: (testAccountName: string) => string;
|
|
2129
2165
|
syncing: string;
|
|
2130
|
-
success: (testAccountName: string, testAccountId: number) => string;
|
|
2166
|
+
success: (testAccountName: string, testAccountId: number, parentAccountId: number) => string;
|
|
2131
2167
|
createFailure: string;
|
|
2132
2168
|
};
|
|
2133
2169
|
options: {
|
|
@@ -2139,6 +2175,7 @@ export declare const commands: {
|
|
|
2139
2175
|
serviceLevel: string;
|
|
2140
2176
|
salesLevel: string;
|
|
2141
2177
|
contentLevel: string;
|
|
2178
|
+
commerceLevel: string;
|
|
2142
2179
|
};
|
|
2143
2180
|
example: (configPath: string) => string;
|
|
2144
2181
|
examples: {
|
|
@@ -2847,6 +2884,12 @@ export declare const lib: {
|
|
|
2847
2884
|
startError: (message: string) => string;
|
|
2848
2885
|
fileChangeError: (message: string) => string;
|
|
2849
2886
|
};
|
|
2887
|
+
devSession: {
|
|
2888
|
+
registrationError: (message: string) => string;
|
|
2889
|
+
missingSessionIdError: string;
|
|
2890
|
+
heartbeatError: (message: string) => string;
|
|
2891
|
+
deletionError: (message: string) => string;
|
|
2892
|
+
};
|
|
2850
2893
|
};
|
|
2851
2894
|
AppDevModeInterface: {
|
|
2852
2895
|
autoInstallStaticAuthApp: {
|
|
@@ -2966,6 +3009,7 @@ export declare const lib: {
|
|
|
2966
3009
|
updateSucceeded: (latestVersion: string) => string;
|
|
2967
3010
|
notInstalledGlobally: string;
|
|
2968
3011
|
updateFailed: (latestVersion: string) => string;
|
|
3012
|
+
enableAutoUpdatesMessage: string;
|
|
2969
3013
|
};
|
|
2970
3014
|
};
|
|
2971
3015
|
projectProfiles: {
|
|
@@ -2984,7 +3028,9 @@ export declare const lib: {
|
|
|
2984
3028
|
noProjectConfig: string;
|
|
2985
3029
|
profileNotFound: (profileName: string) => string;
|
|
2986
3030
|
missingAccountId: (profileName: string) => string;
|
|
3031
|
+
listedAccountNotFound: (accountId: number, profileName: string) => string;
|
|
2987
3032
|
failedToLoadProfile: (profileName: string) => string;
|
|
3033
|
+
profileNotValid: (profileName: string, errors: string[]) => string;
|
|
2988
3034
|
};
|
|
2989
3035
|
};
|
|
2990
3036
|
};
|
|
@@ -3334,6 +3380,7 @@ export declare const lib: {
|
|
|
3334
3380
|
service: string;
|
|
3335
3381
|
sales: string;
|
|
3336
3382
|
content: string;
|
|
3383
|
+
commerce: string;
|
|
3337
3384
|
};
|
|
3338
3385
|
errors: {
|
|
3339
3386
|
allHubsRequired: string;
|
|
@@ -3717,7 +3764,7 @@ export declare const lib: {
|
|
|
3717
3764
|
notLatestSecondary: (command: string, hsVersion: string) => string;
|
|
3718
3765
|
latest: (hsVersion: string) => string;
|
|
3719
3766
|
unableToDetermine: string;
|
|
3720
|
-
unableToDetermineSecondary: (
|
|
3767
|
+
unableToDetermineSecondary: (link: string) => string;
|
|
3721
3768
|
};
|
|
3722
3769
|
projectDependenciesChecks: {
|
|
3723
3770
|
missingDependencies: (dir: string) => string;
|
|
@@ -3731,9 +3778,18 @@ export declare const lib: {
|
|
|
3731
3778
|
};
|
|
3732
3779
|
port: {
|
|
3733
3780
|
inUse: (port: number) => string;
|
|
3734
|
-
inUseSecondary:
|
|
3781
|
+
inUseSecondary: string;
|
|
3735
3782
|
available: (port: number) => string;
|
|
3736
3783
|
};
|
|
3784
|
+
projectValidation: {
|
|
3785
|
+
valid: string;
|
|
3786
|
+
configInvalid: string;
|
|
3787
|
+
configMissing: string;
|
|
3788
|
+
sourceDirectoryInvalid: string;
|
|
3789
|
+
translationFailed: string;
|
|
3790
|
+
profileValidationFailed: (profileName: string) => string;
|
|
3791
|
+
validationDetails: string;
|
|
3792
|
+
};
|
|
3737
3793
|
diagnosis: {
|
|
3738
3794
|
cli: {
|
|
3739
3795
|
header: string;
|
|
@@ -3762,6 +3818,28 @@ export declare const lib: {
|
|
|
3762
3818
|
warnings: (count: number) => string;
|
|
3763
3819
|
};
|
|
3764
3820
|
};
|
|
3821
|
+
networkChecks: {
|
|
3822
|
+
header: string;
|
|
3823
|
+
hubspotApiReachable: string;
|
|
3824
|
+
hubspotApiUnreachable: string;
|
|
3825
|
+
hubspotApiUnreachableSecondary: string;
|
|
3826
|
+
npmRegistryReachable: string;
|
|
3827
|
+
npmRegistryUnreachable: string;
|
|
3828
|
+
npmRegistryUnreachableSecondary: string;
|
|
3829
|
+
};
|
|
3830
|
+
webhookChecks: {
|
|
3831
|
+
header: string;
|
|
3832
|
+
endpointReachable: (url: string) => string;
|
|
3833
|
+
endpointUnreachable: (url: string) => string;
|
|
3834
|
+
endpointUnreachableSecondary: string;
|
|
3835
|
+
checkType: string;
|
|
3836
|
+
};
|
|
3837
|
+
appRedirectChecks: {
|
|
3838
|
+
redirectUrlReachable: (url: string) => string;
|
|
3839
|
+
redirectUrlUnreachable: (url: string) => string;
|
|
3840
|
+
redirectUrlUnreachableSecondary: string;
|
|
3841
|
+
checkType: string;
|
|
3842
|
+
};
|
|
3765
3843
|
defaultAccountOverrideFileChecks: {
|
|
3766
3844
|
overrideActive: (defaultAccountOverrideFile: string) => string;
|
|
3767
3845
|
overrideAccountId: (overrideAccountId: number | string) => string;
|