@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
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const { getIsInProject } = require('../../lib/projects/config');
|
|
3
|
+
const github_1 = require("@hubspot/local-dev-lib/github");
|
|
4
|
+
const config_1 = require("../../lib/projects/config");
|
|
6
5
|
const PROJECT_BOILERPLATE_BRANCH = 'cms-boilerplate-developer-projects';
|
|
7
|
-
|
|
6
|
+
const websiteThemeAssetType = {
|
|
7
|
+
hidden: false,
|
|
8
8
|
dest: ({ name, assetType }) => name || assetType,
|
|
9
|
-
execute: async ({ dest, assetType,
|
|
10
|
-
const isInProject = await getIsInProject(dest);
|
|
9
|
+
execute: async ({ dest, assetType, commandArgs }) => {
|
|
10
|
+
const isInProject = await (0, config_1.getIsInProject)(dest);
|
|
11
11
|
if (isInProject) {
|
|
12
|
-
|
|
12
|
+
commandArgs.branch = PROJECT_BOILERPLATE_BRANCH;
|
|
13
13
|
}
|
|
14
|
-
cloneGithubRepo('HubSpot/cms-theme-boilerplate', dest, {
|
|
14
|
+
await (0, github_1.cloneGithubRepo)('HubSpot/cms-theme-boilerplate', dest, {
|
|
15
|
+
...commandArgs,
|
|
15
16
|
type: assetType,
|
|
16
17
|
sourceDir: 'src',
|
|
17
|
-
...options,
|
|
18
18
|
});
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
|
+
exports.default = websiteThemeAssetType;
|
package/commands/create.d.ts
CHANGED
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* Note: No changes should be needed to this file when adding new types, unless you need new functionality
|
|
6
|
-
*
|
|
7
|
-
* @export {(Data) => String} dest - A function returning the destination of the asset we are creating
|
|
8
|
-
* @export {(Data) => Object=} execute - The code called once all other checks pass. This should contain the logic
|
|
9
|
-
* for handling your command. Optionally return an object containing KV pairs
|
|
10
|
-
* of any context or data you want passed along to usage tracking
|
|
11
|
-
* @export {Boolean=} hidden - If true, the command will not show up in --help
|
|
12
|
-
* @export {(Data) => Boolean=} validate - If provided, return true if it passes validation, false otherwise.
|
|
13
|
-
* If not provided, validation will automatically succeed
|
|
14
|
-
*
|
|
15
|
-
* The Data object contains
|
|
16
|
-
* {
|
|
17
|
-
* assetType: String - Type of the asset (e.g. api-sample, react-app, template)
|
|
18
|
-
* name: String - Filename of the asset
|
|
19
|
-
* dest: String - The path specified by the user on where to create the asset
|
|
20
|
-
* internal: Boolean - A flag for retrieving the internal spec for the asset type
|
|
21
|
-
* options: Object - The options object passed to the command by Yargs
|
|
22
|
-
* }
|
|
23
|
-
*/
|
|
24
|
-
export {};
|
|
1
|
+
import { CreateArgs } from '../types/Cms';
|
|
2
|
+
import { YargsCommandModule } from '../types/Yargs';
|
|
3
|
+
declare const createCommand: YargsCommandModule<unknown, CreateArgs>;
|
|
4
|
+
export default createCommand;
|
package/commands/create.js
CHANGED
|
@@ -1,97 +1,76 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* 1. Create a new file under the `create` directory with the command name being the name of the file
|
|
6
|
-
* 2. The file _must_ export a `dest` function and an `execute` function. See below for details
|
|
7
|
-
* Note: No changes should be needed to this file when adding new types, unless you need new functionality
|
|
8
|
-
*
|
|
9
|
-
* @export {(Data) => String} dest - A function returning the destination of the asset we are creating
|
|
10
|
-
* @export {(Data) => Object=} execute - The code called once all other checks pass. This should contain the logic
|
|
11
|
-
* for handling your command. Optionally return an object containing KV pairs
|
|
12
|
-
* of any context or data you want passed along to usage tracking
|
|
13
|
-
* @export {Boolean=} hidden - If true, the command will not show up in --help
|
|
14
|
-
* @export {(Data) => Boolean=} validate - If provided, return true if it passes validation, false otherwise.
|
|
15
|
-
* If not provided, validation will automatically succeed
|
|
16
|
-
*
|
|
17
|
-
* The Data object contains
|
|
18
|
-
* {
|
|
19
|
-
* assetType: String - Type of the asset (e.g. api-sample, react-app, template)
|
|
20
|
-
* name: String - Filename of the asset
|
|
21
|
-
* dest: String - The path specified by the user on where to create the asset
|
|
22
|
-
* internal: Boolean - A flag for retrieving the internal spec for the asset type
|
|
23
|
-
* options: Object - The options object passed to the command by Yargs
|
|
24
|
-
* }
|
|
25
|
-
*/
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
26
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
6
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
7
|
+
const index_1 = require("../lib/errorHandlers/index");
|
|
8
|
+
const commonOpts_1 = require("../lib/commonOpts");
|
|
9
|
+
const filesystem_1 = require("../lib/filesystem");
|
|
10
|
+
const usageTracking_1 = require("../lib/usageTracking");
|
|
11
|
+
const index_2 = __importDefault(require("./create/index"));
|
|
12
|
+
const en_1 = require("../lang/en");
|
|
13
|
+
const logger_1 = require("../lib/ui/logger");
|
|
14
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
15
|
+
const exitCodes_1 = require("../lib/enums/exitCodes");
|
|
16
|
+
const SUPPORTED_ASSET_TYPES = Object.keys(index_2.default)
|
|
17
|
+
.filter(t => !index_2.default[t].hidden)
|
|
37
18
|
.join(', ');
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
setLogLevel(options);
|
|
46
|
-
assetType = typeof assetType === 'string' && assetType.toLowerCase();
|
|
19
|
+
const command = 'create <type> [name] [dest]';
|
|
20
|
+
const describe = en_1.commands.create.describe(SUPPORTED_ASSET_TYPES);
|
|
21
|
+
async function handler(args) {
|
|
22
|
+
const { name, internal: getInternalVersion, type } = args;
|
|
23
|
+
let { dest } = args;
|
|
24
|
+
(0, commonOpts_1.setLogLevel)(args);
|
|
25
|
+
const assetType = type.toLowerCase();
|
|
47
26
|
if (assetType === 'global-partial') {
|
|
48
|
-
|
|
49
|
-
assetType,
|
|
50
|
-
newCommand: 'hs create template',
|
|
51
|
-
type: 'global partial',
|
|
52
|
-
}));
|
|
27
|
+
logger_1.uiLogger.error(en_1.commands.create.errors.deprecatedAssetType(assetType, 'hs create template', 'global partial'));
|
|
53
28
|
return;
|
|
54
29
|
}
|
|
55
|
-
if (!assetType || !
|
|
56
|
-
|
|
57
|
-
assetType,
|
|
58
|
-
supportedAssetTypes: SUPPORTED_ASSET_TYPES,
|
|
59
|
-
}));
|
|
30
|
+
if (!assetType || !index_2.default[assetType]) {
|
|
31
|
+
logger_1.uiLogger.error(en_1.commands.create.errors.unsupportedAssetType(assetType, SUPPORTED_ASSET_TYPES));
|
|
60
32
|
return;
|
|
61
33
|
}
|
|
62
|
-
const asset =
|
|
63
|
-
const argsToPass = {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
34
|
+
const asset = index_2.default[assetType];
|
|
35
|
+
const argsToPass = {
|
|
36
|
+
commandArgs: args,
|
|
37
|
+
assetType,
|
|
38
|
+
name,
|
|
39
|
+
dest,
|
|
40
|
+
getInternalVersion: getInternalVersion || false,
|
|
41
|
+
};
|
|
42
|
+
dest = argsToPass.dest = (0, filesystem_1.resolveLocalPath)(asset.dest(argsToPass));
|
|
43
|
+
const { derivedAccountId } = args;
|
|
44
|
+
(0, usageTracking_1.trackCommandUsage)('create', { assetType }, derivedAccountId);
|
|
67
45
|
try {
|
|
68
|
-
await
|
|
46
|
+
await fs_extra_1.default.ensureDir(dest);
|
|
69
47
|
}
|
|
70
48
|
catch (e) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}));
|
|
74
|
-
logError(e, {
|
|
75
|
-
filepath: dest,
|
|
76
|
-
operation: 'write',
|
|
77
|
-
});
|
|
49
|
+
logger_1.uiLogger.error(en_1.commands.create.errors.unusablePath(dest));
|
|
50
|
+
(0, index_1.logError)(e);
|
|
78
51
|
return;
|
|
79
52
|
}
|
|
80
53
|
if (asset.validate && !asset.validate(argsToPass))
|
|
81
54
|
return;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
55
|
+
try {
|
|
56
|
+
await asset.execute(argsToPass);
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
(0, index_1.logError)(e);
|
|
60
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function createBuilder(yargs) {
|
|
85
64
|
yargs.positional('type', {
|
|
86
|
-
describe:
|
|
65
|
+
describe: en_1.commands.create.positionals.type.describe,
|
|
87
66
|
type: 'string',
|
|
88
67
|
});
|
|
89
68
|
yargs.positional('name', {
|
|
90
|
-
describe:
|
|
69
|
+
describe: en_1.commands.create.positionals.name.describe,
|
|
91
70
|
type: 'string',
|
|
92
71
|
});
|
|
93
72
|
yargs.positional('dest', {
|
|
94
|
-
describe:
|
|
73
|
+
describe: en_1.commands.create.positionals.dest.describe,
|
|
95
74
|
type: 'string',
|
|
96
75
|
});
|
|
97
76
|
yargs.option('internal', {
|
|
@@ -99,7 +78,18 @@ exports.builder = yargs => {
|
|
|
99
78
|
type: 'boolean',
|
|
100
79
|
hidden: true,
|
|
101
80
|
});
|
|
102
|
-
addConfigOptions(yargs);
|
|
103
|
-
addGlobalOptions(yargs);
|
|
104
81
|
return yargs;
|
|
82
|
+
}
|
|
83
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(createBuilder, command, describe, {
|
|
84
|
+
useGlobalOptions: true,
|
|
85
|
+
useConfigOptions: true,
|
|
86
|
+
});
|
|
87
|
+
const createCommand = {
|
|
88
|
+
command,
|
|
89
|
+
describe,
|
|
90
|
+
builder,
|
|
91
|
+
handler,
|
|
105
92
|
};
|
|
93
|
+
exports.default = createCommand;
|
|
94
|
+
// TODO Remove this legacy export once we've migrated all commands to TS
|
|
95
|
+
module.exports = createCommand;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "create [name]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type CustomObjectCreateArgs = CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type CustomObjectCreateArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
name?: string;
|
|
8
4
|
path?: string;
|
|
9
5
|
};
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
export {};
|
|
6
|
+
declare const customObjectCreateCommand: YargsCommandModule<unknown, CustomObjectCreateArgs>;
|
|
7
|
+
export default customObjectCreateCommand;
|
|
@@ -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 customObjects_1 = require("@hubspot/local-dev-lib/api/customObjects");
|
|
8
5
|
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
@@ -13,9 +10,9 @@ const usageTracking_1 = require("../../lib/usageTracking");
|
|
|
13
10
|
const lang_1 = require("../../lib/lang");
|
|
14
11
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
15
12
|
const customObject_1 = require("../../lib/customObject");
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
14
|
+
const command = 'create [name]';
|
|
15
|
+
const describe = (0, lang_1.i18n)(`commands.customObject.subcommands.create.describe`);
|
|
19
16
|
async function handler(args) {
|
|
20
17
|
const { path, name: providedName, derivedAccountId } = args;
|
|
21
18
|
let definitionPath = path;
|
|
@@ -44,10 +41,7 @@ async function handler(args) {
|
|
|
44
41
|
}));
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
|
-
function
|
|
48
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
49
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
50
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
44
|
+
function customObjectCreateBuilder(yargs) {
|
|
51
45
|
yargs
|
|
52
46
|
.positional('name', {
|
|
53
47
|
describe: (0, lang_1.i18n)(`commands.customObject.subcommands.create.positionals.name.describe`),
|
|
@@ -59,3 +53,16 @@ function builder(yargs) {
|
|
|
59
53
|
});
|
|
60
54
|
return yargs;
|
|
61
55
|
}
|
|
56
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(customObjectCreateBuilder, command, describe, {
|
|
57
|
+
useGlobalOptions: true,
|
|
58
|
+
useConfigOptions: true,
|
|
59
|
+
useAccountOptions: true,
|
|
60
|
+
useEnvironmentOptions: true,
|
|
61
|
+
});
|
|
62
|
+
const customObjectCreateCommand = {
|
|
63
|
+
command,
|
|
64
|
+
describe,
|
|
65
|
+
handler,
|
|
66
|
+
builder,
|
|
67
|
+
};
|
|
68
|
+
exports.default = customObjectCreateCommand;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "create";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & TestingArgs;
|
|
6
|
-
type SchemaCreateArgs = CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, TestingArgs, YargsCommandModule } from '../../../types/Yargs';
|
|
2
|
+
type SchemaCreateArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & TestingArgs & {
|
|
7
3
|
path: string;
|
|
8
4
|
};
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
5
|
+
declare const schemaCreateCommand: YargsCommandModule<unknown, SchemaCreateArgs>;
|
|
6
|
+
export default schemaCreateCommand;
|
|
@@ -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 config_1 = require("@hubspot/local-dev-lib/config");
|
|
8
5
|
const environments_1 = require("@hubspot/local-dev-lib/constants/environments");
|
|
@@ -12,12 +9,12 @@ const urls_1 = require("@hubspot/local-dev-lib/urls");
|
|
|
12
9
|
const index_1 = require("../../../lib/errorHandlers/index");
|
|
13
10
|
const validation_1 = require("../../../lib/validation");
|
|
14
11
|
const usageTracking_1 = require("../../../lib/usageTracking");
|
|
15
|
-
const commonOpts_1 = require("../../../lib/commonOpts");
|
|
16
12
|
const lang_1 = require("../../../lib/lang");
|
|
17
13
|
const exitCodes_1 = require("../../../lib/enums/exitCodes");
|
|
18
14
|
const customObject_1 = require("../../../lib/customObject");
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
const yargsUtils_1 = require("../../../lib/yargsUtils");
|
|
16
|
+
const command = 'create';
|
|
17
|
+
const describe = (0, lang_1.i18n)(`commands.customObject.subcommands.schema.subcommands.create.describe`);
|
|
21
18
|
async function handler(args) {
|
|
22
19
|
const { path, derivedAccountId } = args;
|
|
23
20
|
(0, usageTracking_1.trackCommandUsage)('custom-object-schema-create', {}, derivedAccountId);
|
|
@@ -40,11 +37,7 @@ async function handler(args) {
|
|
|
40
37
|
}));
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
|
-
function
|
|
44
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
45
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
46
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
47
|
-
(0, commonOpts_1.addTestingOptions)(yargs);
|
|
40
|
+
function schemaCreateBuilder(yargs) {
|
|
48
41
|
yargs.option('path', {
|
|
49
42
|
describe: (0, lang_1.i18n)(`commands.customObject.subcommands.schema.subcommands.create.options.definition.describe`),
|
|
50
43
|
type: 'string',
|
|
@@ -52,3 +45,17 @@ function builder(yargs) {
|
|
|
52
45
|
});
|
|
53
46
|
return yargs;
|
|
54
47
|
}
|
|
48
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(schemaCreateBuilder, command, describe, {
|
|
49
|
+
useGlobalOptions: true,
|
|
50
|
+
useConfigOptions: true,
|
|
51
|
+
useAccountOptions: true,
|
|
52
|
+
useEnvironmentOptions: true,
|
|
53
|
+
useTestingOptions: true,
|
|
54
|
+
});
|
|
55
|
+
const schemaCreateCommand = {
|
|
56
|
+
command,
|
|
57
|
+
describe,
|
|
58
|
+
handler,
|
|
59
|
+
builder,
|
|
60
|
+
};
|
|
61
|
+
exports.default = schemaCreateCommand;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "delete [name]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type SchemaDeleteArgs = CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../../types/Yargs';
|
|
2
|
+
type SchemaDeleteArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
name?: string;
|
|
8
4
|
force?: boolean;
|
|
9
5
|
};
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
export {};
|
|
6
|
+
declare const schemaDeleteCommand: YargsCommandModule<unknown, SchemaDeleteArgs>;
|
|
7
|
+
export default schemaDeleteCommand;
|
|
@@ -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 customObjects_1 = require("@hubspot/local-dev-lib/api/customObjects");
|
|
7
4
|
const exitCodes_1 = require("../../../lib/enums/exitCodes");
|
|
8
5
|
const promptUtils_1 = require("../../../lib/prompts/promptUtils");
|
|
@@ -10,9 +7,9 @@ const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
|
10
7
|
const usageTracking_1 = require("../../../lib/usageTracking");
|
|
11
8
|
const lang_1 = require("../../../lib/lang");
|
|
12
9
|
const errorHandlers_1 = require("../../../lib/errorHandlers");
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const yargsUtils_1 = require("../../../lib/yargsUtils");
|
|
11
|
+
const command = 'delete [name]';
|
|
12
|
+
const describe = (0, lang_1.i18n)(`commands.customObject.subcommands.schema.subcommands.delete.describe`);
|
|
16
13
|
async function handler(args) {
|
|
17
14
|
const { name: providedName, force, derivedAccountId } = args;
|
|
18
15
|
(0, usageTracking_1.trackCommandUsage)('custom-object-schema-delete', {}, derivedAccountId);
|
|
@@ -44,10 +41,7 @@ async function handler(args) {
|
|
|
44
41
|
}));
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
|
-
function
|
|
48
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
49
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
50
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
44
|
+
function schemaDeleteBuilder(yargs) {
|
|
51
45
|
yargs
|
|
52
46
|
.example([
|
|
53
47
|
[
|
|
@@ -65,3 +59,16 @@ function builder(yargs) {
|
|
|
65
59
|
});
|
|
66
60
|
return yargs;
|
|
67
61
|
}
|
|
62
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(schemaDeleteBuilder, command, describe, {
|
|
63
|
+
useGlobalOptions: true,
|
|
64
|
+
useConfigOptions: true,
|
|
65
|
+
useAccountOptions: true,
|
|
66
|
+
useEnvironmentOptions: true,
|
|
67
|
+
});
|
|
68
|
+
const schemaDeleteCommand = {
|
|
69
|
+
command,
|
|
70
|
+
describe,
|
|
71
|
+
handler,
|
|
72
|
+
builder,
|
|
73
|
+
};
|
|
74
|
+
exports.default = schemaDeleteCommand;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "fetch-all [dest]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type SchemaFetchAllArgs = CombinedArgs & {
|
|
1
|
+
import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs, YargsCommandModule } from '../../../types/Yargs';
|
|
2
|
+
type SchemaFetchAllArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
dest?: string;
|
|
8
4
|
};
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
5
|
+
declare const schemaFetchAllCommand: YargsCommandModule<unknown, SchemaFetchAllArgs>;
|
|
6
|
+
export default schemaFetchAllCommand;
|
|
@@ -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 customObjects_1 = require("@hubspot/local-dev-lib/customObjects");
|
|
8
5
|
const promptUtils_1 = require("../../../lib/prompts/promptUtils");
|
|
@@ -10,9 +7,9 @@ const usageTracking_1 = require("../../../lib/usageTracking");
|
|
|
10
7
|
const lang_1 = require("../../../lib/lang");
|
|
11
8
|
const schema_1 = require("../../../lib/schema");
|
|
12
9
|
const errorHandlers_1 = require("../../../lib/errorHandlers");
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const yargsUtils_1 = require("../../../lib/yargsUtils");
|
|
11
|
+
const command = 'fetch-all [dest]';
|
|
12
|
+
const describe = (0, lang_1.i18n)(`commands.customObject.subcommands.schema.subcommands.fetchAll.describe`);
|
|
16
13
|
async function handler(args) {
|
|
17
14
|
const { derivedAccountId, dest: providedDest } = args;
|
|
18
15
|
(0, usageTracking_1.trackCommandUsage)('custom-object-schema-fetch-all', {}, derivedAccountId);
|
|
@@ -30,10 +27,7 @@ async function handler(args) {
|
|
|
30
27
|
logger_1.logger.error((0, lang_1.i18n)(`commands.customObject.subcommands.schema.subcommands.fetchAll.errors.fetch`));
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
|
-
function
|
|
34
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
35
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
36
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
30
|
+
function schemaFetchAllBuilder(yargs) {
|
|
37
31
|
yargs
|
|
38
32
|
.example([
|
|
39
33
|
[
|
|
@@ -51,3 +45,16 @@ function builder(yargs) {
|
|
|
51
45
|
});
|
|
52
46
|
return yargs;
|
|
53
47
|
}
|
|
48
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(schemaFetchAllBuilder, command, describe, {
|
|
49
|
+
useGlobalOptions: true,
|
|
50
|
+
useConfigOptions: true,
|
|
51
|
+
useAccountOptions: true,
|
|
52
|
+
useEnvironmentOptions: true,
|
|
53
|
+
});
|
|
54
|
+
const schemaFetchAllCommand = {
|
|
55
|
+
command,
|
|
56
|
+
describe,
|
|
57
|
+
handler,
|
|
58
|
+
builder,
|
|
59
|
+
};
|
|
60
|
+
exports.default = schemaFetchAllCommand;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "fetch [name] [dest]";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type SchemaFetchArgs = CombinedArgs & {
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../../types/Yargs';
|
|
2
|
+
type SchemaFetchArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
name?: string;
|
|
8
4
|
dest?: string;
|
|
9
5
|
};
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
export {};
|
|
6
|
+
declare const schemaFetchCommand: YargsCommandModule<unknown, SchemaFetchArgs>;
|
|
7
|
+
export default schemaFetchCommand;
|
|
@@ -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 customObjects_1 = require("@hubspot/local-dev-lib/api/customObjects");
|
|
7
4
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
8
5
|
const customObjects_2 = require("@hubspot/local-dev-lib/customObjects");
|
|
@@ -10,9 +7,9 @@ const promptUtils_1 = require("../../../lib/prompts/promptUtils");
|
|
|
10
7
|
const usageTracking_1 = require("../../../lib/usageTracking");
|
|
11
8
|
const lang_1 = require("../../../lib/lang");
|
|
12
9
|
const errorHandlers_1 = require("../../../lib/errorHandlers");
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const yargsUtils_1 = require("../../../lib/yargsUtils");
|
|
11
|
+
const command = 'fetch [name] [dest]';
|
|
12
|
+
const describe = (0, lang_1.i18n)(`commands.customObject.subcommands.schema.subcommands.fetch.describe`);
|
|
16
13
|
async function handler(args) {
|
|
17
14
|
const { name: providedName, dest: providedDest, derivedAccountId } = args;
|
|
18
15
|
(0, usageTracking_1.trackCommandUsage)('custom-object-schema-fetch', {}, derivedAccountId);
|
|
@@ -39,10 +36,7 @@ async function handler(args) {
|
|
|
39
36
|
}));
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
|
-
function
|
|
43
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
44
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
45
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
39
|
+
function schemaFetchBuilder(yargs) {
|
|
46
40
|
yargs
|
|
47
41
|
.example([
|
|
48
42
|
[
|
|
@@ -64,3 +58,16 @@ function builder(yargs) {
|
|
|
64
58
|
});
|
|
65
59
|
return yargs;
|
|
66
60
|
}
|
|
61
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(schemaFetchBuilder, command, describe, {
|
|
62
|
+
useGlobalOptions: true,
|
|
63
|
+
useConfigOptions: true,
|
|
64
|
+
useAccountOptions: true,
|
|
65
|
+
useEnvironmentOptions: true,
|
|
66
|
+
});
|
|
67
|
+
const schemaFetchCommand = {
|
|
68
|
+
command,
|
|
69
|
+
describe,
|
|
70
|
+
handler,
|
|
71
|
+
builder,
|
|
72
|
+
};
|
|
73
|
+
exports.default = schemaFetchCommand;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
export declare function handler(args: ArgumentsCamelCase<CombinedArgs>): Promise<void>;
|
|
7
|
-
export declare function builder(yargs: Argv): Argv<CombinedArgs>;
|
|
8
|
-
export {};
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../../types/Yargs';
|
|
2
|
+
type SchemaListArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
3
|
+
declare const schemaListCommand: YargsCommandModule<unknown, SchemaListArgs>;
|
|
4
|
+
export default schemaListCommand;
|
|
@@ -1,16 +1,13 @@
|
|
|
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
|
-
const commonOpts_1 = require("../../../lib/commonOpts");
|
|
8
4
|
const index_1 = require("../../../lib/errorHandlers/index");
|
|
9
5
|
const usageTracking_1 = require("../../../lib/usageTracking");
|
|
10
6
|
const schema_1 = require("../../../lib/schema");
|
|
11
7
|
const lang_1 = require("../../../lib/lang");
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
const yargsUtils_1 = require("../../../lib/yargsUtils");
|
|
9
|
+
const command = 'list';
|
|
10
|
+
const describe = (0, lang_1.i18n)(`commands.customObject.subcommands.schema.subcommands.list.describe`);
|
|
14
11
|
async function handler(args) {
|
|
15
12
|
const { derivedAccountId } = args;
|
|
16
13
|
(0, usageTracking_1.trackCommandUsage)('custom-object-schema-list', {}, derivedAccountId);
|
|
@@ -22,9 +19,19 @@ async function handler(args) {
|
|
|
22
19
|
logger_1.logger.error((0, lang_1.i18n)(`commands.customObject.subcommands.schema.subcommands.list.errors.list`));
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
function
|
|
26
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
27
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
28
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
22
|
+
function schemaListBuilder(yargs) {
|
|
29
23
|
return yargs;
|
|
30
24
|
}
|
|
25
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(schemaListBuilder, command, describe, {
|
|
26
|
+
useGlobalOptions: true,
|
|
27
|
+
useConfigOptions: true,
|
|
28
|
+
useAccountOptions: true,
|
|
29
|
+
useEnvironmentOptions: true,
|
|
30
|
+
});
|
|
31
|
+
const schemaListCommand = {
|
|
32
|
+
command,
|
|
33
|
+
describe,
|
|
34
|
+
handler,
|
|
35
|
+
builder,
|
|
36
|
+
};
|
|
37
|
+
exports.default = schemaListCommand;
|