@hubspot/cli 7.5.3-experimental.0 → 7.5.3
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/migrate.d.ts +12 -3
- package/api/migrate.js +9 -2
- package/bin/cli.js +100 -93
- package/commands/account/auth.d.ts +8 -0
- package/commands/account/auth.js +175 -0
- package/commands/account/clean.d.ts +3 -7
- package/commands/account/clean.js +54 -14
- package/commands/account/createOverride.d.ts +6 -0
- package/commands/account/createOverride.js +121 -0
- package/commands/account/info.d.ts +3 -7
- package/commands/account/info.js +36 -5
- package/commands/account/list.d.ts +3 -7
- package/commands/account/list.js +38 -15
- package/commands/account/remove.d.ts +3 -7
- package/commands/account/remove.js +49 -9
- package/commands/account/removeOverride.d.ts +6 -0
- package/commands/account/removeOverride.js +93 -0
- package/commands/account/rename.d.ts +3 -7
- package/commands/account/rename.js +16 -9
- package/commands/account/use.d.ts +5 -9
- package/commands/account/use.js +27 -6
- package/commands/account.d.ts +3 -4
- package/commands/account.js +33 -53
- package/commands/app/migrate.d.ts +5 -6
- package/commands/app/migrate.js +60 -44
- package/commands/app/secret/add.d.ts +7 -0
- package/commands/app/secret/add.js +64 -0
- package/commands/app/secret/delete.d.ts +8 -0
- package/commands/app/secret/delete.js +87 -0
- package/commands/app/secret/list.d.ts +6 -0
- package/commands/app/secret/list.js +64 -0
- package/commands/app/secret/update.d.ts +7 -0
- package/commands/app/secret/update.js +77 -0
- package/commands/app/secret.d.ts +3 -0
- package/commands/app/secret.js +30 -0
- package/commands/app.d.ts +2 -5
- package/commands/app.js +10 -10
- package/commands/auth.d.ts +5 -7
- package/commands/auth.js +37 -33
- package/commands/cms/convertFields.d.ts +7 -1
- package/commands/cms/convertFields.js +57 -41
- package/commands/cms/getReactModule.d.ts +7 -1
- package/commands/cms/getReactModule.js +52 -34
- package/commands/cms/lighthouseScore.d.ts +8 -1
- package/commands/cms/lighthouseScore.js +129 -100
- package/commands/cms.d.ts +3 -1
- package/commands/cms.js +22 -16
- package/commands/completion.d.ts +3 -1
- package/commands/completion.js +23 -13
- package/commands/config/migrate.d.ts +6 -0
- package/commands/config/migrate.js +75 -0
- package/commands/config/set.d.ts +10 -1
- package/commands/config/set.js +56 -32
- package/commands/config.d.ts +3 -1
- package/commands/config.js +19 -11
- package/commands/create/api-sample.d.ts +3 -1
- package/commands/create/api-sample.js +34 -38
- package/commands/create/app.d.ts +3 -1
- package/commands/create/app.js +9 -7
- package/commands/create/function.d.ts +3 -1
- package/commands/create/function.js +11 -10
- package/commands/create/index.d.ts +5 -1
- package/commands/create/index.js +23 -11
- package/commands/create/module.d.ts +3 -1
- package/commands/create/module.js +14 -13
- package/commands/create/react-app.d.ts +3 -1
- package/commands/create/react-app.js +10 -7
- package/commands/create/template.d.ts +3 -1
- package/commands/create/template.js +14 -14
- package/commands/create/vue-app.d.ts +3 -1
- package/commands/create/vue-app.js +10 -7
- package/commands/create/webpack-serverless.d.ts +3 -1
- package/commands/create/webpack-serverless.js +10 -7
- package/commands/create/website-theme.d.ts +3 -1
- package/commands/create/website-theme.js +10 -9
- package/commands/create.d.ts +4 -24
- package/commands/create.js +62 -75
- package/commands/customObject/create.d.ts +4 -9
- package/commands/customObject/create.js +17 -10
- package/commands/customObject/schema/create.d.ts +4 -9
- package/commands/customObject/schema/create.js +18 -11
- package/commands/customObject/schema/delete.d.ts +4 -9
- package/commands/customObject/schema/delete.js +17 -10
- package/commands/customObject/schema/fetch-all.d.ts +4 -9
- package/commands/customObject/schema/fetch-all.js +17 -10
- package/commands/customObject/schema/fetch.d.ts +4 -9
- package/commands/customObject/schema/fetch.js +17 -10
- package/commands/customObject/schema/list.d.ts +4 -8
- package/commands/customObject/schema/list.js +17 -10
- package/commands/customObject/schema/update.d.ts +4 -9
- package/commands/customObject/schema/update.js +18 -11
- package/commands/customObject/schema.d.ts +3 -5
- package/commands/customObject/schema.js +27 -54
- package/commands/customObject.d.ts +3 -4
- package/commands/customObject.js +20 -48
- package/commands/doctor.d.ts +6 -8
- package/commands/doctor.js +30 -22
- package/commands/feedback.d.ts +4 -1
- package/commands/feedback.js +38 -48
- package/commands/fetch.d.ts +12 -1
- package/commands/fetch.js +49 -34
- package/commands/filemanager/fetch.d.ts +4 -9
- package/commands/filemanager/fetch.js +18 -11
- package/commands/filemanager/upload.d.ts +4 -9
- package/commands/filemanager/upload.js +17 -11
- package/commands/filemanager.d.ts +3 -4
- package/commands/filemanager.js +18 -42
- package/commands/function/deploy.d.ts +6 -1
- package/commands/function/deploy.js +70 -50
- package/commands/function/list.d.ts +6 -1
- package/commands/function/list.js +44 -32
- package/commands/function/server.d.ts +10 -1
- package/commands/function/server.js +49 -38
- package/commands/function.d.ts +5 -1
- package/commands/function.js +22 -11
- package/commands/getStarted.d.ts +9 -0
- package/commands/getStarted.js +227 -0
- package/commands/hubdb/clear.d.ts +4 -9
- package/commands/hubdb/clear.js +21 -15
- package/commands/hubdb/create.d.ts +4 -9
- package/commands/hubdb/create.js +23 -17
- package/commands/hubdb/delete.d.ts +4 -9
- package/commands/hubdb/delete.js +24 -16
- package/commands/hubdb/fetch.d.ts +4 -9
- package/commands/hubdb/fetch.js +20 -14
- package/commands/hubdb/list.d.ts +4 -0
- package/commands/hubdb/list.js +83 -0
- package/commands/hubdb.d.ts +3 -2
- package/commands/hubdb.js +24 -47
- package/commands/init.d.ts +3 -7
- package/commands/init.js +31 -24
- package/commands/lint.d.ts +6 -4
- package/commands/lint.js +42 -44
- package/commands/list.d.ts +3 -7
- package/commands/list.js +21 -16
- package/commands/logs.d.ts +10 -1
- package/commands/logs.js +53 -45
- package/commands/mcp/setup.d.ts +7 -0
- package/commands/mcp/setup.js +50 -0
- package/commands/mcp/start.d.ts +3 -0
- package/commands/mcp/start.js +75 -0
- package/commands/mcp.d.ts +3 -0
- package/commands/mcp.js +26 -0
- package/commands/module/marketplace-validate.d.ts +6 -1
- package/commands/module/marketplace-validate.js +39 -30
- package/commands/module.d.ts +3 -1
- package/commands/module.js +23 -12
- package/commands/mv.d.ts +3 -7
- package/commands/mv.js +20 -15
- package/commands/open.d.ts +3 -7
- package/commands/open.js +20 -15
- package/commands/project/add.d.ts +8 -9
- package/commands/project/add.js +53 -85
- package/commands/project/cloneApp.d.ts +6 -8
- package/commands/project/cloneApp.js +51 -47
- package/commands/project/create.d.ts +4 -1
- package/commands/project/create.js +132 -81
- package/commands/project/deploy.d.ts +5 -6
- package/commands/project/deploy.js +93 -37
- package/commands/project/dev/deprecatedFlow.d.ts +8 -2
- package/commands/project/dev/deprecatedFlow.js +41 -26
- package/commands/project/dev/index.d.ts +4 -5
- package/commands/project/dev/index.js +103 -33
- package/commands/project/dev/unifiedFlow.d.ts +11 -2
- package/commands/project/dev/unifiedFlow.js +85 -46
- package/commands/project/download.d.ts +3 -7
- package/commands/project/download.js +18 -19
- package/commands/project/installDeps.d.ts +6 -1
- package/commands/project/installDeps.js +48 -32
- package/commands/project/listBuilds.d.ts +3 -7
- package/commands/project/listBuilds.js +32 -30
- package/commands/project/logs.d.ts +10 -1
- package/commands/project/logs.js +73 -65
- package/commands/project/migrate.d.ts +7 -8
- package/commands/project/migrate.js +49 -26
- package/commands/project/migrateApp.d.ts +3 -8
- package/commands/project/migrateApp.js +23 -20
- package/commands/project/open.d.ts +3 -7
- package/commands/project/open.js +29 -21
- package/commands/project/profile/add.d.ts +7 -0
- package/commands/project/profile/add.js +209 -0
- package/commands/project/profile/delete.d.ts +6 -0
- package/commands/project/profile/delete.js +123 -0
- package/commands/project/profile.d.ts +3 -0
- package/commands/project/profile.js +25 -0
- package/commands/project/upload.d.ts +10 -1
- package/commands/project/upload.js +94 -56
- package/commands/project/validate.d.ts +6 -0
- package/commands/project/validate.js +81 -0
- package/commands/project/watch.d.ts +6 -1
- package/commands/project/watch.js +95 -61
- package/commands/project.d.ts +3 -1
- package/commands/project.js +49 -37
- package/commands/remove.d.ts +3 -7
- package/commands/remove.js +22 -20
- package/commands/sandbox/create.d.ts +4 -9
- package/commands/sandbox/create.js +27 -21
- package/commands/sandbox/delete.d.ts +4 -9
- package/commands/sandbox/delete.js +35 -29
- package/commands/sandbox.d.ts +3 -4
- package/commands/sandbox.js +18 -44
- package/commands/secret/addSecret.d.ts +4 -9
- package/commands/secret/addSecret.js +21 -15
- package/commands/secret/deleteSecret.d.ts +4 -9
- package/commands/secret/deleteSecret.js +28 -18
- package/commands/secret/listSecret.d.ts +4 -9
- package/commands/secret/listSecret.js +19 -13
- package/commands/secret/updateSecret.d.ts +4 -9
- package/commands/secret/updateSecret.js +25 -17
- package/commands/secret.d.ts +3 -4
- package/commands/secret.js +23 -49
- package/commands/theme/generate-selectors.d.ts +3 -7
- package/commands/theme/generate-selectors.js +20 -16
- package/commands/theme/marketplace-validate.d.ts +4 -9
- package/commands/theme/marketplace-validate.js +22 -18
- package/commands/theme/preview.d.ts +4 -9
- package/commands/theme/preview.js +36 -30
- package/commands/theme.d.ts +3 -4
- package/commands/theme.js +22 -48
- package/commands/upload.d.ts +12 -1
- package/commands/upload.js +116 -135
- package/commands/watch.d.ts +14 -1
- package/commands/watch.js +74 -76
- package/lang/en.d.ts +3218 -0
- package/lang/en.js +3075 -3313
- package/lang/en.lyaml +96 -228
- package/lib/accountTypes.d.ts +1 -0
- package/lib/accountTypes.js +11 -0
- package/lib/app/migrate.d.ts +33 -4
- package/lib/app/migrate.js +179 -88
- package/lib/app/migrate_legacy.d.ts +2 -2
- package/lib/app/migrate_legacy.js +12 -11
- package/lib/app/urls.d.ts +16 -0
- package/lib/app/urls.js +16 -0
- package/lib/buildAccount.d.ts +1 -2
- package/lib/buildAccount.js +11 -10
- package/lib/commonOpts.d.ts +4 -7
- package/lib/commonOpts.js +47 -19
- package/lib/configMigrate.d.ts +2 -0
- package/lib/configMigrate.js +83 -0
- package/lib/configOptions.d.ts +4 -0
- package/lib/configOptions.js +41 -45
- package/lib/constants.d.ts +33 -0
- package/lib/constants.js +34 -1
- package/lib/dependencyManagement.d.ts +0 -5
- package/lib/dependencyManagement.js +14 -40
- package/lib/doctor/Diagnosis.d.ts +1 -2
- package/lib/doctor/Diagnosis.js +19 -16
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +2 -1
- package/lib/doctor/DiagnosticInfoBuilder.js +10 -9
- package/lib/doctor/Doctor.d.ts +1 -0
- package/lib/doctor/Doctor.js +60 -46
- package/lib/errorHandlers/index.js +13 -7
- package/lib/errorHandlers/suppressError.js +18 -26
- package/lib/filesystem.d.ts +1 -1
- package/lib/generateSelectors.js +3 -6
- package/lib/hasFeature.d.ts +3 -1
- package/lib/interpolation.d.ts +2 -3
- package/lib/lang.d.ts +2 -3
- package/lib/marketplaceValidate.d.ts +12 -2
- package/lib/marketplaceValidate.js +22 -29
- package/lib/mcp/setup.d.ts +12 -0
- package/lib/mcp/setup.js +216 -0
- package/lib/middleware/__test__/yargsChecksMiddleware.test.js +3 -3
- package/lib/middleware/autoUpdateMiddleware.d.ts +1 -0
- package/lib/middleware/autoUpdateMiddleware.js +89 -0
- package/lib/middleware/configMiddleware.js +37 -3
- package/lib/middleware/fireAlarmMiddleware.d.ts +4 -0
- package/lib/middleware/fireAlarmMiddleware.js +125 -0
- package/lib/middleware/yargsChecksMiddleware.js +2 -2
- package/lib/npm.d.ts +9 -0
- package/lib/npm.js +36 -0
- package/lib/oauth.js +1 -2
- package/lib/process.js +1 -2
- package/lib/projectProfiles.d.ts +7 -0
- package/lib/projectProfiles.js +83 -0
- package/lib/projects/ProjectLogsManager.d.ts +1 -1
- package/lib/projects/ProjectLogsManager.js +16 -21
- package/lib/projects/add/legacyAddComponent.d.ts +5 -0
- package/lib/projects/add/legacyAddComponent.js +48 -0
- package/lib/projects/add/v3AddComponent.d.ts +8 -0
- package/lib/projects/add/v3AddComponent.js +85 -0
- package/lib/projects/buildAndDeploy.js +46 -42
- package/lib/projects/components.d.ts +2 -0
- package/lib/projects/components.js +82 -0
- package/lib/projects/config.d.ts +9 -0
- package/lib/projects/config.js +79 -0
- package/lib/projects/create/index.d.ts +23 -0
- package/lib/projects/create/index.js +33 -0
- package/lib/projects/create/legacy.d.ts +6 -0
- package/lib/projects/{create.js → create/legacy.js} +23 -15
- package/lib/projects/create/v3.d.ts +27 -0
- package/lib/projects/create/v3.js +158 -0
- package/lib/projects/ensureProjectExists.d.ts +11 -0
- package/lib/projects/ensureProjectExists.js +97 -0
- package/lib/projects/localDev/AppDevModeInterface.d.ts +30 -0
- package/lib/projects/localDev/AppDevModeInterface.js +215 -0
- package/lib/{DevServerManager.d.ts → projects/localDev/DevServerManager.d.ts} +1 -1
- package/lib/{DevServerManager.js → projects/localDev/DevServerManager.js} +6 -6
- package/lib/projects/localDev/DevServerManagerV2.d.ts +22 -0
- package/lib/{DevServerManagerV2.js → projects/localDev/DevServerManagerV2.js} +22 -19
- package/lib/projects/localDev/LocalDevLogger.d.ts +30 -0
- package/lib/projects/localDev/LocalDevLogger.js +159 -0
- package/lib/{LocalDevManager.d.ts → projects/localDev/LocalDevManager.d.ts} +1 -1
- package/lib/{LocalDevManager.js → projects/localDev/LocalDevManager.js} +57 -83
- package/lib/projects/localDev/LocalDevProcess.d.ts +34 -0
- package/lib/projects/localDev/LocalDevProcess.js +201 -0
- package/lib/projects/localDev/LocalDevState.d.ts +50 -0
- package/lib/projects/localDev/LocalDevState.js +119 -0
- package/lib/projects/localDev/LocalDevWatcher.d.ts +10 -0
- package/lib/projects/localDev/LocalDevWatcher.js +53 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +20 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +131 -0
- package/lib/{localDev.d.ts → projects/localDev/helpers.d.ts} +6 -4
- package/lib/{localDev.js → projects/localDev/helpers.js} +127 -114
- package/lib/projects/ui.d.ts +1 -0
- package/lib/projects/ui.js +15 -0
- package/lib/projects/upload.d.ts +17 -2
- package/lib/projects/upload.js +74 -50
- package/lib/projects/urls.d.ts +4 -0
- package/lib/projects/urls.js +23 -1
- package/lib/projects/watch.d.ts +1 -1
- package/lib/projects/watch.js +21 -18
- package/lib/prompts/accountNamePrompt.js +16 -13
- package/lib/prompts/accountsPrompt.js +1 -2
- package/lib/prompts/cmsFieldPrompt.js +1 -2
- package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
- package/lib/prompts/createApiSamplePrompt.js +4 -5
- package/lib/prompts/createFunctionPrompt.js +13 -14
- package/lib/prompts/createModulePrompt.js +8 -9
- package/lib/prompts/createProjectPrompt.d.ts +20 -4
- package/lib/prompts/createProjectPrompt.js +43 -13
- package/lib/prompts/createTemplatePrompt.d.ts +22 -4
- package/lib/prompts/createTemplatePrompt.js +1 -2
- package/lib/prompts/downloadProjectPrompt.js +3 -4
- package/lib/prompts/installAppPrompt.d.ts +2 -0
- package/lib/prompts/installAppPrompt.js +45 -0
- package/lib/prompts/personalAccessKeyPrompt.js +35 -25
- package/lib/prompts/previewPrompt.js +5 -6
- package/lib/prompts/projectAddPrompt.d.ts +5 -1
- package/lib/prompts/projectAddPrompt.js +35 -8
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +15 -16
- package/lib/prompts/projectNamePrompt.js +5 -6
- package/lib/prompts/projectsLogsPrompt.js +3 -2
- package/lib/prompts/promptUtils.d.ts +4 -2
- package/lib/prompts/promptUtils.js +3 -1
- package/lib/prompts/sandboxesPrompt.js +5 -6
- package/lib/prompts/secretPrompt.js +2 -3
- package/lib/prompts/selectAppPrompt.d.ts +2 -0
- package/lib/prompts/selectAppPrompt.js +40 -0
- package/lib/prompts/selectHubDBTablePrompt.js +11 -8
- package/lib/prompts/{selectPublicAppPrompt.d.ts → selectPublicAppForMigrationPrompt.d.ts} +1 -1
- package/lib/prompts/{selectPublicAppPrompt.js → selectPublicAppForMigrationPrompt.js} +8 -9
- package/lib/prompts/setAsDefaultAccountPrompt.js +11 -2
- package/lib/prompts/uploadPrompt.js +4 -5
- package/lib/sandboxSync.js +15 -14
- package/lib/sandboxes.js +12 -13
- package/lib/serverlessLogs.js +4 -6
- package/lib/testUtils.d.ts +3 -3
- package/lib/testUtils.js +8 -9
- package/lib/ui/boxen.d.ts +5 -0
- package/lib/ui/boxen.js +30 -0
- package/lib/ui/git.js +8 -9
- package/lib/ui/index.d.ts +4 -2
- package/lib/ui/index.js +20 -17
- package/lib/ui/logger.d.ts +10 -0
- package/lib/ui/logger.js +15 -0
- package/lib/ui/serverlessFunctionLogs.js +2 -3
- package/lib/upload.d.ts +1 -1
- package/lib/validation.js +4 -5
- package/lib/yargsUtils.d.ts +5 -1
- package/lib/yargsUtils.js +6 -0
- package/mcp-server/server.d.ts +1 -0
- package/mcp-server/server.js +18 -0
- package/mcp-server/tools/index.d.ts +2 -0
- package/mcp-server/tools/index.js +17 -0
- package/mcp-server/tools/project/AddFeatureToProject.d.ts +29 -0
- package/mcp-server/tools/project/AddFeatureToProject.js +85 -0
- package/mcp-server/tools/project/CreateProjectTool.d.ts +35 -0
- package/mcp-server/tools/project/CreateProjectTool.js +100 -0
- package/mcp-server/tools/project/DeployProject.d.ts +20 -0
- package/mcp-server/tools/project/DeployProject.js +50 -0
- package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +17 -0
- package/mcp-server/tools/project/GuidedWalkthroughTool.js +58 -0
- package/mcp-server/tools/project/UploadProjectTools.d.ts +17 -0
- package/mcp-server/tools/project/UploadProjectTools.js +35 -0
- package/mcp-server/tools/project/constants.d.ts +3 -0
- package/mcp-server/tools/project/constants.js +13 -0
- package/mcp-server/types.d.ts +14 -0
- package/mcp-server/types.js +17 -0
- package/mcp-server/utils/command.d.ts +3 -0
- package/mcp-server/utils/command.js +16 -0
- package/mcp-server/utils/content.d.ts +3 -0
- package/mcp-server/utils/content.js +21 -0
- package/mcp-server/utils/project.d.ts +5 -0
- package/mcp-server/utils/project.js +17 -0
- package/package.json +19 -11
- package/types/Cms.d.ts +30 -0
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +35 -0
- package/types/LocalDev.js +2 -0
- package/types/Projects.d.ts +19 -2
- package/types/Prompts.d.ts +0 -7
- package/types/Yargs.d.ts +14 -14
- package/lib/DevServerManagerV2.d.ts +0 -33
- package/lib/LocalDevManagerV2.d.ts +0 -64
- package/lib/LocalDevManagerV2.js +0 -377
- package/lib/projects/create.d.ts +0 -5
- package/lib/projects/index.d.ts +0 -21
- package/lib/projects/index.js +0 -194
- package/lib/prompts/installPublicAppPrompt.d.ts +0 -1
- package/lib/prompts/installPublicAppPrompt.js +0 -40
package/commands/remove.js
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const fileMapper_1 = require("@hubspot/local-dev-lib/api/fileMapper");
|
|
7
|
-
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
8
4
|
const index_1 = require("../lib/errorHandlers/index");
|
|
9
|
-
const commonOpts_1 = require("../lib/commonOpts");
|
|
10
5
|
const usageTracking_1 = require("../lib/usageTracking");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
const en_1 = require("../lang/en");
|
|
7
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
8
|
+
const logger_1 = require("../lib/ui/logger");
|
|
9
|
+
const command = 'remove <path>';
|
|
10
|
+
const describe = en_1.commands.remove.describe;
|
|
15
11
|
async function handler(args) {
|
|
16
12
|
const { path: hsPath, derivedAccountId } = args;
|
|
17
13
|
(0, usageTracking_1.trackCommandUsage)('remove', undefined, derivedAccountId);
|
|
18
14
|
try {
|
|
19
15
|
await (0, fileMapper_1.deleteFile)(derivedAccountId, hsPath);
|
|
20
|
-
logger_1.
|
|
16
|
+
logger_1.uiLogger.log(en_1.commands.remove.deleted(hsPath, derivedAccountId));
|
|
21
17
|
}
|
|
22
18
|
catch (error) {
|
|
23
|
-
logger_1.
|
|
24
|
-
accountId: derivedAccountId,
|
|
25
|
-
path: hsPath,
|
|
26
|
-
}));
|
|
19
|
+
logger_1.uiLogger.error(en_1.commands.remove.errors.deleteFailed(hsPath, derivedAccountId));
|
|
27
20
|
(0, index_1.logError)(error, new index_1.ApiErrorContext({
|
|
28
21
|
accountId: derivedAccountId,
|
|
29
22
|
request: hsPath,
|
|
30
23
|
}));
|
|
31
24
|
}
|
|
32
25
|
}
|
|
33
|
-
function
|
|
34
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
35
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
36
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
37
|
-
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
26
|
+
function cmsRemoveBuilder(yargs) {
|
|
38
27
|
yargs.positional('path', {
|
|
39
|
-
describe:
|
|
28
|
+
describe: en_1.commands.remove.positionals.path,
|
|
40
29
|
type: 'string',
|
|
41
30
|
});
|
|
42
31
|
return yargs;
|
|
43
32
|
}
|
|
33
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(cmsRemoveBuilder, command, describe, {
|
|
34
|
+
useGlobalOptions: true,
|
|
35
|
+
useConfigOptions: true,
|
|
36
|
+
useAccountOptions: true,
|
|
37
|
+
useEnvironmentOptions: true,
|
|
38
|
+
});
|
|
39
|
+
const cmsRemoveCommand = {
|
|
40
|
+
command,
|
|
41
|
+
describe,
|
|
42
|
+
handler,
|
|
43
|
+
builder,
|
|
44
|
+
};
|
|
45
|
+
exports.default = cmsRemoveCommand;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "create";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = ConfigArgs & AccountArgs & EnvironmentArgs & TestingArgs;
|
|
6
|
-
type SandboxCreateArgs = CommonArgs & CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, TestingArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type SandboxCreateArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & TestingArgs & {
|
|
7
3
|
name?: string;
|
|
8
4
|
force?: boolean;
|
|
9
5
|
type?: string;
|
|
10
6
|
};
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
export {};
|
|
7
|
+
declare const sandboxCreateCommand: YargsCommandModule<unknown, SandboxCreateArgs>;
|
|
8
|
+
export default sandboxCreateCommand;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
7
4
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
8
5
|
const index_1 = require("@hubspot/local-dev-lib/errors/index");
|
|
9
6
|
const urls_1 = require("@hubspot/local-dev-lib/urls");
|
|
10
7
|
const config_2 = require("@hubspot/local-dev-lib/constants/config");
|
|
11
8
|
const environment_1 = require("@hubspot/local-dev-lib/environment");
|
|
12
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
13
9
|
const lang_1 = require("../../lib/lang");
|
|
14
10
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
15
11
|
const ui_1 = require("../../lib/ui");
|
|
@@ -21,9 +17,9 @@ const sandboxSync_1 = require("../../lib/sandboxSync");
|
|
|
21
17
|
const index_2 = require("../../lib/errorHandlers/index");
|
|
22
18
|
const buildAccount_1 = require("../../lib/buildAccount");
|
|
23
19
|
const accountNamePrompt_1 = require("../../lib/prompts/accountNamePrompt");
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
21
|
+
const command = 'create';
|
|
22
|
+
const describe = (0, ui_1.uiBetaTag)((0, lang_1.i18n)(`commands.sandbox.subcommands.create.describe`), false);
|
|
27
23
|
async function handler(args) {
|
|
28
24
|
const { name, type, force, derivedAccountId } = args;
|
|
29
25
|
const accountConfig = (0, config_1.getAccountConfig)(derivedAccountId);
|
|
@@ -31,7 +27,7 @@ async function handler(args) {
|
|
|
31
27
|
(0, usageTracking_1.trackCommandUsage)('sandbox-create', {}, derivedAccountId);
|
|
32
28
|
// Check if account config exists
|
|
33
29
|
if (!accountConfig) {
|
|
34
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
30
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.sandbox.subcommands.create.failure.noAccountConfig`, {
|
|
35
31
|
accountId: derivedAccountId,
|
|
36
32
|
authCommand: (0, ui_1.uiCommandReference)('hs auth'),
|
|
37
33
|
}));
|
|
@@ -40,7 +36,7 @@ async function handler(args) {
|
|
|
40
36
|
// Default account is not a production portal
|
|
41
37
|
if (accountConfig.accountType &&
|
|
42
38
|
accountConfig.accountType !== config_2.HUBSPOT_ACCOUNT_TYPES.STANDARD) {
|
|
43
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
39
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.sandbox.subcommands.create.failure.invalidAccountType`, {
|
|
44
40
|
accountType: config_2.HUBSPOT_ACCOUNT_TYPE_STRINGS[config_2.HUBSPOT_ACCOUNT_TYPES[accountConfig.accountType]],
|
|
45
41
|
accountName: accountConfig.name || '',
|
|
46
42
|
}));
|
|
@@ -53,7 +49,7 @@ async function handler(args) {
|
|
|
53
49
|
typePrompt = await (0, sandboxesPrompt_1.sandboxTypePrompt)();
|
|
54
50
|
}
|
|
55
51
|
else {
|
|
56
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
52
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.sandbox.subcommands.create.failure.optionMissing.type`));
|
|
57
53
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
58
54
|
}
|
|
59
55
|
}
|
|
@@ -86,7 +82,7 @@ async function handler(args) {
|
|
|
86
82
|
namePrompt = await (0, accountNamePrompt_1.hubspotAccountNamePrompt)({ accountType: sandboxType });
|
|
87
83
|
}
|
|
88
84
|
else {
|
|
89
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
85
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.sandbox.subcommands.create.failure.optionMissing.name`));
|
|
90
86
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
91
87
|
}
|
|
92
88
|
}
|
|
@@ -111,7 +107,7 @@ async function handler(args) {
|
|
|
111
107
|
const sandboxAccountConfig = (0, config_1.getAccountConfig)(result.sandbox.sandboxHubId);
|
|
112
108
|
// Check if sandbox account config exists
|
|
113
109
|
if (!sandboxAccountConfig) {
|
|
114
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
110
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.sandbox.subcommands.create.failure.noSandboxAccountConfig`, {
|
|
115
111
|
accountId: result.sandbox.sandboxHubId,
|
|
116
112
|
authCommand: (0, ui_1.uiCommandReference)('hs auth'),
|
|
117
113
|
}));
|
|
@@ -147,29 +143,39 @@ async function handler(args) {
|
|
|
147
143
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
148
144
|
}
|
|
149
145
|
}
|
|
150
|
-
function
|
|
146
|
+
function sandboxCreateBuilder(yargs) {
|
|
151
147
|
yargs.option('force', {
|
|
152
148
|
type: 'boolean',
|
|
153
149
|
alias: 'f',
|
|
154
|
-
describe: (0, lang_1.i18n)(
|
|
150
|
+
describe: (0, lang_1.i18n)(`commands.sandbox.subcommands.create.options.force.describe`),
|
|
155
151
|
});
|
|
156
152
|
yargs.option('name', {
|
|
157
|
-
describe: (0, lang_1.i18n)(
|
|
153
|
+
describe: (0, lang_1.i18n)(`commands.sandbox.subcommands.create.options.name.describe`),
|
|
158
154
|
type: 'string',
|
|
159
155
|
});
|
|
160
156
|
yargs.option('type', {
|
|
161
|
-
describe: (0, lang_1.i18n)(
|
|
157
|
+
describe: (0, lang_1.i18n)(`commands.sandbox.subcommands.create.options.type.describe`),
|
|
162
158
|
choices: Object.keys(sandboxes_1.SANDBOX_TYPE_MAP),
|
|
163
159
|
});
|
|
164
160
|
yargs.example([
|
|
165
161
|
[
|
|
166
162
|
'$0 sandbox create --name=MySandboxAccount --type=STANDARD',
|
|
167
|
-
(0, lang_1.i18n)(
|
|
163
|
+
(0, lang_1.i18n)(`commands.sandbox.subcommands.create.examples.default`),
|
|
168
164
|
],
|
|
169
165
|
]);
|
|
170
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
171
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
172
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
173
|
-
(0, commonOpts_1.addTestingOptions)(yargs);
|
|
174
166
|
return yargs;
|
|
175
167
|
}
|
|
168
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(sandboxCreateBuilder, command, describe, {
|
|
169
|
+
useGlobalOptions: true,
|
|
170
|
+
useConfigOptions: true,
|
|
171
|
+
useAccountOptions: true,
|
|
172
|
+
useEnvironmentOptions: true,
|
|
173
|
+
useTestingOptions: true,
|
|
174
|
+
});
|
|
175
|
+
const sandboxCreateCommand = {
|
|
176
|
+
command,
|
|
177
|
+
describe,
|
|
178
|
+
handler,
|
|
179
|
+
builder,
|
|
180
|
+
};
|
|
181
|
+
exports.default = sandboxCreateCommand;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "delete";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = ConfigArgs & AccountArgs & EnvironmentArgs & TestingArgs;
|
|
6
|
-
type SandboxDeleteArgs = CommonArgs & CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, TestingArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type SandboxDeleteArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & TestingArgs & {
|
|
7
3
|
account?: string;
|
|
8
4
|
force?: boolean;
|
|
9
5
|
};
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
export {};
|
|
6
|
+
declare const sandboxDeleteCommand: YargsCommandModule<unknown, SandboxDeleteArgs>;
|
|
7
|
+
export default sandboxDeleteCommand;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
7
4
|
const index_1 = require("@hubspot/local-dev-lib/errors/index");
|
|
8
5
|
const sandboxHubs_1 = require("@hubspot/local-dev-lib/api/sandboxHubs");
|
|
@@ -10,7 +7,6 @@ const config_1 = require("@hubspot/local-dev-lib/config");
|
|
|
10
7
|
const getAccountIdentifier_1 = require("@hubspot/local-dev-lib/config/getAccountIdentifier");
|
|
11
8
|
const urls_1 = require("@hubspot/local-dev-lib/urls");
|
|
12
9
|
const environment_1 = require("@hubspot/local-dev-lib/environment");
|
|
13
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
14
10
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
15
11
|
const index_2 = require("../../lib/errorHandlers/index");
|
|
16
12
|
const lang_1 = require("../../lib/lang");
|
|
@@ -19,9 +15,9 @@ const accountsPrompt_1 = require("../../lib/prompts/accountsPrompt");
|
|
|
19
15
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
20
16
|
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
21
17
|
const ui_1 = require("../../lib/ui");
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
19
|
+
const command = 'delete';
|
|
20
|
+
const describe = (0, ui_1.uiBetaTag)((0, lang_1.i18n)(`commands.sandbox.subcommands.delete.describe`), false);
|
|
25
21
|
async function handler(args) {
|
|
26
22
|
const { providedAccountId, force } = args;
|
|
27
23
|
(0, usageTracking_1.trackCommandUsage)('sandbox-delete', {}, providedAccountId);
|
|
@@ -33,12 +29,12 @@ async function handler(args) {
|
|
|
33
29
|
else {
|
|
34
30
|
// Account is required, throw error if force flag is present and no account is specified
|
|
35
31
|
logger_1.logger.log('');
|
|
36
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
32
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.sandbox.subcommands.delete.failure.noAccount`));
|
|
37
33
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
38
34
|
}
|
|
39
35
|
if (!accountPrompt) {
|
|
40
36
|
logger_1.logger.log('');
|
|
41
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
37
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.sandbox.subcommands.delete.failure.noSandboxAccounts`, {
|
|
42
38
|
authCommand: (0, ui_1.uiCommandReference)('hs auth'),
|
|
43
39
|
}));
|
|
44
40
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
@@ -46,7 +42,7 @@ async function handler(args) {
|
|
|
46
42
|
}
|
|
47
43
|
const sandboxAccountId = (0, config_1.getAccountId)(providedAccountId || accountPrompt.account);
|
|
48
44
|
if (!sandboxAccountId) {
|
|
49
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
45
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.sandbox.subcommands.delete.failure.noSandboxAccountId`));
|
|
50
46
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
51
47
|
}
|
|
52
48
|
const isDefaultAccount = sandboxAccountId === (0, config_1.getAccountId)();
|
|
@@ -61,7 +57,7 @@ async function handler(args) {
|
|
|
61
57
|
else if (!force) {
|
|
62
58
|
const parentAccountPrompt = await (0, sandboxesPrompt_1.deleteSandboxPrompt)(true);
|
|
63
59
|
if (!parentAccountPrompt) {
|
|
64
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
60
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.sandbox.subcommands.delete.failure.noParentAccount`, {
|
|
65
61
|
authCommand: (0, ui_1.uiCommandReference)('hs auth'),
|
|
66
62
|
}));
|
|
67
63
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
@@ -69,7 +65,7 @@ async function handler(args) {
|
|
|
69
65
|
parentAccountId = (0, config_1.getAccountId)(parentAccountPrompt.account);
|
|
70
66
|
}
|
|
71
67
|
else {
|
|
72
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
68
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.sandbox.subcommands.delete.failure.noParentAccount`, {
|
|
73
69
|
authCommand: (0, ui_1.uiCommandReference)('hs auth'),
|
|
74
70
|
}));
|
|
75
71
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
@@ -80,7 +76,7 @@ async function handler(args) {
|
|
|
80
76
|
const command = `hs auth ${(0, config_1.getEnv)(sandboxAccountId) === 'qa' ? '--qa' : ''} --account=${parentAccountId}`;
|
|
81
77
|
if (parentAccountId && !(0, config_1.getAccountId)(parentAccountId)) {
|
|
82
78
|
logger_1.logger.log('');
|
|
83
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
79
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.sandbox.subcommands.delete.failure.noParentPortalAvailable`, {
|
|
84
80
|
parentAccountId,
|
|
85
81
|
url,
|
|
86
82
|
command,
|
|
@@ -88,11 +84,11 @@ async function handler(args) {
|
|
|
88
84
|
logger_1.logger.log('');
|
|
89
85
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
90
86
|
}
|
|
91
|
-
logger_1.logger.debug((0, lang_1.i18n)(
|
|
87
|
+
logger_1.logger.debug((0, lang_1.i18n)(`commands.sandbox.subcommands.delete.debug.deleting`, {
|
|
92
88
|
account: (0, ui_1.uiAccountDescription)(sandboxAccountId),
|
|
93
89
|
}));
|
|
94
90
|
if (isDefaultAccount) {
|
|
95
|
-
logger_1.logger.info((0, lang_1.i18n)(
|
|
91
|
+
logger_1.logger.info((0, lang_1.i18n)(`commands.sandbox.subcommands.delete.defaultAccountWarning`, {
|
|
96
92
|
account: (0, ui_1.uiAccountDescription)(sandboxAccountId),
|
|
97
93
|
}));
|
|
98
94
|
logger_1.logger.log('');
|
|
@@ -103,7 +99,7 @@ async function handler(args) {
|
|
|
103
99
|
{
|
|
104
100
|
name: 'confirmSandboxDeletePrompt',
|
|
105
101
|
type: 'confirm',
|
|
106
|
-
message: (0, lang_1.i18n)(
|
|
102
|
+
message: (0, lang_1.i18n)(`commands.sandbox.subcommands.delete.confirm`, {
|
|
107
103
|
account: (0, ui_1.uiAccountDescription)(sandboxAccountId),
|
|
108
104
|
}),
|
|
109
105
|
},
|
|
@@ -114,8 +110,8 @@ async function handler(args) {
|
|
|
114
110
|
}
|
|
115
111
|
await (0, sandboxHubs_1.deleteSandbox)(parentAccountId, sandboxAccountId);
|
|
116
112
|
const deleteKey = isDefaultAccount
|
|
117
|
-
?
|
|
118
|
-
:
|
|
113
|
+
? `commands.sandbox.subcommands.delete.success.deleteDefault`
|
|
114
|
+
: `commands.sandbox.subcommands.delete.success.delete`;
|
|
119
115
|
logger_1.logger.log('');
|
|
120
116
|
logger_1.logger.success((0, lang_1.i18n)(deleteKey, {
|
|
121
117
|
account: providedAccountId || accountPrompt.account,
|
|
@@ -139,7 +135,7 @@ async function handler(args) {
|
|
|
139
135
|
// Intercept invalid key error
|
|
140
136
|
// This command uses the parent portal PAK to delete a sandbox, so we must specify which account needs a new key
|
|
141
137
|
logger_1.logger.log('');
|
|
142
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
138
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.sandbox.subcommands.delete.failure.invalidKey`, {
|
|
143
139
|
account: (0, ui_1.uiAccountDescription)(parentAccountId),
|
|
144
140
|
authCommand: (0, ui_1.uiCommandReference)('hs auth'),
|
|
145
141
|
}));
|
|
@@ -150,7 +146,7 @@ async function handler(args) {
|
|
|
150
146
|
subCategory: 'SandboxErrors.USER_ACCESS_NOT_ALLOWED',
|
|
151
147
|
})) {
|
|
152
148
|
logger_1.logger.log('');
|
|
153
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
149
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.sandbox.subcommands.delete.failure.invalidUser`, {
|
|
154
150
|
accountName: (0, ui_1.uiAccountDescription)(sandboxAccountId),
|
|
155
151
|
parentAccountName: (0, ui_1.uiAccountDescription)(parentAccountId),
|
|
156
152
|
}));
|
|
@@ -162,7 +158,7 @@ async function handler(args) {
|
|
|
162
158
|
subCategory: 'SandboxErrors.SANDBOX_NOT_FOUND',
|
|
163
159
|
})) {
|
|
164
160
|
logger_1.logger.log('');
|
|
165
|
-
logger_1.logger.warn((0, lang_1.i18n)(
|
|
161
|
+
logger_1.logger.warn((0, lang_1.i18n)(`commands.sandbox.subcommands.delete.failure.objectNotFound`, {
|
|
166
162
|
account: (0, ui_1.uiAccountDescription)(sandboxAccountId),
|
|
167
163
|
}));
|
|
168
164
|
logger_1.logger.log('');
|
|
@@ -183,25 +179,35 @@ async function handler(args) {
|
|
|
183
179
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
184
180
|
}
|
|
185
181
|
}
|
|
186
|
-
function
|
|
182
|
+
function sandboxDeleteBuilder(yargs) {
|
|
187
183
|
yargs.option('account', {
|
|
188
|
-
describe: (0, lang_1.i18n)(
|
|
184
|
+
describe: (0, lang_1.i18n)(`commands.sandbox.subcommands.delete.options.account.describe`),
|
|
189
185
|
type: 'string',
|
|
190
186
|
});
|
|
191
187
|
yargs.option('force', {
|
|
192
188
|
type: 'boolean',
|
|
193
189
|
alias: 'f',
|
|
194
|
-
describe: (0, lang_1.i18n)(
|
|
190
|
+
describe: (0, lang_1.i18n)(`commands.sandbox.subcommands.delete.options.force.describe`),
|
|
195
191
|
});
|
|
196
192
|
yargs.example([
|
|
197
193
|
[
|
|
198
194
|
'$0 sandbox delete --account=MySandboxAccount',
|
|
199
|
-
(0, lang_1.i18n)(
|
|
195
|
+
(0, lang_1.i18n)(`commands.sandbox.subcommands.delete.examples.default`),
|
|
200
196
|
],
|
|
201
197
|
]);
|
|
202
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
203
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
204
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
205
|
-
(0, commonOpts_1.addTestingOptions)(yargs);
|
|
206
198
|
return yargs;
|
|
207
199
|
}
|
|
200
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(sandboxDeleteBuilder, command, describe, {
|
|
201
|
+
useGlobalOptions: true,
|
|
202
|
+
useConfigOptions: true,
|
|
203
|
+
useAccountOptions: true,
|
|
204
|
+
useEnvironmentOptions: true,
|
|
205
|
+
useTestingOptions: true,
|
|
206
|
+
});
|
|
207
|
+
const sandboxDeleteCommand = {
|
|
208
|
+
command,
|
|
209
|
+
describe,
|
|
210
|
+
handler,
|
|
211
|
+
builder,
|
|
212
|
+
};
|
|
213
|
+
exports.default = sandboxDeleteCommand;
|
package/commands/sandbox.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare function builder(yargs: Argv): Argv;
|
|
1
|
+
import { YargsCommandModuleBucket } from '../types/Yargs';
|
|
2
|
+
declare const sandboxCommand: YargsCommandModuleBucket;
|
|
3
|
+
export default sandboxCommand;
|
package/commands/sandbox.js
CHANGED
|
@@ -1,50 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
35
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.describe = exports.command = void 0;
|
|
37
|
-
exports.builder = builder;
|
|
38
|
-
const commonOpts_1 = require("../lib/commonOpts");
|
|
39
6
|
const lang_1 = require("../lib/lang");
|
|
40
7
|
const ui_1 = require("../lib/ui");
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
function
|
|
47
|
-
(
|
|
48
|
-
yargs.command(create).command(del).demandCommand(1, '');
|
|
8
|
+
const create_1 = __importDefault(require("./sandbox/create"));
|
|
9
|
+
const delete_1 = __importDefault(require("./sandbox/delete"));
|
|
10
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
11
|
+
const command = ['sandbox', 'sandboxes'];
|
|
12
|
+
const describe = (0, ui_1.uiBetaTag)((0, lang_1.i18n)(`commands.sandbox.describe`), false);
|
|
13
|
+
function sandboxBuilder(yargs) {
|
|
14
|
+
yargs.command(create_1.default).command(delete_1.default).demandCommand(1, '');
|
|
49
15
|
return yargs;
|
|
50
16
|
}
|
|
17
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(sandboxBuilder, command, describe);
|
|
18
|
+
const sandboxCommand = {
|
|
19
|
+
command,
|
|
20
|
+
describe,
|
|
21
|
+
builder,
|
|
22
|
+
handler: () => { },
|
|
23
|
+
};
|
|
24
|
+
exports.default = sandboxCommand;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "add [name]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type AddSecretArgs = CommonArgs & CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type AddSecretArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
name?: string;
|
|
8
4
|
};
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
5
|
+
declare const addSecretCommand: YargsCommandModule<unknown, AddSecretArgs>;
|
|
6
|
+
export default addSecretCommand;
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describe = exports.command = void 0;
|
|
4
|
-
exports.handler = handler;
|
|
5
|
-
exports.builder = builder;
|
|
6
3
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
7
4
|
const secrets_1 = require("@hubspot/local-dev-lib/api/secrets");
|
|
8
5
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
9
6
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
10
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
11
7
|
const ui_1 = require("../../lib/ui");
|
|
12
8
|
const secretPrompt_1 = require("../../lib/prompts/secretPrompt");
|
|
13
9
|
const lang_1 = require("../../lib/lang");
|
|
14
10
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
15
11
|
const ui_2 = require("../../lib/ui");
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
13
|
+
const command = 'add [name]';
|
|
14
|
+
const describe = (0, lang_1.i18n)(`commands.secret.subcommands.add.describe`);
|
|
19
15
|
async function handler(args) {
|
|
20
16
|
const { name, derivedAccountId } = args;
|
|
21
17
|
let secretName = name;
|
|
@@ -27,7 +23,7 @@ async function handler(args) {
|
|
|
27
23
|
}
|
|
28
24
|
const { data: { results: secrets }, } = await (0, secrets_1.fetchSecrets)(derivedAccountId);
|
|
29
25
|
if (secrets.includes(secretName)) {
|
|
30
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
26
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.secret.subcommands.add.errors.alreadyExists`, {
|
|
31
27
|
secretName,
|
|
32
28
|
command: (0, ui_2.uiCommandReference)('hs secret update'),
|
|
33
29
|
}));
|
|
@@ -35,13 +31,13 @@ async function handler(args) {
|
|
|
35
31
|
}
|
|
36
32
|
const { secretValue } = await (0, secretPrompt_1.secretValuePrompt)();
|
|
37
33
|
await (0, secrets_1.addSecret)(derivedAccountId, secretName, secretValue);
|
|
38
|
-
logger_1.logger.success((0, lang_1.i18n)(
|
|
34
|
+
logger_1.logger.success((0, lang_1.i18n)(`commands.secret.subcommands.add.success.add`, {
|
|
39
35
|
accountIdentifier: (0, ui_1.uiAccountDescription)(derivedAccountId),
|
|
40
36
|
secretName,
|
|
41
37
|
}));
|
|
42
38
|
}
|
|
43
39
|
catch (err) {
|
|
44
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
40
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.secret.subcommands.add.errors.add`, {
|
|
45
41
|
secretName: secretName || '',
|
|
46
42
|
}));
|
|
47
43
|
(0, index_1.logError)(err, new index_1.ApiErrorContext({
|
|
@@ -50,13 +46,23 @@ async function handler(args) {
|
|
|
50
46
|
}));
|
|
51
47
|
}
|
|
52
48
|
}
|
|
53
|
-
function
|
|
54
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
55
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
56
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
49
|
+
function addSecretBuilder(yargs) {
|
|
57
50
|
yargs.positional('name', {
|
|
58
|
-
describe: (0, lang_1.i18n)(
|
|
51
|
+
describe: (0, lang_1.i18n)(`commands.secret.subcommands.add.positionals.name.describe`),
|
|
59
52
|
type: 'string',
|
|
60
53
|
});
|
|
61
54
|
return yargs;
|
|
62
55
|
}
|
|
56
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(addSecretBuilder, command, describe, {
|
|
57
|
+
useGlobalOptions: true,
|
|
58
|
+
useConfigOptions: true,
|
|
59
|
+
useAccountOptions: true,
|
|
60
|
+
useEnvironmentOptions: true,
|
|
61
|
+
});
|
|
62
|
+
const addSecretCommand = {
|
|
63
|
+
command,
|
|
64
|
+
describe,
|
|
65
|
+
handler,
|
|
66
|
+
builder,
|
|
67
|
+
};
|
|
68
|
+
exports.default = addSecretCommand;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "delete [name]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type DeleteSecretArgs = CommonArgs & CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type DeleteSecretArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
name?: string;
|
|
8
4
|
force?: boolean;
|
|
9
5
|
};
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
export {};
|
|
6
|
+
declare const deleteSecretCommand: YargsCommandModule<unknown, DeleteSecretArgs>;
|
|
7
|
+
export default deleteSecretCommand;
|