@hubspot/cli 7.5.4-experimental.0 → 7.5.4
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 +14 -4
- package/api/migrate.js +16 -2
- package/bin/cli.js +100 -95
- package/commands/account/auth.d.ts +5 -7
- package/commands/account/auth.js +87 -80
- package/commands/account/clean.d.ts +3 -7
- package/commands/account/clean.js +16 -9
- package/commands/account/createOverride.d.ts +3 -7
- package/commands/account/createOverride.js +23 -6
- package/commands/account/info.d.ts +3 -7
- package/commands/account/info.js +13 -5
- package/commands/account/list.d.ts +3 -7
- package/commands/account/list.js +15 -8
- package/commands/account/remove.d.ts +3 -7
- package/commands/account/remove.js +21 -9
- package/commands/account/removeOverride.d.ts +3 -7
- package/commands/account/removeOverride.js +23 -6
- 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 +14 -6
- package/commands/account.d.ts +3 -4
- package/commands/account.js +33 -58
- 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 +35 -35
- 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 +3 -7
- package/commands/config/migrate.js +37 -46
- package/commands/config/set.d.ts +5 -6
- package/commands/config/set.js +38 -14
- package/commands/config.d.ts +3 -4
- package/commands/config.js +18 -44
- 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 +25 -17
- 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 -0
- package/commands/project/migrate.js +71 -0
- 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 +82 -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 -35
- 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 +3217 -0
- package/lang/en.js +3074 -3318
- package/lang/en.lyaml +41 -246
- 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 +232 -99
- package/lib/app/migrate_legacy.d.ts +2 -2
- package/lib/app/migrate_legacy.js +16 -13
- 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 -2
- package/lib/configMigrate.js +39 -60
- 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.js +10 -11
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +1 -1
- package/lib/doctor/DiagnosticInfoBuilder.js +10 -10
- package/lib/doctor/Doctor.js +45 -49
- 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 +21 -0
- package/lib/mcp/setup.js +218 -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 +32 -2
- package/lib/middleware/fireAlarmMiddleware.d.ts +2 -2
- package/lib/middleware/fireAlarmMiddleware.js +12 -24
- 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 +3 -2
- package/lib/ui/index.js +15 -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 +19 -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 +104 -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/ValidateProjectTool.d.ts +17 -0
- package/mcp-server/tools/project/ValidateProjectTool.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 +25 -17
- 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 -11
- 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 -20
- package/lib/projects/index.js +0 -194
- package/lib/prompts/installPublicAppPrompt.d.ts +0 -1
- package/lib/prompts/installPublicAppPrompt.js +0 -40
|
@@ -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 secrets_1 = require("@hubspot/local-dev-lib/api/secrets");
|
|
8
5
|
const secretPrompt_1 = require("../../lib/prompts/secretPrompt");
|
|
@@ -11,11 +8,10 @@ const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
|
11
8
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
12
9
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
13
10
|
const ui_1 = require("../../lib/ui");
|
|
14
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
15
11
|
const lang_1 = require("../../lib/lang");
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
13
|
+
const command = 'delete [name]';
|
|
14
|
+
const describe = (0, lang_1.i18n)(`commands.secret.subcommands.delete.describe`);
|
|
19
15
|
async function handler(args) {
|
|
20
16
|
const { name, derivedAccountId, force } = args;
|
|
21
17
|
let secretName = name;
|
|
@@ -23,30 +19,34 @@ async function handler(args) {
|
|
|
23
19
|
try {
|
|
24
20
|
const { data: { results: secrets }, } = await (0, secrets_1.fetchSecrets)(derivedAccountId);
|
|
25
21
|
if (secretName && !secrets.includes(secretName)) {
|
|
26
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
22
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.secret.subcommands.delete.errors.noSecret`, {
|
|
23
|
+
secretName,
|
|
24
|
+
}));
|
|
27
25
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
28
26
|
}
|
|
29
27
|
if (!secretName) {
|
|
30
|
-
const { secretToModify } = await (0, secretPrompt_1.secretListPrompt)(secrets, (0, lang_1.i18n)(
|
|
28
|
+
const { secretToModify } = await (0, secretPrompt_1.secretListPrompt)(secrets, (0, lang_1.i18n)(`commands.secret.subcommands.delete.selectSecret`));
|
|
31
29
|
secretName = secretToModify;
|
|
32
30
|
}
|
|
33
31
|
const confirmDelete = force ||
|
|
34
|
-
(await (0, promptUtils_1.confirmPrompt)((0, lang_1.i18n)(
|
|
32
|
+
(await (0, promptUtils_1.confirmPrompt)((0, lang_1.i18n)(`commands.secret.subcommands.delete.confirmDelete`, {
|
|
33
|
+
secretName,
|
|
34
|
+
}), {
|
|
35
35
|
defaultAnswer: false,
|
|
36
36
|
}));
|
|
37
37
|
if (!confirmDelete) {
|
|
38
|
-
logger_1.logger.success((0, lang_1.i18n)(
|
|
38
|
+
logger_1.logger.success((0, lang_1.i18n)(`commands.secret.subcommands.delete.deleteCanceled`));
|
|
39
39
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
40
40
|
}
|
|
41
41
|
await (0, secrets_1.deleteSecret)(derivedAccountId, secretName);
|
|
42
|
-
logger_1.logger.success((0, lang_1.i18n)(
|
|
42
|
+
logger_1.logger.success((0, lang_1.i18n)(`commands.secret.subcommands.delete.success.delete`, {
|
|
43
43
|
accountIdentifier: (0, ui_1.uiAccountDescription)(derivedAccountId),
|
|
44
44
|
secretName,
|
|
45
45
|
}));
|
|
46
46
|
}
|
|
47
47
|
catch (err) {
|
|
48
48
|
if (secretName) {
|
|
49
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
49
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.secret.subcommands.delete.errors.delete`, {
|
|
50
50
|
secretName,
|
|
51
51
|
}));
|
|
52
52
|
}
|
|
@@ -56,13 +56,10 @@ async function handler(args) {
|
|
|
56
56
|
}));
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
61
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
62
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
59
|
+
function deleteSecretBuilder(yargs) {
|
|
63
60
|
yargs
|
|
64
61
|
.positional('name', {
|
|
65
|
-
describe: (0, lang_1.i18n)(
|
|
62
|
+
describe: (0, lang_1.i18n)(`commands.secret.subcommands.delete.positionals.name.describe`),
|
|
66
63
|
type: 'string',
|
|
67
64
|
})
|
|
68
65
|
.options('force', {
|
|
@@ -71,3 +68,16 @@ function builder(yargs) {
|
|
|
71
68
|
});
|
|
72
69
|
return yargs;
|
|
73
70
|
}
|
|
71
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(deleteSecretBuilder, command, describe, {
|
|
72
|
+
useGlobalOptions: true,
|
|
73
|
+
useConfigOptions: true,
|
|
74
|
+
useAccountOptions: true,
|
|
75
|
+
useEnvironmentOptions: true,
|
|
76
|
+
});
|
|
77
|
+
const deleteSecretCommand = {
|
|
78
|
+
command,
|
|
79
|
+
describe,
|
|
80
|
+
handler,
|
|
81
|
+
builder,
|
|
82
|
+
};
|
|
83
|
+
exports.default = deleteSecretCommand;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
type CombinedArgs = ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type ListSecretArgs = CommonArgs & CombinedArgs;
|
|
7
|
-
export declare function handler(args: ArgumentsCamelCase<ListSecretArgs>): Promise<void>;
|
|
8
|
-
export declare function builder(yargs: Argv): Argv<ListSecretArgs>;
|
|
9
|
-
export {};
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type ListSecretArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
3
|
+
declare const listSecretCommand: YargsCommandModule<unknown, ListSecretArgs>;
|
|
4
|
+
export default listSecretCommand;
|
|
@@ -1,24 +1,20 @@
|
|
|
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
7
|
const ui_1 = require("../../lib/ui");
|
|
11
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
12
8
|
const lang_1 = require("../../lib/lang");
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
10
|
+
const command = 'list';
|
|
11
|
+
const describe = (0, lang_1.i18n)(`commands.secret.subcommands.list.describe`);
|
|
16
12
|
async function handler(args) {
|
|
17
13
|
const { derivedAccountId } = args;
|
|
18
14
|
(0, usageTracking_1.trackCommandUsage)('secrets-list', {}, derivedAccountId);
|
|
19
15
|
try {
|
|
20
16
|
const { data: { results }, } = await (0, secrets_1.fetchSecrets)(derivedAccountId);
|
|
21
|
-
const groupLabel = (0, lang_1.i18n)(
|
|
17
|
+
const groupLabel = (0, lang_1.i18n)(`commands.secret.subcommands.list.groupLabel`, {
|
|
22
18
|
accountIdentifier: (0, ui_1.uiAccountDescription)(derivedAccountId),
|
|
23
19
|
});
|
|
24
20
|
logger_1.logger.group(groupLabel);
|
|
@@ -26,16 +22,26 @@ async function handler(args) {
|
|
|
26
22
|
logger_1.logger.groupEnd();
|
|
27
23
|
}
|
|
28
24
|
catch (err) {
|
|
29
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
25
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.secret.subcommands.list.errors.list`));
|
|
30
26
|
(0, index_1.logError)(err, new index_1.ApiErrorContext({
|
|
31
27
|
request: 'add secret',
|
|
32
28
|
accountId: derivedAccountId,
|
|
33
29
|
}));
|
|
34
30
|
}
|
|
35
31
|
}
|
|
36
|
-
function
|
|
37
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
38
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
39
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
32
|
+
function listSecretBuilder(yargs) {
|
|
40
33
|
return yargs;
|
|
41
34
|
}
|
|
35
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(listSecretBuilder, command, describe, {
|
|
36
|
+
useGlobalOptions: true,
|
|
37
|
+
useConfigOptions: true,
|
|
38
|
+
useAccountOptions: true,
|
|
39
|
+
useEnvironmentOptions: true,
|
|
40
|
+
});
|
|
41
|
+
const listSecretCommand = {
|
|
42
|
+
command,
|
|
43
|
+
describe,
|
|
44
|
+
handler,
|
|
45
|
+
builder,
|
|
46
|
+
};
|
|
47
|
+
exports.default = listSecretCommand;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "update [name]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type UpdateSecretArgs = CommonArgs & CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type UpdateSecretArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
name?: string;
|
|
8
4
|
};
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
5
|
+
declare const updateSecretCommand: YargsCommandModule<unknown, UpdateSecretArgs>;
|
|
6
|
+
export default updateSecretCommand;
|
|
@@ -1,20 +1,16 @@
|
|
|
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 secrets_1 = require("@hubspot/local-dev-lib/api/secrets");
|
|
7
4
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
8
5
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
9
6
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
10
7
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
11
8
|
const ui_1 = require("../../lib/ui");
|
|
12
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
13
9
|
const secretPrompt_1 = require("../../lib/prompts/secretPrompt");
|
|
14
10
|
const lang_1 = require("../../lib/lang");
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
12
|
+
const command = 'update [name]';
|
|
13
|
+
const describe = (0, lang_1.i18n)(`commands.secret.subcommands.update.describe`);
|
|
18
14
|
async function handler(args) {
|
|
19
15
|
const { name, derivedAccountId } = args;
|
|
20
16
|
let secretName = name;
|
|
@@ -22,23 +18,25 @@ async function handler(args) {
|
|
|
22
18
|
try {
|
|
23
19
|
const { data: { results: secrets }, } = await (0, secrets_1.fetchSecrets)(derivedAccountId);
|
|
24
20
|
if (secretName && !secrets.includes(secretName)) {
|
|
25
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
21
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.secret.subcommands.update.errors.noSecret`, {
|
|
22
|
+
secretName,
|
|
23
|
+
}));
|
|
26
24
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
27
25
|
}
|
|
28
26
|
if (!secretName) {
|
|
29
|
-
const { secretToModify } = await (0, secretPrompt_1.secretListPrompt)(secrets, (0, lang_1.i18n)(
|
|
27
|
+
const { secretToModify } = await (0, secretPrompt_1.secretListPrompt)(secrets, (0, lang_1.i18n)(`commands.secret.subcommands.update.selectSecret`));
|
|
30
28
|
secretName = secretToModify;
|
|
31
29
|
}
|
|
32
30
|
const { secretValue } = await (0, secretPrompt_1.secretValuePrompt)();
|
|
33
31
|
await (0, secrets_1.updateSecret)(derivedAccountId, secretName, secretValue);
|
|
34
|
-
logger_1.logger.success((0, lang_1.i18n)(
|
|
32
|
+
logger_1.logger.success((0, lang_1.i18n)(`commands.secret.subcommands.update.success.update`, {
|
|
35
33
|
accountIdentifier: (0, ui_1.uiAccountDescription)(derivedAccountId),
|
|
36
34
|
secretName,
|
|
37
35
|
}));
|
|
38
|
-
logger_1.logger.log((0, lang_1.i18n)(
|
|
36
|
+
logger_1.logger.log((0, lang_1.i18n)(`commands.secret.subcommands.update.success.updateExplanation`));
|
|
39
37
|
}
|
|
40
38
|
catch (err) {
|
|
41
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
39
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.secret.subcommands.update.errors.update`, {
|
|
42
40
|
secretName: secretName || '',
|
|
43
41
|
}));
|
|
44
42
|
(0, index_1.logError)(err, new index_1.ApiErrorContext({
|
|
@@ -47,13 +45,23 @@ async function handler(args) {
|
|
|
47
45
|
}));
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
|
-
function
|
|
51
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
52
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
53
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
48
|
+
function updateSecretBuilder(yargs) {
|
|
54
49
|
yargs.positional('name', {
|
|
55
|
-
describe: (0, lang_1.i18n)(
|
|
50
|
+
describe: (0, lang_1.i18n)(`commands.secret.subcommands.update.positionals.name.describe`),
|
|
56
51
|
type: 'string',
|
|
57
52
|
});
|
|
58
53
|
return yargs;
|
|
59
54
|
}
|
|
55
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(updateSecretBuilder, command, describe, {
|
|
56
|
+
useGlobalOptions: true,
|
|
57
|
+
useConfigOptions: true,
|
|
58
|
+
useAccountOptions: true,
|
|
59
|
+
useEnvironmentOptions: true,
|
|
60
|
+
});
|
|
61
|
+
const updateSecretCommand = {
|
|
62
|
+
command,
|
|
63
|
+
describe,
|
|
64
|
+
handler,
|
|
65
|
+
builder,
|
|
66
|
+
};
|
|
67
|
+
exports.default = updateSecretCommand;
|
package/commands/secret.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 secretCommand: YargsCommandModuleBucket;
|
|
3
|
+
export default secretCommand;
|
package/commands/secret.js
CHANGED
|
@@ -1,56 +1,30 @@
|
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const listSecretCommand = __importStar(require("./secret/listSecret"));
|
|
41
|
-
const deleteSecretCommand = __importStar(require("./secret/deleteSecret"));
|
|
42
|
-
const updateSecretCommand = __importStar(require("./secret/updateSecret"));
|
|
6
|
+
const addSecret_1 = __importDefault(require("./secret/addSecret"));
|
|
7
|
+
const listSecret_1 = __importDefault(require("./secret/listSecret"));
|
|
8
|
+
const deleteSecret_1 = __importDefault(require("./secret/deleteSecret"));
|
|
9
|
+
const updateSecret_1 = __importDefault(require("./secret/updateSecret"));
|
|
43
10
|
const lang_1 = require("../lib/lang");
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
function
|
|
48
|
-
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
11
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
12
|
+
const command = ['secret', 'secrets'];
|
|
13
|
+
const describe = (0, lang_1.i18n)(`commands.secret.describe`);
|
|
14
|
+
function secretBuilder(yargs) {
|
|
49
15
|
yargs
|
|
50
|
-
.command(
|
|
51
|
-
.command(
|
|
52
|
-
.command(
|
|
53
|
-
.command(
|
|
16
|
+
.command(listSecret_1.default)
|
|
17
|
+
.command(addSecret_1.default)
|
|
18
|
+
.command(updateSecret_1.default)
|
|
19
|
+
.command(deleteSecret_1.default)
|
|
54
20
|
.demandCommand(1, '');
|
|
55
21
|
return yargs;
|
|
56
22
|
}
|
|
23
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(secretBuilder, command, describe);
|
|
24
|
+
const secretCommand = {
|
|
25
|
+
command,
|
|
26
|
+
describe,
|
|
27
|
+
builder,
|
|
28
|
+
handler: () => { },
|
|
29
|
+
};
|
|
30
|
+
exports.default = secretCommand;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommonArgs } from '../../types/Yargs';
|
|
3
|
-
export declare const command = "generate-selectors <path>";
|
|
4
|
-
export declare const describe: string;
|
|
1
|
+
import { CommonArgs, YargsCommandModule } from '../../types/Yargs';
|
|
5
2
|
type ThemeSelectorArgs = CommonArgs & {
|
|
6
3
|
path: string;
|
|
7
4
|
};
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export {};
|
|
5
|
+
declare const themeSelectorsCommand: YargsCommandModule<unknown, ThemeSelectorArgs>;
|
|
6
|
+
export default themeSelectorsCommand;
|
|
@@ -3,14 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.describe = exports.command = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
|
-
exports.builder = builder;
|
|
9
6
|
const fs_1 = __importDefault(require("fs"));
|
|
10
|
-
const
|
|
11
|
-
const lang_1 = require("../../lib/lang");
|
|
7
|
+
const en_1 = require("../../lang/en");
|
|
12
8
|
const generateSelectors_1 = require("../../lib/generateSelectors");
|
|
13
9
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
10
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
11
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
14
12
|
const HUBL_EXPRESSION_REGEX = new RegExp(/{%\s*(.*)\s*%}/, 'g');
|
|
15
13
|
const HUBL_VARIABLE_NAME_REGEX = new RegExp(/{%\s*set\s*(\w*)/, 'i');
|
|
16
14
|
const HUBL_STATEMENT_REGEX = new RegExp(/{{\s*[\w.(,\d\-\s)|/~]*.*}}/, 'g');
|
|
@@ -20,14 +18,13 @@ const CSS_VARS_NAME_REGEX = new RegExp(/(--[\w.(,\d\-)]*)/, 'g');
|
|
|
20
18
|
const CSS_SELECTORS_REGEX = new RegExp(/([\s\w:.,\0-[\]]*){/, 'i');
|
|
21
19
|
const CSS_EXPRESSION_REGEX = new RegExp(/(?!\s)([^}])*(?![.#\s,>])[^}]*}/, 'g');
|
|
22
20
|
const THEME_PATH_REGEX = new RegExp(/=\s*.*(theme\.(\w|\.)*)/, 'i');
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
exports.describe = (0, lang_1.i18n)(`${i18nKey}.describe`);
|
|
21
|
+
const command = 'generate-selectors <path>';
|
|
22
|
+
const describe = en_1.commands.theme.subcommands.generateSelectors.describe;
|
|
26
23
|
async function handler(args) {
|
|
27
24
|
const { path } = args;
|
|
28
25
|
const fieldsJsonPath = (0, generateSelectors_1.findFieldsJsonPath)(path);
|
|
29
26
|
if (!fieldsJsonPath) {
|
|
30
|
-
logger_1.
|
|
27
|
+
logger_1.uiLogger.error(en_1.commands.theme.subcommands.generateSelectors.errors.fieldsNotFound);
|
|
31
28
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
32
29
|
}
|
|
33
30
|
let fieldsJson = JSON.parse(fs_1.default.readFileSync(fieldsJsonPath, 'utf-8'));
|
|
@@ -137,7 +134,7 @@ async function handler(args) {
|
|
|
137
134
|
return themeFieldsSelectorMap;
|
|
138
135
|
}, {});
|
|
139
136
|
if (!Object.keys(finalMap).length) {
|
|
140
|
-
logger_1.
|
|
137
|
+
logger_1.uiLogger.error(en_1.commands.theme.subcommands.generateSelectors.errors.noSelectorsFound);
|
|
141
138
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
142
139
|
}
|
|
143
140
|
Object.keys(finalMap).forEach(themeFieldKey => {
|
|
@@ -154,16 +151,23 @@ async function handler(args) {
|
|
|
154
151
|
const selectorsMap = (0, generateSelectors_1.generateSelectorsMap)(fieldsJson);
|
|
155
152
|
const selectorsPath = `${path}/editor-preview.json`;
|
|
156
153
|
fs_1.default.writeFileSync(selectorsPath, `${JSON.stringify({ selectors: selectorsMap }, null, 2)}\n`);
|
|
157
|
-
logger_1.
|
|
158
|
-
themePath: path,
|
|
159
|
-
selectorsPath,
|
|
160
|
-
}));
|
|
154
|
+
logger_1.uiLogger.success(en_1.commands.theme.subcommands.generateSelectors.success(path, selectorsPath));
|
|
161
155
|
}
|
|
162
|
-
function
|
|
156
|
+
function themeSelectorBuilder(yargs) {
|
|
163
157
|
yargs.positional('path', {
|
|
164
|
-
describe:
|
|
158
|
+
describe: en_1.commands.theme.subcommands.generateSelectors.positionals.path,
|
|
165
159
|
type: 'string',
|
|
166
160
|
required: true,
|
|
167
161
|
});
|
|
168
162
|
return yargs;
|
|
169
163
|
}
|
|
164
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themeSelectorBuilder, command, describe, {
|
|
165
|
+
useGlobalOptions: true,
|
|
166
|
+
});
|
|
167
|
+
const themeSelectorsCommand = {
|
|
168
|
+
command,
|
|
169
|
+
describe,
|
|
170
|
+
handler,
|
|
171
|
+
builder,
|
|
172
|
+
};
|
|
173
|
+
exports.default = themeSelectorsCommand;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "marketplace-validate <path>";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type ThemeValidateArgs = CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type ThemeValidateArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
path: string;
|
|
8
4
|
};
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
5
|
+
declare const themeValidateCommand: YargsCommandModule<unknown, ThemeValidateArgs>;
|
|
6
|
+
export default themeValidateCommand;
|
|
@@ -3,43 +3,47 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.describe = exports.command = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
|
-
exports.builder = builder;
|
|
9
6
|
const SpinniesManager_1 = __importDefault(require("../../lib/ui/SpinniesManager"));
|
|
10
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
11
7
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
12
8
|
const marketplaceValidate_1 = require("../../lib/marketplaceValidate");
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
const en_1 = require("../../lang/en");
|
|
10
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
11
|
+
const command = 'marketplace-validate <path>';
|
|
12
|
+
const describe = en_1.commands.theme.subcommands.marketplaceValidate.describe;
|
|
17
13
|
async function handler(args) {
|
|
18
14
|
const { path, derivedAccountId } = args;
|
|
19
15
|
(0, usageTracking_1.trackCommandUsage)('validate', {}, derivedAccountId);
|
|
20
16
|
SpinniesManager_1.default.init();
|
|
21
17
|
SpinniesManager_1.default.add('marketplaceValidation', {
|
|
22
|
-
text:
|
|
23
|
-
path,
|
|
24
|
-
}),
|
|
18
|
+
text: en_1.commands.theme.subcommands.marketplaceValidate.logs.validatingTheme(path),
|
|
25
19
|
});
|
|
26
20
|
const assetType = 'THEME';
|
|
27
21
|
const validationId = await (0, marketplaceValidate_1.kickOffValidation)(derivedAccountId, assetType, path);
|
|
28
22
|
await (0, marketplaceValidate_1.pollForValidationFinish)(derivedAccountId, validationId);
|
|
29
23
|
SpinniesManager_1.default.remove('marketplaceValidation');
|
|
30
24
|
const validationResults = await (0, marketplaceValidate_1.fetchValidationResults)(derivedAccountId, validationId);
|
|
31
|
-
(0, marketplaceValidate_1.processValidationErrors)(
|
|
32
|
-
(0, marketplaceValidate_1.displayValidationResults)(
|
|
25
|
+
(0, marketplaceValidate_1.processValidationErrors)(en_1.commands.theme.subcommands.marketplaceValidate.errors.invalidPath, validationResults);
|
|
26
|
+
(0, marketplaceValidate_1.displayValidationResults)(en_1.commands.theme.subcommands.marketplaceValidate.results, validationResults);
|
|
33
27
|
process.exit();
|
|
34
28
|
}
|
|
35
|
-
function
|
|
36
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
37
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
38
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
29
|
+
function themeValidateBuilder(yargs) {
|
|
39
30
|
yargs.positional('path', {
|
|
40
|
-
describe:
|
|
31
|
+
describe: en_1.commands.theme.subcommands.marketplaceValidate.positionals.path.describe,
|
|
41
32
|
type: 'string',
|
|
42
33
|
required: true,
|
|
43
34
|
});
|
|
44
35
|
return yargs;
|
|
45
36
|
}
|
|
37
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(themeValidateBuilder, command, describe, {
|
|
38
|
+
useGlobalOptions: true,
|
|
39
|
+
useConfigOptions: true,
|
|
40
|
+
useAccountOptions: true,
|
|
41
|
+
useEnvironmentOptions: true,
|
|
42
|
+
});
|
|
43
|
+
const themeValidateCommand = {
|
|
44
|
+
command,
|
|
45
|
+
describe,
|
|
46
|
+
handler,
|
|
47
|
+
builder,
|
|
48
|
+
};
|
|
49
|
+
exports.default = themeValidateCommand;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "preview [--src] [--dest]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs;
|
|
6
|
-
type ThemePreviewArgs = CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type ThemePreviewArgs = CommonArgs & ConfigArgs & AccountArgs & {
|
|
7
3
|
src: string;
|
|
8
4
|
dest: string;
|
|
9
5
|
notify: string;
|
|
@@ -12,6 +8,5 @@ type ThemePreviewArgs = CombinedArgs & {
|
|
|
12
8
|
resetSession?: boolean;
|
|
13
9
|
generateFieldsTypes?: boolean;
|
|
14
10
|
};
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
export {};
|
|
11
|
+
declare const themePreviewCommand: YargsCommandModule<unknown, ThemePreviewArgs>;
|
|
12
|
+
export default themePreviewCommand;
|