@hubspot/cli 7.5.11-experimental.0 → 7.7.0-experimental.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 +5 -6
- package/bin/hsmcp.d.ts +2 -0
- package/bin/hsmcp.js +13 -0
- package/commands/account/auth.d.ts +3 -7
- package/commands/account/auth.js +19 -9
- 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 +35 -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 +12 -8
- package/commands/auth.d.ts +3 -7
- package/commands/auth.js +12 -5
- 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 +24 -15
- package/commands/completion.d.ts +3 -1
- package/commands/completion.js +25 -12
- package/commands/config/migrate.d.ts +3 -7
- package/commands/config/migrate.js +25 -15
- 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 +20 -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 +64 -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 +20 -45
- package/commands/doctor.d.ts +6 -8
- package/commands/doctor.js +32 -21
- package/commands/feedback.d.ts +4 -1
- package/commands/feedback.js +40 -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 +20 -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 +24 -10
- 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.d.ts +3 -2
- package/commands/hubdb.js +23 -45
- package/commands/init.d.ts +3 -7
- package/commands/init.js +12 -5
- package/commands/lint.d.ts +6 -4
- package/commands/lint.js +44 -43
- package/commands/list.d.ts +3 -7
- package/commands/list.js +19 -11
- package/commands/logs.d.ts +10 -1
- package/commands/logs.js +53 -44
- package/commands/module/marketplace-validate.d.ts +6 -1
- package/commands/module/marketplace-validate.js +39 -27
- package/commands/module.d.ts +3 -1
- package/commands/module.js +22 -10
- package/commands/mv.d.ts +3 -7
- package/commands/mv.js +19 -11
- package/commands/open.d.ts +3 -7
- package/commands/open.js +19 -11
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/cloneApp.js +2 -2
- package/commands/project/create.js +3 -3
- package/commands/project/deploy.d.ts +1 -0
- package/commands/project/deploy.js +40 -12
- package/commands/project/dev/index.d.ts +1 -4
- package/commands/project/dev/index.js +48 -16
- package/commands/project/dev/unifiedFlow.d.ts +2 -1
- package/commands/project/dev/unifiedFlow.js +85 -30
- package/commands/project/migrate.d.ts +1 -0
- 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 +1 -0
- package/commands/project/upload.js +38 -8
- package/commands/project/validate.d.ts +4 -0
- package/commands/project/validate.js +53 -0
- package/commands/project.js +4 -0
- package/commands/remove.d.ts +3 -7
- package/commands/remove.js +19 -11
- 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 +20 -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 +25 -48
- package/commands/setupMcp.d.ts +8 -0
- package/commands/setupMcp.js +229 -0
- package/commands/theme/generate-selectors.d.ts +3 -7
- package/commands/theme/generate-selectors.js +14 -6
- package/commands/theme/marketplace-validate.d.ts +4 -9
- package/commands/theme/marketplace-validate.js +17 -10
- package/commands/theme/preview.d.ts +4 -9
- package/commands/theme/preview.js +16 -9
- package/commands/theme.d.ts +3 -4
- package/commands/theme.js +23 -46
- package/commands/upload.d.ts +12 -1
- package/commands/upload.js +118 -97
- package/commands/watch.d.ts +14 -1
- package/commands/watch.js +76 -65
- package/lang/en.d.ts +838 -574
- package/lang/en.js +630 -373
- package/lang/en.lyaml +30 -23
- package/lib/accountTypes.js +2 -1
- package/lib/app/migrate.d.ts +23 -0
- package/lib/app/migrate.js +14 -3
- 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/configMigrate.js +24 -10
- package/lib/configOptions.d.ts +4 -0
- package/lib/configOptions.js +41 -46
- package/lib/constants.d.ts +6 -0
- package/lib/constants.js +7 -1
- package/lib/dependencyManagement.d.ts +0 -5
- package/lib/dependencyManagement.js +13 -39
- package/lib/doctor/Doctor.js +2 -1
- package/lib/filesystem.d.ts +1 -1
- package/lib/interpolation.d.ts +2 -3
- package/lib/lang.d.ts +2 -3
- package/lib/middleware/autoUpdateMiddleware.d.ts +1 -0
- package/lib/middleware/autoUpdateMiddleware.js +89 -0
- package/lib/middleware/configMiddleware.js +8 -0
- package/lib/npm.d.ts +9 -0
- package/lib/npm.js +36 -0
- package/lib/projectProfiles.d.ts +6 -0
- package/lib/projectProfiles.js +65 -0
- package/lib/projects/buildAndDeploy.js +17 -2
- package/lib/projects/localDev/AppDevModeInterface.d.ts +26 -0
- package/lib/projects/localDev/AppDevModeInterface.js +156 -0
- package/lib/projects/localDev/DevServerManagerV2.d.ts +11 -22
- package/lib/projects/localDev/DevServerManagerV2.js +19 -15
- package/lib/projects/localDev/LocalDevLogger.d.ts +30 -0
- package/lib/projects/localDev/LocalDevLogger.js +158 -0
- package/lib/projects/localDev/LocalDevManager.js +12 -5
- package/lib/projects/localDev/LocalDevProcess.d.ts +27 -0
- package/lib/projects/localDev/LocalDevProcess.js +171 -0
- package/lib/projects/localDev/LocalDevState.d.ts +37 -0
- package/lib/projects/localDev/LocalDevState.js +78 -0
- package/lib/projects/localDev/LocalDevWatcher.d.ts +10 -0
- package/lib/projects/localDev/LocalDevWatcher.js +56 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +17 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +92 -0
- package/lib/projects/localDev/helpers.d.ts +3 -2
- package/lib/projects/localDev/helpers.js +32 -2
- package/lib/projects/upload.d.ts +2 -1
- package/lib/projects/upload.js +2 -2
- package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
- package/lib/prompts/createTemplatePrompt.d.ts +22 -4
- package/lib/prompts/installAppPrompt.d.ts +1 -0
- package/lib/prompts/installAppPrompt.js +35 -0
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +6 -6
- package/lib/prompts/promptUtils.d.ts +2 -1
- package/lib/prompts/promptUtils.js +2 -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/testUtils.d.ts +3 -3
- package/lib/testUtils.js +8 -9
- package/lib/ui/index.js +4 -1
- package/lib/upload.d.ts +1 -1
- package/lib/validation.js +4 -5
- package/lib/yargsUtils.d.ts +4 -0
- package/lib/yargsUtils.js +6 -0
- package/mcp-server/index.d.ts +1 -0
- package/mcp-server/index.js +17 -0
- package/mcp-server/mcpLoader.d.ts +5 -0
- package/mcp-server/mcpLoader.js +24 -0
- package/mcp-server/tools/ExplainProjectStructureTool.d.ts +33 -0
- package/mcp-server/tools/ExplainProjectStructureTool.js +266 -0
- package/mcp-server/tools/GenerateAppComponentTool.d.ts +99 -0
- package/mcp-server/tools/GenerateAppComponentTool.js +193 -0
- package/mcp-server/tools/GenerateCardComponentTool.d.ts +74 -0
- package/mcp-server/tools/GenerateCardComponentTool.js +146 -0
- package/mcp-server/tools/GenerateProjectConfigTool.d.ts +32 -0
- package/mcp-server/tools/GenerateProjectConfigTool.js +40 -0
- package/mcp-server/tools/HubSpotCLIHelper.d.ts +16 -0
- package/mcp-server/tools/HubSpotCLIHelper.js +74 -0
- package/mcp-server/tools/UploadProjectTool.d.ts +44 -0
- package/mcp-server/tools/UploadProjectTool.js +149 -0
- package/mcp-server/tools/ValidateProjectTool.d.ts +62 -0
- package/mcp-server/tools/ValidateProjectTool.js +315 -0
- package/package.json +13 -6
- package/types/Cms.d.ts +30 -0
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +24 -0
- package/types/LocalDev.js +2 -0
- package/types/Prompts.d.ts +0 -7
- package/types/Yargs.d.ts +8 -1
- 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
package/commands/account/use.js
CHANGED
|
@@ -1,16 +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 config_1 = require("@hubspot/local-dev-lib/config");
|
|
8
5
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
9
6
|
const lang_1 = require("../../lib/lang");
|
|
10
7
|
const accountsPrompt_1 = require("../../lib/prompts/accountsPrompt");
|
|
11
8
|
const ui_1 = require("../../lib/ui");
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
10
|
+
const command = 'use [account]';
|
|
11
|
+
const describe = (0, lang_1.i18n)('commands.account.subcommands.use.describe');
|
|
14
12
|
async function handler(args) {
|
|
15
13
|
let newDefaultAccount = args.account;
|
|
16
14
|
if (!newDefaultAccount) {
|
|
@@ -41,7 +39,7 @@ async function handler(args) {
|
|
|
41
39
|
accountName: newDefaultAccount,
|
|
42
40
|
}));
|
|
43
41
|
}
|
|
44
|
-
function
|
|
42
|
+
function accountUseBuilder(yargs) {
|
|
45
43
|
yargs.positional('account', {
|
|
46
44
|
describe: (0, lang_1.i18n)('commands.account.subcommands.use.options.account.describe'),
|
|
47
45
|
type: 'string',
|
|
@@ -62,3 +60,13 @@ function builder(yargs) {
|
|
|
62
60
|
]);
|
|
63
61
|
return yargs;
|
|
64
62
|
}
|
|
63
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(accountUseBuilder, command, describe, {
|
|
64
|
+
useGlobalOptions: true,
|
|
65
|
+
});
|
|
66
|
+
const accountUseCommand = {
|
|
67
|
+
command,
|
|
68
|
+
describe,
|
|
69
|
+
handler,
|
|
70
|
+
builder,
|
|
71
|
+
};
|
|
72
|
+
exports.default = accountUseCommand;
|
package/commands/account.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 accountCommand: YargsCommandModuleBucket;
|
|
3
|
+
export default accountCommand;
|
package/commands/account.js
CHANGED
|
@@ -1,65 +1,42 @@
|
|
|
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
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
7
|
+
const auth_1 = __importDefault(require("./account/auth"));
|
|
8
|
+
const list_1 = __importDefault(require("./account/list"));
|
|
9
|
+
const rename_1 = __importDefault(require("./account/rename"));
|
|
10
|
+
const use_1 = __importDefault(require("./account/use"));
|
|
11
|
+
const info_1 = __importDefault(require("./account/info"));
|
|
12
|
+
const remove_1 = __importDefault(require("./account/remove"));
|
|
13
|
+
const clean_1 = __importDefault(require("./account/clean"));
|
|
14
|
+
const createOverride_1 = __importDefault(require("./account/createOverride"));
|
|
15
|
+
const removeOverride_1 = __importDefault(require("./account/removeOverride"));
|
|
16
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
17
|
+
const command = ['account', 'accounts'];
|
|
18
|
+
const describe = (0, lang_1.i18n)('commands.account.describe');
|
|
19
|
+
function accountBuilder(yargs) {
|
|
53
20
|
yargs
|
|
54
|
-
.command(
|
|
55
|
-
.command(
|
|
56
|
-
.command(
|
|
57
|
-
.command(
|
|
58
|
-
.command(
|
|
59
|
-
.command(
|
|
60
|
-
.command(
|
|
61
|
-
.command(
|
|
62
|
-
.command(
|
|
21
|
+
.command(auth_1.default)
|
|
22
|
+
.command(list_1.default)
|
|
23
|
+
.command(rename_1.default)
|
|
24
|
+
.command(use_1.default)
|
|
25
|
+
.command(info_1.default)
|
|
26
|
+
.command(remove_1.default)
|
|
27
|
+
.command(clean_1.default)
|
|
28
|
+
.command(createOverride_1.default)
|
|
29
|
+
.command(removeOverride_1.default)
|
|
63
30
|
.demandCommand(1, '');
|
|
64
31
|
return yargs;
|
|
65
32
|
}
|
|
33
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(accountBuilder, command, describe);
|
|
34
|
+
const accountCommand = {
|
|
35
|
+
command,
|
|
36
|
+
describe,
|
|
37
|
+
builder,
|
|
38
|
+
handler: () => { },
|
|
39
|
+
};
|
|
40
|
+
exports.default = accountCommand;
|
|
41
|
+
// TODO Remove this legacy export once we've migrated all commands to TS
|
|
42
|
+
module.exports = accountCommand;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ArgumentsCamelCase } from 'yargs';
|
|
2
2
|
import { YargsCommandModule } from '../../types/Yargs';
|
|
3
3
|
import { MigrateAppArgs } from '../../lib/app/migrate';
|
|
4
|
-
export declare function handlerGenerator(commandTrackingName: string): (
|
|
5
|
-
export declare const handler: (options: ArgumentsCamelCase<MigrateAppArgs>) => Promise<void>;
|
|
4
|
+
export declare function handlerGenerator(commandTrackingName: string): (args: ArgumentsCamelCase<MigrateAppArgs>) => Promise<void>;
|
|
6
5
|
declare const migrateCommand: YargsCommandModule<unknown, MigrateAppArgs>;
|
|
7
6
|
export default migrateCommand;
|
package/commands/app/migrate.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handler = void 0;
|
|
4
3
|
exports.handlerGenerator = handlerGenerator;
|
|
5
4
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
6
5
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
@@ -18,8 +17,8 @@ const { v2023_2, v2025_2 } = projects_1.PLATFORM_VERSIONS;
|
|
|
18
17
|
const command = 'migrate';
|
|
19
18
|
const describe = undefined; // uiBetaTag(i18n(`commands.project.subcommands.migrateApp.header.text.describe`), false);
|
|
20
19
|
function handlerGenerator(commandTrackingName) {
|
|
21
|
-
return async function handler(
|
|
22
|
-
const { derivedAccountId, platformVersion, unstable } =
|
|
20
|
+
return async function handler(args) {
|
|
21
|
+
const { derivedAccountId, platformVersion, unstable } = args;
|
|
23
22
|
await (0, usageTracking_1.trackCommandUsage)(commandTrackingName, {}, derivedAccountId);
|
|
24
23
|
const accountConfig = (0, config_1.getAccountConfig)(derivedAccountId);
|
|
25
24
|
if (!accountConfig) {
|
|
@@ -36,13 +35,13 @@ function handlerGenerator(commandTrackingName) {
|
|
|
36
35
|
logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.migrateApp.errors.notAllowedWithinProject`, { command: (0, ui_1.uiCommandReference)('hs project migrate') }));
|
|
37
36
|
return process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
38
37
|
}
|
|
39
|
-
|
|
38
|
+
args.platformVersion = unstable
|
|
40
39
|
? projects_1.PLATFORM_VERSIONS.unstable
|
|
41
40
|
: platformVersion;
|
|
42
|
-
await (0, migrate_1.migrateApp2025_2)(derivedAccountId,
|
|
41
|
+
await (0, migrate_1.migrateApp2025_2)(derivedAccountId, args);
|
|
43
42
|
}
|
|
44
43
|
else {
|
|
45
|
-
await (0, migrate_legacy_1.migrateApp2023_2)(derivedAccountId,
|
|
44
|
+
await (0, migrate_legacy_1.migrateApp2023_2)(derivedAccountId, args, accountConfig);
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
catch (error) {
|
|
@@ -62,7 +61,7 @@ function handlerGenerator(commandTrackingName) {
|
|
|
62
61
|
return process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
63
62
|
};
|
|
64
63
|
}
|
|
65
|
-
|
|
64
|
+
const handler = handlerGenerator('app-migrate');
|
|
66
65
|
function appMigrateBuilder(yargs) {
|
|
67
66
|
yargs.options({
|
|
68
67
|
name: {
|
|
@@ -106,7 +105,7 @@ const builder = (0, yargsUtils_1.makeYargsBuilder)(appMigrateBuilder, command, (
|
|
|
106
105
|
const migrateCommand = {
|
|
107
106
|
command,
|
|
108
107
|
describe,
|
|
109
|
-
handler
|
|
108
|
+
handler,
|
|
110
109
|
builder,
|
|
111
110
|
};
|
|
112
111
|
exports.default = migrateCommand;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../../types/Yargs';
|
|
2
|
+
type AddAppSecretArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
|
+
name?: string;
|
|
4
|
+
app?: number;
|
|
5
|
+
};
|
|
6
|
+
declare const addAppSecretCommand: YargsCommandModule<unknown, AddAppSecretArgs>;
|
|
7
|
+
export default addAppSecretCommand;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devSecrets_1 = require("@hubspot/local-dev-lib/api/devSecrets");
|
|
4
|
+
const index_1 = require("../../../lib/errorHandlers/index");
|
|
5
|
+
const usageTracking_1 = require("../../../lib/usageTracking");
|
|
6
|
+
const secretPrompt_1 = require("../../../lib/prompts/secretPrompt");
|
|
7
|
+
const selectAppPrompt_1 = require("../../../lib/prompts/selectAppPrompt");
|
|
8
|
+
const en_1 = require("../../../lang/en");
|
|
9
|
+
const exitCodes_1 = require("../../../lib/enums/exitCodes");
|
|
10
|
+
const yargsUtils_1 = require("../../../lib/yargsUtils");
|
|
11
|
+
const logger_1 = require("../../../lib/ui/logger");
|
|
12
|
+
const command = 'add [name]';
|
|
13
|
+
const describe = en_1.commands.app.subcommands.secret.subcommands.add.describe;
|
|
14
|
+
async function handler(args) {
|
|
15
|
+
const { derivedAccountId } = args;
|
|
16
|
+
(0, usageTracking_1.trackCommandUsage)('app-secret-add', {}, derivedAccountId);
|
|
17
|
+
const appSecretApp = await (0, selectAppPrompt_1.selectAppPrompt)(derivedAccountId, args.app);
|
|
18
|
+
if (!appSecretApp) {
|
|
19
|
+
logger_1.uiLogger.log('');
|
|
20
|
+
logger_1.uiLogger.log(en_1.commands.app.subcommands.secret.subcommands.add.errors.noApps);
|
|
21
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
22
|
+
}
|
|
23
|
+
let appSecretName = args.name;
|
|
24
|
+
if (!appSecretName) {
|
|
25
|
+
const { secretName: name } = await (0, secretPrompt_1.secretNamePrompt)();
|
|
26
|
+
appSecretName = name;
|
|
27
|
+
}
|
|
28
|
+
const { secretValue } = await (0, secretPrompt_1.secretValuePrompt)();
|
|
29
|
+
try {
|
|
30
|
+
await (0, devSecrets_1.addAppSecret)(derivedAccountId, appSecretApp.id, appSecretName, secretValue);
|
|
31
|
+
logger_1.uiLogger.log('');
|
|
32
|
+
logger_1.uiLogger.success(en_1.commands.app.subcommands.secret.subcommands.add.success(appSecretApp.name, appSecretName));
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
(0, index_1.logError)(err);
|
|
36
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
37
|
+
}
|
|
38
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
39
|
+
}
|
|
40
|
+
function addAppSecretBuilder(yargs) {
|
|
41
|
+
yargs.positional('name', {
|
|
42
|
+
describe: en_1.commands.app.subcommands.secret.subcommands.add.positionals.name,
|
|
43
|
+
type: 'string',
|
|
44
|
+
});
|
|
45
|
+
yargs.option('app', {
|
|
46
|
+
describe: en_1.commands.app.subcommands.secret.subcommands.add.options.app,
|
|
47
|
+
type: 'number',
|
|
48
|
+
});
|
|
49
|
+
yargs.example('add my-secret --app=1234567890', en_1.commands.app.subcommands.secret.subcommands.add.example);
|
|
50
|
+
return yargs;
|
|
51
|
+
}
|
|
52
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(addAppSecretBuilder, command, describe, {
|
|
53
|
+
useGlobalOptions: true,
|
|
54
|
+
useAccountOptions: true,
|
|
55
|
+
useConfigOptions: true,
|
|
56
|
+
useEnvironmentOptions: true,
|
|
57
|
+
});
|
|
58
|
+
const addAppSecretCommand = {
|
|
59
|
+
command,
|
|
60
|
+
describe,
|
|
61
|
+
handler,
|
|
62
|
+
builder,
|
|
63
|
+
};
|
|
64
|
+
exports.default = addAppSecretCommand;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../../types/Yargs';
|
|
2
|
+
type DeleteAppSecretArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
|
+
name?: string;
|
|
4
|
+
app?: number;
|
|
5
|
+
force?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const deleteAppSecretCommand: YargsCommandModule<unknown, DeleteAppSecretArgs>;
|
|
8
|
+
export default deleteAppSecretCommand;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devSecrets_1 = require("@hubspot/local-dev-lib/api/devSecrets");
|
|
4
|
+
const index_1 = require("../../../lib/errorHandlers/index");
|
|
5
|
+
const usageTracking_1 = require("../../../lib/usageTracking");
|
|
6
|
+
const promptUtils_1 = require("../../../lib/prompts/promptUtils");
|
|
7
|
+
const selectAppPrompt_1 = require("../../../lib/prompts/selectAppPrompt");
|
|
8
|
+
const en_1 = require("../../../lang/en");
|
|
9
|
+
const exitCodes_1 = require("../../../lib/enums/exitCodes");
|
|
10
|
+
const yargsUtils_1 = require("../../../lib/yargsUtils");
|
|
11
|
+
const logger_1 = require("../../../lib/ui/logger");
|
|
12
|
+
const command = 'delete [name]';
|
|
13
|
+
const describe = en_1.commands.app.subcommands.secret.subcommands.delete.describe;
|
|
14
|
+
async function handler(args) {
|
|
15
|
+
const { derivedAccountId, force } = args;
|
|
16
|
+
(0, usageTracking_1.trackCommandUsage)('app-secret-delete', {}, derivedAccountId);
|
|
17
|
+
const appSecretApp = await (0, selectAppPrompt_1.selectAppPrompt)(derivedAccountId, args.app);
|
|
18
|
+
if (!appSecretApp) {
|
|
19
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
20
|
+
}
|
|
21
|
+
let appSecretToDelete = args.name;
|
|
22
|
+
if (!appSecretToDelete) {
|
|
23
|
+
let appSecrets = [];
|
|
24
|
+
try {
|
|
25
|
+
const { data: secrets } = await (0, devSecrets_1.fetchAppSecrets)(derivedAccountId, appSecretApp.id);
|
|
26
|
+
if (secrets.secretKeys.length > 0) {
|
|
27
|
+
appSecrets = secrets.secretKeys.map(secret => secret.secretKey);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
(0, index_1.logError)(err);
|
|
32
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
33
|
+
}
|
|
34
|
+
if (appSecrets.length === 0) {
|
|
35
|
+
logger_1.uiLogger.error(en_1.commands.app.subcommands.secret.subcommands.delete.errors.noSecrets);
|
|
36
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
37
|
+
}
|
|
38
|
+
appSecretToDelete = await (0, promptUtils_1.listPrompt)(en_1.commands.app.subcommands.secret.subcommands.delete.selectSecret, { choices: appSecrets });
|
|
39
|
+
}
|
|
40
|
+
const confirmDelete = force ||
|
|
41
|
+
(await (0, promptUtils_1.confirmPrompt)(en_1.commands.app.subcommands.secret.subcommands.delete.confirmDelete(appSecretApp.name, appSecretToDelete), {
|
|
42
|
+
defaultAnswer: false,
|
|
43
|
+
}));
|
|
44
|
+
if (!confirmDelete) {
|
|
45
|
+
logger_1.uiLogger.log(en_1.commands.app.subcommands.secret.subcommands.delete.deleteCanceled);
|
|
46
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
await (0, devSecrets_1.deleteAppSecret)(derivedAccountId, appSecretApp.id, appSecretToDelete);
|
|
50
|
+
logger_1.uiLogger.log('');
|
|
51
|
+
logger_1.uiLogger.success(en_1.commands.app.subcommands.secret.subcommands.delete.success(appSecretApp.name, appSecretToDelete));
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
(0, index_1.logError)(err);
|
|
55
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
56
|
+
}
|
|
57
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
58
|
+
}
|
|
59
|
+
function deleteAppSecretBuilder(yargs) {
|
|
60
|
+
yargs.positional('name', {
|
|
61
|
+
describe: en_1.commands.app.subcommands.secret.subcommands.delete.positionals.name,
|
|
62
|
+
type: 'string',
|
|
63
|
+
});
|
|
64
|
+
yargs.option('app', {
|
|
65
|
+
describe: en_1.commands.app.subcommands.secret.subcommands.delete.options.app,
|
|
66
|
+
type: 'number',
|
|
67
|
+
});
|
|
68
|
+
yargs.option('force', {
|
|
69
|
+
describe: en_1.commands.app.subcommands.secret.subcommands.delete.options.force,
|
|
70
|
+
type: 'boolean',
|
|
71
|
+
});
|
|
72
|
+
yargs.example('delete my-secret --app=1234567890', en_1.commands.app.subcommands.secret.subcommands.delete.example);
|
|
73
|
+
return yargs;
|
|
74
|
+
}
|
|
75
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(deleteAppSecretBuilder, command, describe, {
|
|
76
|
+
useGlobalOptions: true,
|
|
77
|
+
useAccountOptions: true,
|
|
78
|
+
useConfigOptions: true,
|
|
79
|
+
useEnvironmentOptions: true,
|
|
80
|
+
});
|
|
81
|
+
const deleteAppSecretCommand = {
|
|
82
|
+
command,
|
|
83
|
+
describe,
|
|
84
|
+
handler,
|
|
85
|
+
builder,
|
|
86
|
+
};
|
|
87
|
+
exports.default = deleteAppSecretCommand;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../../types/Yargs';
|
|
2
|
+
type ListAppSecretArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
|
+
app?: number;
|
|
4
|
+
};
|
|
5
|
+
declare const listAppSecretCommand: YargsCommandModule<unknown, ListAppSecretArgs>;
|
|
6
|
+
export default listAppSecretCommand;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devSecrets_1 = require("@hubspot/local-dev-lib/api/devSecrets");
|
|
4
|
+
const index_1 = require("../../../lib/errorHandlers/index");
|
|
5
|
+
const usageTracking_1 = require("../../../lib/usageTracking");
|
|
6
|
+
const en_1 = require("../../../lang/en");
|
|
7
|
+
const exitCodes_1 = require("../../../lib/enums/exitCodes");
|
|
8
|
+
const yargsUtils_1 = require("../../../lib/yargsUtils");
|
|
9
|
+
const selectAppPrompt_1 = require("../../../lib/prompts/selectAppPrompt");
|
|
10
|
+
const logger_1 = require("../../../lib/ui/logger");
|
|
11
|
+
const command = 'list';
|
|
12
|
+
const describe = en_1.commands.app.subcommands.secret.subcommands.list.describe;
|
|
13
|
+
async function handler(args) {
|
|
14
|
+
const { derivedAccountId } = args;
|
|
15
|
+
(0, usageTracking_1.trackCommandUsage)('app-secret-list', {}, derivedAccountId);
|
|
16
|
+
const appSecretApp = await (0, selectAppPrompt_1.selectAppPrompt)(derivedAccountId, args.app);
|
|
17
|
+
if (!appSecretApp) {
|
|
18
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
19
|
+
}
|
|
20
|
+
let appSecrets = [];
|
|
21
|
+
try {
|
|
22
|
+
const { data: secrets } = await (0, devSecrets_1.fetchAppSecrets)(derivedAccountId, appSecretApp.id);
|
|
23
|
+
if (secrets.secretKeys.length > 0) {
|
|
24
|
+
appSecrets = secrets.secretKeys.map(secret => secret.secretKey);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
(0, index_1.logError)(err);
|
|
29
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
30
|
+
}
|
|
31
|
+
if (appSecrets.length === 0) {
|
|
32
|
+
logger_1.uiLogger.log('');
|
|
33
|
+
logger_1.uiLogger.log(en_1.commands.app.subcommands.secret.subcommands.list.errors.noSecrets);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
logger_1.uiLogger.log('');
|
|
37
|
+
logger_1.uiLogger.log(en_1.commands.app.subcommands.secret.subcommands.list.success(appSecretApp.name));
|
|
38
|
+
appSecrets.forEach(secret => {
|
|
39
|
+
logger_1.uiLogger.log(`- ${secret}`);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
43
|
+
}
|
|
44
|
+
function listAppSecretBuilder(yargs) {
|
|
45
|
+
yargs.option('app', {
|
|
46
|
+
describe: en_1.commands.app.subcommands.secret.subcommands.list.options.app,
|
|
47
|
+
type: 'number',
|
|
48
|
+
});
|
|
49
|
+
yargs.example('list --app=1234567890', en_1.commands.app.subcommands.secret.subcommands.list.example);
|
|
50
|
+
return yargs;
|
|
51
|
+
}
|
|
52
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(listAppSecretBuilder, command, describe, {
|
|
53
|
+
useGlobalOptions: true,
|
|
54
|
+
useAccountOptions: true,
|
|
55
|
+
useConfigOptions: true,
|
|
56
|
+
useEnvironmentOptions: true,
|
|
57
|
+
});
|
|
58
|
+
const listAppSecretCommand = {
|
|
59
|
+
command,
|
|
60
|
+
describe,
|
|
61
|
+
handler,
|
|
62
|
+
builder,
|
|
63
|
+
};
|
|
64
|
+
exports.default = listAppSecretCommand;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../../types/Yargs';
|
|
2
|
+
type UpdateAppSecretArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
|
+
name?: string;
|
|
4
|
+
app?: number;
|
|
5
|
+
};
|
|
6
|
+
declare const updateAppSecretCommand: YargsCommandModule<unknown, UpdateAppSecretArgs>;
|
|
7
|
+
export default updateAppSecretCommand;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devSecrets_1 = require("@hubspot/local-dev-lib/api/devSecrets");
|
|
4
|
+
const index_1 = require("../../../lib/errorHandlers/index");
|
|
5
|
+
const usageTracking_1 = require("../../../lib/usageTracking");
|
|
6
|
+
const secretPrompt_1 = require("../../../lib/prompts/secretPrompt");
|
|
7
|
+
const selectAppPrompt_1 = require("../../../lib/prompts/selectAppPrompt");
|
|
8
|
+
const promptUtils_1 = require("../../../lib/prompts/promptUtils");
|
|
9
|
+
const en_1 = require("../../../lang/en");
|
|
10
|
+
const exitCodes_1 = require("../../../lib/enums/exitCodes");
|
|
11
|
+
const yargsUtils_1 = require("../../../lib/yargsUtils");
|
|
12
|
+
const logger_1 = require("../../../lib/ui/logger");
|
|
13
|
+
const command = 'update [name]';
|
|
14
|
+
const describe = en_1.commands.app.subcommands.secret.subcommands.update.describe;
|
|
15
|
+
async function handler(args) {
|
|
16
|
+
const { derivedAccountId } = args;
|
|
17
|
+
(0, usageTracking_1.trackCommandUsage)('app-secret-update', {}, derivedAccountId);
|
|
18
|
+
const appSecretApp = await (0, selectAppPrompt_1.selectAppPrompt)(derivedAccountId, args.app);
|
|
19
|
+
if (!appSecretApp) {
|
|
20
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
21
|
+
}
|
|
22
|
+
let appSecretToUpdate = args.name;
|
|
23
|
+
if (!appSecretToUpdate) {
|
|
24
|
+
let appSecrets = [];
|
|
25
|
+
try {
|
|
26
|
+
const { data: secrets } = await (0, devSecrets_1.fetchAppSecrets)(derivedAccountId, appSecretApp.id);
|
|
27
|
+
if (secrets.secretKeys.length > 0) {
|
|
28
|
+
appSecrets = secrets.secretKeys.map(secret => secret.secretKey);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
(0, index_1.logError)(err);
|
|
33
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
34
|
+
}
|
|
35
|
+
if (appSecrets.length === 0) {
|
|
36
|
+
logger_1.uiLogger.error(en_1.commands.app.subcommands.secret.subcommands.update.errors.noSecrets);
|
|
37
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
38
|
+
}
|
|
39
|
+
appSecretToUpdate = await (0, promptUtils_1.listPrompt)(en_1.commands.app.subcommands.secret.subcommands.update.selectSecret, { choices: appSecrets });
|
|
40
|
+
}
|
|
41
|
+
const { secretValue } = await (0, secretPrompt_1.secretValuePrompt)();
|
|
42
|
+
try {
|
|
43
|
+
await (0, devSecrets_1.updateAppSecret)(derivedAccountId, appSecretApp.id, appSecretToUpdate, secretValue);
|
|
44
|
+
logger_1.uiLogger.log('');
|
|
45
|
+
logger_1.uiLogger.success(en_1.commands.app.subcommands.secret.subcommands.update.success(appSecretApp.name, appSecretToUpdate));
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
(0, index_1.logError)(err);
|
|
49
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
50
|
+
}
|
|
51
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
52
|
+
}
|
|
53
|
+
function updateAppSecretBuilder(yargs) {
|
|
54
|
+
yargs.positional('name', {
|
|
55
|
+
describe: en_1.commands.app.subcommands.secret.subcommands.update.positionals.name,
|
|
56
|
+
type: 'string',
|
|
57
|
+
});
|
|
58
|
+
yargs.option('app', {
|
|
59
|
+
describe: en_1.commands.app.subcommands.secret.subcommands.update.options.app,
|
|
60
|
+
type: 'number',
|
|
61
|
+
});
|
|
62
|
+
yargs.example('update my-secret --app=1234567890', en_1.commands.app.subcommands.secret.subcommands.update.example);
|
|
63
|
+
return yargs;
|
|
64
|
+
}
|
|
65
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(updateAppSecretBuilder, command, describe, {
|
|
66
|
+
useGlobalOptions: true,
|
|
67
|
+
useAccountOptions: true,
|
|
68
|
+
useConfigOptions: true,
|
|
69
|
+
useEnvironmentOptions: true,
|
|
70
|
+
});
|
|
71
|
+
const updateAppSecretCommand = {
|
|
72
|
+
command,
|
|
73
|
+
describe,
|
|
74
|
+
handler,
|
|
75
|
+
builder,
|
|
76
|
+
};
|
|
77
|
+
exports.default = updateAppSecretCommand;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 en_1 = require("../../lang/en");
|
|
7
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
8
|
+
const add_1 = __importDefault(require("./secret/add"));
|
|
9
|
+
const delete_1 = __importDefault(require("./secret/delete"));
|
|
10
|
+
const list_1 = __importDefault(require("./secret/list"));
|
|
11
|
+
const update_1 = __importDefault(require("./secret/update"));
|
|
12
|
+
const command = ['secret', 'secrets'];
|
|
13
|
+
const describe = undefined; // commands.app.subcommands.secret.describe;
|
|
14
|
+
function appSecretBuilder(yargs) {
|
|
15
|
+
yargs
|
|
16
|
+
.command(add_1.default)
|
|
17
|
+
.command(delete_1.default)
|
|
18
|
+
.command(list_1.default)
|
|
19
|
+
.command(update_1.default)
|
|
20
|
+
.demandCommand(1, '');
|
|
21
|
+
return yargs;
|
|
22
|
+
}
|
|
23
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(appSecretBuilder, command, en_1.commands.app.subcommands.secret.describe);
|
|
24
|
+
const appSecretCommand = {
|
|
25
|
+
command,
|
|
26
|
+
describe,
|
|
27
|
+
builder,
|
|
28
|
+
handler: () => { },
|
|
29
|
+
};
|
|
30
|
+
exports.default = appSecretCommand;
|
package/commands/app.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const describe: undefined;
|
|
4
|
-
export declare function builder(yargs: Argv): Argv<{}>;
|
|
5
|
-
declare const appCommand: CommandModule;
|
|
1
|
+
import { YargsCommandModuleBucket } from '../types/Yargs';
|
|
2
|
+
declare const appCommand: YargsCommandModuleBucket;
|
|
6
3
|
export default appCommand;
|
package/commands/app.js
CHANGED
|
@@ -3,19 +3,23 @@ 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.builder = builder;
|
|
8
6
|
const migrate_1 = __importDefault(require("./app/migrate"));
|
|
9
|
-
|
|
7
|
+
const secret_1 = __importDefault(require("./app/secret"));
|
|
8
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
9
|
+
const command = ['app', 'apps'];
|
|
10
10
|
// Keep the command hidden for now
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
11
|
+
const describe = undefined;
|
|
12
|
+
function appBuilder(yargs) {
|
|
13
|
+
yargs.command(migrate_1.default).command(secret_1.default).demandCommand(1, '');
|
|
14
|
+
return yargs;
|
|
14
15
|
}
|
|
16
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(appBuilder, command, describe);
|
|
15
17
|
const appCommand = {
|
|
16
|
-
command
|
|
17
|
-
describe
|
|
18
|
+
command,
|
|
19
|
+
describe,
|
|
18
20
|
builder,
|
|
19
21
|
handler: () => { },
|
|
20
22
|
};
|
|
21
23
|
exports.default = appCommand;
|
|
24
|
+
// TODO Remove this legacy export once we've migrated all commands to TS
|
|
25
|
+
module.exports = appCommand;
|
package/commands/auth.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AccountArgs, CommonArgs, ConfigArgs, TestingArgs } from '../types/Yargs';
|
|
3
|
-
export declare const command = "auth";
|
|
4
|
-
export declare const describe: string;
|
|
1
|
+
import { AccountArgs, CommonArgs, ConfigArgs, TestingArgs, YargsCommandModule } from '../types/Yargs';
|
|
5
2
|
type AuthArgs = CommonArgs & ConfigArgs & TestingArgs & AccountArgs & {
|
|
6
3
|
authType?: string;
|
|
7
4
|
};
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export {};
|
|
5
|
+
declare const authCommand: YargsCommandModule<unknown, AuthArgs>;
|
|
6
|
+
export default authCommand;
|