@hubspot/cli 7.5.10-experimental.0 → 7.6.0-beta.0
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/bin/cli.js +102 -95
- package/commands/account/auth.d.ts +5 -7
- package/commands/account/auth.js +74 -87
- 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 +1 -2
- package/commands/app/migrate.js +7 -8
- 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 -8
- package/commands/auth.d.ts +5 -7
- package/commands/auth.js +30 -29
- 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 -15
- package/commands/completion.d.ts +3 -1
- package/commands/completion.js +23 -12
- 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 -74
- 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 +18 -45
- package/commands/doctor.d.ts +6 -8
- package/commands/doctor.js +30 -21
- package/commands/feedback.d.ts +4 -1
- package/commands/feedback.js +38 -47
- package/commands/fetch.d.ts +12 -1
- package/commands/fetch.js +49 -33
- 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 -41
- 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 -10
- 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 +17 -10
- package/commands/hubdb/create.d.ts +4 -9
- package/commands/hubdb/create.js +17 -10
- package/commands/hubdb/delete.d.ts +4 -9
- package/commands/hubdb/delete.js +17 -10
- package/commands/hubdb/fetch.d.ts +4 -9
- package/commands/hubdb/fetch.js +17 -10
- 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 +23 -45
- package/commands/init.d.ts +3 -7
- package/commands/init.js +17 -8
- package/commands/lint.d.ts +6 -4
- package/commands/lint.js +42 -43
- package/commands/list.d.ts +3 -7
- package/commands/list.js +17 -11
- package/commands/logs.d.ts +10 -1
- package/commands/logs.js +53 -44
- package/commands/mcp/setup.d.ts +7 -0
- package/commands/mcp/setup.js +52 -0
- package/commands/mcp/start.d.ts +3 -0
- package/commands/mcp/start.js +77 -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 -29
- package/commands/module.d.ts +3 -1
- package/commands/module.js +23 -10
- package/commands/mv.d.ts +3 -7
- package/commands/mv.js +17 -11
- package/commands/open.d.ts +3 -7
- package/commands/open.js +17 -11
- package/commands/project/add.d.ts +5 -2
- package/commands/project/add.js +43 -80
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/cloneApp.js +2 -2
- package/commands/project/create.d.ts +2 -8
- package/commands/project/create.js +84 -55
- package/commands/project/deploy.d.ts +2 -0
- package/commands/project/deploy.js +67 -13
- package/commands/project/dev/deprecatedFlow.d.ts +8 -2
- package/commands/project/dev/deprecatedFlow.js +9 -1
- package/commands/project/dev/index.d.ts +1 -4
- package/commands/project/dev/index.js +74 -72
- package/commands/project/dev/unifiedFlow.d.ts +10 -2
- package/commands/project/dev/unifiedFlow.js +74 -40
- package/commands/project/listBuilds.js +2 -5
- package/commands/project/migrate.d.ts +1 -0
- package/commands/project/migrate.js +7 -2
- package/commands/project/profile/add.js +102 -64
- package/commands/project/profile/delete.d.ts +6 -0
- package/commands/project/profile/{remove.js → delete.js} +38 -28
- package/commands/project/profile.js +2 -2
- package/commands/project/upload.js +5 -53
- package/commands/project/validate.d.ts +6 -0
- package/commands/project/validate.js +82 -0
- package/commands/project.js +2 -2
- package/commands/remove.d.ts +3 -7
- package/commands/remove.js +22 -22
- package/commands/sandbox/create.d.ts +4 -9
- package/commands/sandbox/create.js +18 -11
- package/commands/sandbox/delete.d.ts +4 -9
- package/commands/sandbox/delete.js +18 -11
- package/commands/sandbox.d.ts +3 -4
- package/commands/sandbox.js +18 -43
- package/commands/secret/addSecret.d.ts +4 -9
- package/commands/secret/addSecret.js +17 -10
- package/commands/secret/deleteSecret.d.ts +4 -9
- package/commands/secret/deleteSecret.js +17 -10
- package/commands/secret/listSecret.d.ts +4 -9
- package/commands/secret/listSecret.js +17 -10
- package/commands/secret/updateSecret.d.ts +4 -9
- package/commands/secret/updateSecret.js +17 -10
- package/commands/secret.d.ts +3 -4
- package/commands/secret.js +23 -48
- package/commands/testAccount/create.d.ts +6 -0
- package/commands/testAccount/create.js +100 -0
- package/commands/testAccount/createConfig.d.ts +10 -0
- package/commands/testAccount/createConfig.js +98 -0
- package/commands/testAccount/delete.d.ts +6 -0
- package/commands/testAccount/delete.js +48 -0
- package/commands/testAccount.d.ts +3 -0
- package/commands/testAccount.js +28 -0
- package/commands/theme/generate-selectors.d.ts +3 -7
- package/commands/theme/generate-selectors.js +20 -15
- package/commands/theme/marketplace-validate.d.ts +4 -9
- package/commands/theme/marketplace-validate.js +22 -17
- package/commands/theme/preview.d.ts +4 -9
- package/commands/theme/preview.js +32 -26
- package/commands/theme.d.ts +3 -4
- package/commands/theme.js +22 -47
- package/commands/upload.d.ts +12 -1
- package/commands/upload.js +116 -134
- package/commands/watch.d.ts +14 -1
- package/commands/watch.js +74 -75
- package/lang/en.d.ts +1092 -683
- package/lang/en.js +898 -494
- package/lang/en.lyaml +28 -225
- package/lib/accountTypes.js +1 -2
- package/lib/app/migrate.d.ts +23 -0
- package/lib/app/migrate.js +34 -12
- package/lib/app/migrate_legacy.js +7 -7
- package/lib/app/urls.d.ts +16 -0
- package/lib/app/urls.js +16 -0
- package/lib/commonOpts.d.ts +1 -3
- package/lib/commonOpts.js +1 -1
- package/lib/configMigrate.d.ts +2 -2
- package/lib/configMigrate.js +34 -55
- package/lib/configOptions.d.ts +4 -0
- package/lib/configOptions.js +41 -46
- package/lib/constants.d.ts +29 -0
- package/lib/constants.js +30 -1
- package/lib/dependencyManagement.d.ts +0 -5
- package/lib/dependencyManagement.js +13 -39
- package/lib/doctor/Doctor.js +3 -2
- package/lib/errorHandlers/index.js +7 -0
- package/lib/errorHandlers/suppressError.js +12 -19
- package/lib/filesystem.d.ts +1 -1
- package/lib/generateSelectors.js +3 -5
- 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/autoUpdateMiddleware.d.ts +1 -0
- package/lib/middleware/autoUpdateMiddleware.js +89 -0
- package/lib/middleware/configMiddleware.js +23 -0
- package/lib/middleware/fireAlarmMiddleware.d.ts +2 -2
- package/lib/middleware/fireAlarmMiddleware.js +12 -24
- package/lib/npm.d.ts +9 -0
- package/lib/npm.js +36 -0
- package/lib/projectProfiles.d.ts +7 -0
- package/lib/projectProfiles.js +83 -0
- 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 +18 -3
- package/lib/projects/components.d.ts +2 -0
- package/lib/projects/components.js +82 -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} +20 -11
- package/lib/projects/create/v3.d.ts +27 -0
- package/lib/projects/create/v3.js +158 -0
- package/lib/projects/localDev/AppDevModeInterface.d.ts +30 -0
- package/lib/projects/localDev/AppDevModeInterface.js +215 -0
- package/lib/projects/localDev/DevServerManager.js +4 -3
- package/lib/projects/localDev/DevServerManagerV2.d.ts +11 -22
- package/lib/projects/localDev/DevServerManagerV2.js +21 -17
- package/lib/projects/localDev/LocalDevLogger.d.ts +30 -0
- package/lib/projects/localDev/LocalDevLogger.js +159 -0
- package/lib/projects/localDev/LocalDevManager.js +12 -5
- 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/projects/localDev/helpers.d.ts +2 -1
- package/lib/projects/localDev/helpers.js +30 -1
- package/lib/projects/upload.d.ts +3 -0
- package/lib/projects/upload.js +59 -19
- package/lib/projects/urls.d.ts +3 -0
- package/lib/projects/urls.js +17 -1
- package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +17 -0
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +96 -0
- package/lib/prompts/createProjectPrompt.d.ts +14 -5
- package/lib/prompts/createProjectPrompt.js +38 -13
- package/lib/prompts/createTemplatePrompt.d.ts +22 -4
- package/lib/prompts/installAppPrompt.d.ts +2 -0
- package/lib/prompts/installAppPrompt.js +45 -0
- package/lib/prompts/personalAccessKeyPrompt.js +35 -24
- package/lib/prompts/projectAddPrompt.d.ts +5 -1
- package/lib/prompts/projectAddPrompt.js +35 -7
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +6 -6
- package/lib/prompts/promptUtils.d.ts +4 -1
- package/lib/prompts/promptUtils.js +5 -1
- package/lib/prompts/selectAppPrompt.d.ts +2 -0
- package/lib/prompts/selectAppPrompt.js +40 -0
- package/lib/prompts/{selectPublicAppPrompt.d.ts → selectPublicAppForMigrationPrompt.d.ts} +1 -1
- package/lib/prompts/{selectPublicAppPrompt.js → selectPublicAppForMigrationPrompt.js} +8 -8
- package/lib/prompts/setAsDefaultAccountPrompt.js +10 -0
- 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/index.js +4 -1
- package/lib/upload.d.ts +1 -1
- package/lib/yargsUtils.d.ts +4 -0
- 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 +24 -16
- 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 +7 -0
- package/commands/project/profile/remove.d.ts +0 -6
- package/lib/projects/create.d.ts +0 -5
- package/lib/projects/localDev/LocalDevManagerV2.d.ts +0 -64
- package/lib/projects/localDev/LocalDevManagerV2.js +0 -345
- package/lib/prompts/installPublicAppPrompt.d.ts +0 -1
- package/lib/prompts/installPublicAppPrompt.js +0 -41
|
@@ -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,10 +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
|
-
|
|
17
|
-
|
|
12
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
13
|
+
const command = 'delete [name]';
|
|
14
|
+
const describe = (0, lang_1.i18n)(`commands.secret.subcommands.delete.describe`);
|
|
18
15
|
async function handler(args) {
|
|
19
16
|
const { name, derivedAccountId, force } = args;
|
|
20
17
|
let secretName = name;
|
|
@@ -59,10 +56,7 @@ async function handler(args) {
|
|
|
59
56
|
}));
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
|
-
function
|
|
63
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
64
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
65
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
59
|
+
function deleteSecretBuilder(yargs) {
|
|
66
60
|
yargs
|
|
67
61
|
.positional('name', {
|
|
68
62
|
describe: (0, lang_1.i18n)(`commands.secret.subcommands.delete.positionals.name.describe`),
|
|
@@ -74,3 +68,16 @@ function builder(yargs) {
|
|
|
74
68
|
});
|
|
75
69
|
return yargs;
|
|
76
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,17 +1,14 @@
|
|
|
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
|
-
|
|
14
|
-
|
|
9
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
10
|
+
const command = 'list';
|
|
11
|
+
const describe = (0, lang_1.i18n)(`commands.secret.subcommands.list.describe`);
|
|
15
12
|
async function handler(args) {
|
|
16
13
|
const { derivedAccountId } = args;
|
|
17
14
|
(0, usageTracking_1.trackCommandUsage)('secrets-list', {}, derivedAccountId);
|
|
@@ -32,9 +29,19 @@ async function handler(args) {
|
|
|
32
29
|
}));
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
|
-
function
|
|
36
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
37
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
38
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
32
|
+
function listSecretBuilder(yargs) {
|
|
39
33
|
return yargs;
|
|
40
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,19 +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
|
-
|
|
16
|
-
|
|
11
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
12
|
+
const command = 'update [name]';
|
|
13
|
+
const describe = (0, lang_1.i18n)(`commands.secret.subcommands.update.describe`);
|
|
17
14
|
async function handler(args) {
|
|
18
15
|
const { name, derivedAccountId } = args;
|
|
19
16
|
let secretName = name;
|
|
@@ -48,13 +45,23 @@ async function handler(args) {
|
|
|
48
45
|
}));
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
|
-
function
|
|
52
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
53
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
54
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
48
|
+
function updateSecretBuilder(yargs) {
|
|
55
49
|
yargs.positional('name', {
|
|
56
50
|
describe: (0, lang_1.i18n)(`commands.secret.subcommands.update.positionals.name.describe`),
|
|
57
51
|
type: 'string',
|
|
58
52
|
});
|
|
59
53
|
return yargs;
|
|
60
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,55 +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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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) {
|
|
48
15
|
yargs
|
|
49
|
-
.command(
|
|
50
|
-
.command(
|
|
51
|
-
.command(
|
|
52
|
-
.command(
|
|
16
|
+
.command(listSecret_1.default)
|
|
17
|
+
.command(addSecret_1.default)
|
|
18
|
+
.command(updateSecret_1.default)
|
|
19
|
+
.command(deleteSecret_1.default)
|
|
53
20
|
.demandCommand(1, '');
|
|
54
21
|
return yargs;
|
|
55
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;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, TestingArgs, YargsCommandModule, EnvironmentArgs } from '../../types/Yargs';
|
|
2
|
+
type CreateTestAccountArgs = CommonArgs & AccountArgs & ConfigArgs & TestingArgs & EnvironmentArgs & {
|
|
3
|
+
configPath?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const createTestAccountCommand: YargsCommandModule<unknown, CreateTestAccountArgs>;
|
|
6
|
+
export default createTestAccountCommand;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const developerTestAccounts_1 = require("@hubspot/local-dev-lib/api/developerTestAccounts");
|
|
9
|
+
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
10
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
11
|
+
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
12
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
13
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
14
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
15
|
+
const validation_1 = require("../../lib/validation");
|
|
16
|
+
const en_1 = require("../../lang/en");
|
|
17
|
+
const createDeveloperTestAccountConfigPrompt_1 = require("../../lib/prompts/createDeveloperTestAccountConfigPrompt");
|
|
18
|
+
const command = 'create';
|
|
19
|
+
const describe = en_1.commands.testAccount.create.describe;
|
|
20
|
+
async function handler(args) {
|
|
21
|
+
const { derivedAccountId, configPath } = args;
|
|
22
|
+
(0, usageTracking_1.trackCommandUsage)('test-account-create', {}, derivedAccountId);
|
|
23
|
+
let accountConfigPath = configPath;
|
|
24
|
+
let testAccountConfig;
|
|
25
|
+
if (!accountConfigPath) {
|
|
26
|
+
const createTestAccountFromConfig = await (0, promptUtils_1.listPrompt)(en_1.commands.testAccount.create.createTestAccountFromConfigPrompt, {
|
|
27
|
+
choices: [
|
|
28
|
+
{
|
|
29
|
+
name: en_1.commands.testAccount.create.createFromConfigOption,
|
|
30
|
+
value: true,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: en_1.commands.testAccount.create.createFromScratchOption,
|
|
34
|
+
value: false,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
});
|
|
38
|
+
if (createTestAccountFromConfig) {
|
|
39
|
+
const configPathPromptResult = await (0, promptUtils_1.promptUser)({
|
|
40
|
+
name: 'configPath',
|
|
41
|
+
message: en_1.commands.testAccount.create.configPathPrompt,
|
|
42
|
+
type: 'input',
|
|
43
|
+
});
|
|
44
|
+
accountConfigPath = configPathPromptResult.configPath;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (accountConfigPath) {
|
|
48
|
+
const absoluteConfigPath = path_1.default.resolve((0, path_2.getCwd)(), accountConfigPath);
|
|
49
|
+
if (!(0, validation_1.fileExists)(absoluteConfigPath)) {
|
|
50
|
+
logger_1.uiLogger.error(en_1.commands.testAccount.create.errors.configFileNotFound(absoluteConfigPath));
|
|
51
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
testAccountConfig = JSON.parse(fs_extra_1.default.readFileSync(absoluteConfigPath, 'utf8'));
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
logger_1.uiLogger.error(en_1.commands.testAccount.create.errors.configFileParseFailed(absoluteConfigPath));
|
|
58
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
testAccountConfig = await (0, createDeveloperTestAccountConfigPrompt_1.createDeveloperTestAccountConfigPrompt)();
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
const { data } = await (0, developerTestAccounts_1.createDeveloperTestAccount)(derivedAccountId, testAccountConfig);
|
|
66
|
+
logger_1.uiLogger.success(en_1.commands.testAccount.create.success.configFileUpdated(testAccountConfig.accountName, data.id));
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
logger_1.uiLogger.error(en_1.commands.testAccount.create.errors.failedToCreate);
|
|
70
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
71
|
+
}
|
|
72
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
73
|
+
}
|
|
74
|
+
function createTestAccountBuilder(yargs) {
|
|
75
|
+
yargs.option('config-path', {
|
|
76
|
+
type: 'string',
|
|
77
|
+
description: en_1.commands.testAccount.create.options.configPath,
|
|
78
|
+
});
|
|
79
|
+
yargs.example([
|
|
80
|
+
[
|
|
81
|
+
'$0 create --config-path ./test-account-config.json',
|
|
82
|
+
en_1.commands.testAccount.create.example('./test-account-config.json'),
|
|
83
|
+
],
|
|
84
|
+
]);
|
|
85
|
+
return yargs;
|
|
86
|
+
}
|
|
87
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(createTestAccountBuilder, command, describe, {
|
|
88
|
+
useGlobalOptions: true,
|
|
89
|
+
useEnvironmentOptions: true,
|
|
90
|
+
useAccountOptions: true,
|
|
91
|
+
useConfigOptions: true,
|
|
92
|
+
useTestingOptions: true,
|
|
93
|
+
});
|
|
94
|
+
const createTestAccountCommand = {
|
|
95
|
+
command,
|
|
96
|
+
describe,
|
|
97
|
+
handler,
|
|
98
|
+
builder,
|
|
99
|
+
};
|
|
100
|
+
exports.default = createTestAccountCommand;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CommonArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
import { HubConfig } from '../../lib/prompts/createDeveloperTestAccountConfigPrompt';
|
|
3
|
+
type CreateTestAccountConfigArgs = CommonArgs & {
|
|
4
|
+
name?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
tiers?: HubConfig[];
|
|
7
|
+
path?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const createTestAccountConfigCommand: YargsCommandModule<unknown, CreateTestAccountConfigArgs>;
|
|
10
|
+
export default createTestAccountConfigCommand;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
9
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
10
|
+
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
11
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
12
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
13
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
14
|
+
const en_1 = require("../../lang/en");
|
|
15
|
+
const createDeveloperTestAccountConfigPrompt_1 = require("../../lib/prompts/createDeveloperTestAccountConfigPrompt");
|
|
16
|
+
const validation_1 = require("../../lib/validation");
|
|
17
|
+
const command = 'create-config';
|
|
18
|
+
const describe = en_1.commands.testAccount.createConfig.describe;
|
|
19
|
+
async function handler(args) {
|
|
20
|
+
const { derivedAccountId, name, tiers, description, path: configPath } = args;
|
|
21
|
+
(0, usageTracking_1.trackCommandUsage)('test-account-create-config', {}, derivedAccountId);
|
|
22
|
+
let accountConfigPath = configPath;
|
|
23
|
+
const testAccountConfig = await (0, createDeveloperTestAccountConfigPrompt_1.createDeveloperTestAccountConfigPrompt)({
|
|
24
|
+
name,
|
|
25
|
+
description,
|
|
26
|
+
tiers,
|
|
27
|
+
});
|
|
28
|
+
if (!accountConfigPath) {
|
|
29
|
+
const pathPromptResult = await (0, promptUtils_1.promptUser)({
|
|
30
|
+
name: 'path',
|
|
31
|
+
message: en_1.commands.testAccount.createConfig.pathPrompt,
|
|
32
|
+
type: 'input',
|
|
33
|
+
default: 'test-account-config.json',
|
|
34
|
+
validate: path => {
|
|
35
|
+
if (!path) {
|
|
36
|
+
return en_1.commands.testAccount.createConfig.errors.pathError;
|
|
37
|
+
}
|
|
38
|
+
else if (!path.endsWith('.json')) {
|
|
39
|
+
return en_1.commands.testAccount.createConfig.errors.pathFormatError;
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
accountConfigPath = pathPromptResult.path;
|
|
45
|
+
}
|
|
46
|
+
if (!accountConfigPath) {
|
|
47
|
+
logger_1.uiLogger.error(en_1.commands.testAccount.createConfig.errors.pathError);
|
|
48
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
49
|
+
}
|
|
50
|
+
if ((0, validation_1.fileExists)(accountConfigPath)) {
|
|
51
|
+
logger_1.uiLogger.error(en_1.commands.testAccount.createConfig.errors.pathExistsError);
|
|
52
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
fs_extra_1.default.writeFileSync(path_1.default.resolve((0, path_2.getCwd)(), accountConfigPath), JSON.stringify(testAccountConfig, null, 2), 'utf8');
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
logger_1.uiLogger.error(en_1.commands.testAccount.createConfig.errors.failedToCreate);
|
|
59
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
60
|
+
}
|
|
61
|
+
logger_1.uiLogger.success(en_1.commands.testAccount.createConfig.success.configFileCreated(accountConfigPath));
|
|
62
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
63
|
+
}
|
|
64
|
+
function createTestAccountConfigBuilder(yargs) {
|
|
65
|
+
yargs.option('name', {
|
|
66
|
+
type: 'string',
|
|
67
|
+
description: en_1.commands.testAccount.createConfig.options.name,
|
|
68
|
+
});
|
|
69
|
+
yargs.option('description', {
|
|
70
|
+
type: 'string',
|
|
71
|
+
description: en_1.commands.testAccount.createConfig.options.description,
|
|
72
|
+
});
|
|
73
|
+
yargs.option('tiers', {
|
|
74
|
+
type: 'array',
|
|
75
|
+
description: en_1.commands.testAccount.createConfig.options.tiers,
|
|
76
|
+
});
|
|
77
|
+
yargs.option('path', {
|
|
78
|
+
type: 'string',
|
|
79
|
+
description: en_1.commands.testAccount.createConfig.options.path,
|
|
80
|
+
});
|
|
81
|
+
yargs.example([
|
|
82
|
+
[
|
|
83
|
+
'$0 create-config --name my-account',
|
|
84
|
+
en_1.commands.testAccount.createConfig.example('my-account'),
|
|
85
|
+
],
|
|
86
|
+
]);
|
|
87
|
+
return yargs;
|
|
88
|
+
}
|
|
89
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(createTestAccountConfigBuilder, command, describe, {
|
|
90
|
+
useGlobalOptions: true,
|
|
91
|
+
});
|
|
92
|
+
const createTestAccountConfigCommand = {
|
|
93
|
+
command,
|
|
94
|
+
describe,
|
|
95
|
+
handler,
|
|
96
|
+
builder,
|
|
97
|
+
};
|
|
98
|
+
exports.default = createTestAccountConfigCommand;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, TestingArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type DeleteTestAccountArgs = CommonArgs & AccountArgs & ConfigArgs & TestingArgs & EnvironmentArgs & {
|
|
3
|
+
testAccountId: number;
|
|
4
|
+
};
|
|
5
|
+
declare const deleteTestAccountCommand: YargsCommandModule<unknown, DeleteTestAccountArgs>;
|
|
6
|
+
export default deleteTestAccountCommand;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const developerTestAccounts_1 = require("@hubspot/local-dev-lib/api/developerTestAccounts");
|
|
4
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
5
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
6
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
7
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
8
|
+
const en_1 = require("../../lang/en");
|
|
9
|
+
const command = 'delete <test-account-id>';
|
|
10
|
+
const describe = en_1.commands.testAccount.delete.describe;
|
|
11
|
+
async function handler(args) {
|
|
12
|
+
const { derivedAccountId, testAccountId } = args;
|
|
13
|
+
(0, usageTracking_1.trackCommandUsage)('test-account-delete', {}, derivedAccountId);
|
|
14
|
+
try {
|
|
15
|
+
await (0, developerTestAccounts_1.deleteDeveloperTestAccount)(derivedAccountId, testAccountId, true);
|
|
16
|
+
logger_1.uiLogger.success(en_1.commands.testAccount.delete.success.testAccountDeleted(testAccountId));
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
logger_1.uiLogger.error(en_1.commands.testAccount.delete.errors.failedToDelete);
|
|
20
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
21
|
+
}
|
|
22
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
23
|
+
}
|
|
24
|
+
function deleteTestAccountBuilder(yargs) {
|
|
25
|
+
yargs.positional('test-account-id', {
|
|
26
|
+
type: 'number',
|
|
27
|
+
description: en_1.commands.testAccount.delete.positionals.testAccountId,
|
|
28
|
+
required: true,
|
|
29
|
+
});
|
|
30
|
+
yargs.example([
|
|
31
|
+
['$0 delete 1234567890', en_1.commands.testAccount.delete.example(1234567890)],
|
|
32
|
+
]);
|
|
33
|
+
return yargs;
|
|
34
|
+
}
|
|
35
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(deleteTestAccountBuilder, command, describe, {
|
|
36
|
+
useGlobalOptions: true,
|
|
37
|
+
useEnvironmentOptions: true,
|
|
38
|
+
useAccountOptions: true,
|
|
39
|
+
useConfigOptions: true,
|
|
40
|
+
useTestingOptions: true,
|
|
41
|
+
});
|
|
42
|
+
const deleteTestAccountCommand = {
|
|
43
|
+
command,
|
|
44
|
+
describe,
|
|
45
|
+
handler,
|
|
46
|
+
builder,
|
|
47
|
+
};
|
|
48
|
+
exports.default = deleteTestAccountCommand;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const create_1 = __importDefault(require("./testAccount/create"));
|
|
7
|
+
const createConfig_1 = __importDefault(require("./testAccount/createConfig"));
|
|
8
|
+
const delete_1 = __importDefault(require("./testAccount/delete"));
|
|
9
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
10
|
+
const en_1 = require("../lang/en");
|
|
11
|
+
const command = ['test-account', 'test-accounts'];
|
|
12
|
+
const describe = undefined; //commands.testAccount.describe;
|
|
13
|
+
function testAccountBuilder(yargs) {
|
|
14
|
+
yargs
|
|
15
|
+
.command(create_1.default)
|
|
16
|
+
.command(createConfig_1.default)
|
|
17
|
+
.command(delete_1.default)
|
|
18
|
+
.demandCommand(1, '');
|
|
19
|
+
return yargs;
|
|
20
|
+
}
|
|
21
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(testAccountBuilder, command, en_1.commands.testAccount.describe);
|
|
22
|
+
const testAccountCommand = {
|
|
23
|
+
command,
|
|
24
|
+
describe,
|
|
25
|
+
builder,
|
|
26
|
+
handler: () => { },
|
|
27
|
+
};
|
|
28
|
+
exports.default = testAccountCommand;
|
|
@@ -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;
|