@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,18 +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 fileManager_1 = require("@hubspot/local-dev-lib/fileManager");
|
|
7
4
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
8
5
|
const filesystem_1 = require("../../lib/filesystem");
|
|
9
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
10
6
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
11
7
|
const lang_1 = require("../../lib/lang");
|
|
12
8
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
13
9
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const commonOpts_1 = require("../../lib/commonOpts");
|
|
11
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
12
|
+
const command = 'fetch <src> [dest]';
|
|
13
|
+
const describe = (0, lang_1.i18n)(`commands.filemanager.subcommands.fetch.describe`);
|
|
16
14
|
async function handler(args) {
|
|
17
15
|
const { src, includeArchived, derivedAccountId, overwrite } = args;
|
|
18
16
|
if (typeof src !== 'string') {
|
|
@@ -30,12 +28,8 @@ async function handler(args) {
|
|
|
30
28
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
31
29
|
}
|
|
32
30
|
}
|
|
33
|
-
function
|
|
34
|
-
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
35
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
36
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
31
|
+
function fileManagerFetchBuilder(yargs) {
|
|
37
32
|
(0, commonOpts_1.addOverwriteOptions)(yargs);
|
|
38
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
39
33
|
yargs.positional('src', {
|
|
40
34
|
describe: (0, lang_1.i18n)(`commands.filemanager.subcommands.fetch.positionals.src.describe`),
|
|
41
35
|
type: 'string',
|
|
@@ -51,3 +45,16 @@ function builder(yargs) {
|
|
|
51
45
|
});
|
|
52
46
|
return yargs;
|
|
53
47
|
}
|
|
48
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(fileManagerFetchBuilder, command, describe, {
|
|
49
|
+
useGlobalOptions: true,
|
|
50
|
+
useConfigOptions: true,
|
|
51
|
+
useAccountOptions: true,
|
|
52
|
+
useEnvironmentOptions: true,
|
|
53
|
+
});
|
|
54
|
+
const fileManagerFetchCommand = {
|
|
55
|
+
command,
|
|
56
|
+
describe,
|
|
57
|
+
handler,
|
|
58
|
+
builder,
|
|
59
|
+
};
|
|
60
|
+
exports.default = fileManagerFetchCommand;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const command = "upload <src> <dest>";
|
|
4
|
-
export declare const describe: string;
|
|
5
|
-
type CombinedArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs;
|
|
6
|
-
type FileManagerUploadArgs = CombinedArgs & {
|
|
1
|
+
import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type FileManagerUploadArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
7
3
|
src: string;
|
|
8
4
|
dest: string;
|
|
9
5
|
};
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
export {};
|
|
6
|
+
declare const fileManagerUploadCommand: YargsCommandModule<unknown, FileManagerUploadArgs>;
|
|
7
|
+
export default fileManagerUploadCommand;
|
|
@@ -3,9 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.describe = exports.command = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
|
-
exports.builder = builder;
|
|
9
6
|
const fs_1 = __importDefault(require("fs"));
|
|
10
7
|
const path_1 = __importDefault(require("path"));
|
|
11
8
|
const fileManager_1 = require("@hubspot/local-dev-lib/fileManager");
|
|
@@ -15,12 +12,12 @@ const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
|
15
12
|
const modules_1 = require("@hubspot/local-dev-lib/cms/modules");
|
|
16
13
|
const ignoreRules_1 = require("@hubspot/local-dev-lib/ignoreRules");
|
|
17
14
|
const index_1 = require("../../lib/errorHandlers/index");
|
|
18
|
-
const commonOpts_1 = require("../../lib/commonOpts");
|
|
19
15
|
const usageTracking_1 = require("../../lib/usageTracking");
|
|
20
16
|
const lang_1 = require("../../lib/lang");
|
|
21
17
|
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
19
|
+
const command = 'upload <src> <dest>';
|
|
20
|
+
const describe = (0, lang_1.i18n)(`commands.filemanager.subcommands.upload.describe`);
|
|
24
21
|
async function handler(args) {
|
|
25
22
|
const { src, dest, derivedAccountId } = args;
|
|
26
23
|
const absoluteSrcPath = path_1.default.resolve((0, path_2.getCwd)(), src);
|
|
@@ -98,11 +95,7 @@ async function handler(args) {
|
|
|
98
95
|
});
|
|
99
96
|
}
|
|
100
97
|
}
|
|
101
|
-
function
|
|
102
|
-
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
103
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
104
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
105
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
98
|
+
function fileManagerUploadBuilder(yargs) {
|
|
106
99
|
yargs.positional('src', {
|
|
107
100
|
describe: (0, lang_1.i18n)(`commands.filemanager.subcommands.upload.positionals.src.describe`),
|
|
108
101
|
type: 'string',
|
|
@@ -113,3 +106,16 @@ function builder(yargs) {
|
|
|
113
106
|
});
|
|
114
107
|
return yargs;
|
|
115
108
|
}
|
|
109
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(fileManagerUploadBuilder, command, describe, {
|
|
110
|
+
useGlobalOptions: true,
|
|
111
|
+
useConfigOptions: true,
|
|
112
|
+
useAccountOptions: true,
|
|
113
|
+
useEnvironmentOptions: true,
|
|
114
|
+
});
|
|
115
|
+
const fileManagerUploadCommand = {
|
|
116
|
+
command,
|
|
117
|
+
describe,
|
|
118
|
+
handler,
|
|
119
|
+
builder,
|
|
120
|
+
};
|
|
121
|
+
exports.default = fileManagerUploadCommand;
|
|
@@ -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 fileManagerCommand: YargsCommandModuleBucket;
|
|
3
|
+
export default fileManagerCommand;
|
package/commands/filemanager.js
CHANGED
|
@@ -1,46 +1,25 @@
|
|
|
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 upload = __importStar(require("./filemanager/upload"));
|
|
39
|
-
const fetch = __importStar(require("./filemanager/fetch"));
|
|
6
|
+
const upload_1 = __importDefault(require("./filemanager/upload"));
|
|
7
|
+
const fetch_1 = __importDefault(require("./filemanager/fetch"));
|
|
40
8
|
const lang_1 = require("../lib/lang");
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
9
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
10
|
+
const command = 'filemanager';
|
|
11
|
+
const describe = (0, lang_1.i18n)(`commands.filemanager.describe`);
|
|
12
|
+
function fileManagerBuilder(yargs) {
|
|
13
|
+
yargs.command(upload_1.default).command(fetch_1.default).demandCommand(1, '');
|
|
45
14
|
return yargs;
|
|
46
15
|
}
|
|
16
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(fileManagerBuilder, command, describe);
|
|
17
|
+
const fileManagerCommand = {
|
|
18
|
+
command,
|
|
19
|
+
describe,
|
|
20
|
+
builder,
|
|
21
|
+
handler: () => { },
|
|
22
|
+
};
|
|
23
|
+
exports.default = fileManagerCommand;
|
|
24
|
+
// TODO Remove this legacy export once we've migrated all commands to TS
|
|
25
|
+
module.exports = fileManagerCommand;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type FunctionDeployArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
|
+
path: string;
|
|
4
|
+
};
|
|
5
|
+
declare const functionDeployCommand: YargsCommandModule<unknown, FunctionDeployArgs>;
|
|
6
|
+
export default functionDeployCommand;
|
|
@@ -1,91 +1,111 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
7
|
+
const functions_1 = require("@hubspot/local-dev-lib/api/functions");
|
|
8
|
+
const index_1 = require("@hubspot/local-dev-lib/errors/index");
|
|
9
|
+
const SpinniesManager_1 = __importDefault(require("../../lib/ui/SpinniesManager"));
|
|
10
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
11
|
+
const index_2 = require("../../lib/errorHandlers/index");
|
|
12
|
+
const ui_1 = require("../../lib/ui");
|
|
13
|
+
const polling_1 = require("../../lib/polling");
|
|
14
|
+
const serverlessLogs_1 = require("../../lib/serverlessLogs");
|
|
15
|
+
const lang_1 = require("../../lib/lang");
|
|
16
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
17
|
+
function isFunctionBuildError(e) {
|
|
18
|
+
return (typeof e === 'object' && e !== null && 'status' in e && e.status === 'ERROR');
|
|
19
|
+
}
|
|
20
|
+
const command = 'deploy <path>';
|
|
21
|
+
const describe = undefined;
|
|
22
|
+
async function handler(args) {
|
|
23
|
+
const { path: functionPath, derivedAccountId } = args;
|
|
19
24
|
const splitFunctionPath = functionPath.split('.');
|
|
20
|
-
trackCommandUsage('
|
|
25
|
+
(0, usageTracking_1.trackCommandUsage)('function-deploy', undefined, derivedAccountId);
|
|
21
26
|
if (!splitFunctionPath.length ||
|
|
22
27
|
splitFunctionPath[splitFunctionPath.length - 1] !== 'functions') {
|
|
23
|
-
logger.error(i18n('commands.function.subcommands.deploy.errors.notFunctionsFolder', {
|
|
28
|
+
logger_1.logger.error((0, lang_1.i18n)('commands.function.subcommands.deploy.errors.notFunctionsFolder', {
|
|
24
29
|
functionPath,
|
|
25
30
|
}));
|
|
26
31
|
return;
|
|
27
32
|
}
|
|
28
|
-
logger.debug(i18n('commands.function.subcommands.deploy.debug.startingBuildAndDeploy', {
|
|
33
|
+
logger_1.logger.debug((0, lang_1.i18n)('commands.function.subcommands.deploy.debug.startingBuildAndDeploy', {
|
|
29
34
|
functionPath,
|
|
30
35
|
}));
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
text: i18n('commands.function.subcommands.deploy.loading', {
|
|
34
|
-
account: uiAccountDescription(derivedAccountId),
|
|
36
|
+
SpinniesManager_1.default.init();
|
|
37
|
+
SpinniesManager_1.default.add('loading', {
|
|
38
|
+
text: (0, lang_1.i18n)('commands.function.subcommands.deploy.loading', {
|
|
39
|
+
account: (0, ui_1.uiAccountDescription)(derivedAccountId),
|
|
35
40
|
functionPath,
|
|
36
41
|
}),
|
|
37
42
|
});
|
|
38
43
|
try {
|
|
39
|
-
const { data: buildId } = await buildPackage(derivedAccountId, functionPath);
|
|
40
|
-
const successResp = await poll(() => getBuildStatus(derivedAccountId, buildId));
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
const { data: buildId } = await (0, functions_1.buildPackage)(derivedAccountId, functionPath);
|
|
45
|
+
const successResp = await (0, polling_1.poll)(() => (0, functions_1.getBuildStatus)(derivedAccountId, Number(buildId)));
|
|
46
|
+
if (successResp) {
|
|
47
|
+
const buildTimeSeconds = successResp.buildTime
|
|
48
|
+
? (successResp.buildTime / 1000).toFixed(2)
|
|
49
|
+
: 0;
|
|
50
|
+
SpinniesManager_1.default.succeed('loading');
|
|
51
|
+
if (successResp.cdnUrl) {
|
|
52
|
+
await (0, serverlessLogs_1.outputBuildLog)(successResp.cdnUrl);
|
|
53
|
+
}
|
|
54
|
+
logger_1.logger.success((0, lang_1.i18n)('commands.function.subcommands.deploy.success.deployed', {
|
|
55
|
+
accountId: derivedAccountId,
|
|
56
|
+
buildTimeSeconds,
|
|
57
|
+
functionPath,
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
49
60
|
}
|
|
50
61
|
catch (e) {
|
|
51
|
-
|
|
52
|
-
text: i18n('commands.function.subcommands.deploy.loadingFailed', {
|
|
53
|
-
account: uiAccountDescription(derivedAccountId),
|
|
62
|
+
SpinniesManager_1.default.fail('loading', {
|
|
63
|
+
text: (0, lang_1.i18n)('commands.function.subcommands.deploy.loadingFailed', {
|
|
64
|
+
account: (0, ui_1.uiAccountDescription)(derivedAccountId),
|
|
54
65
|
functionPath,
|
|
55
66
|
}),
|
|
56
67
|
});
|
|
57
|
-
if (isHubSpotHttpError(e) && e.status === 404) {
|
|
58
|
-
logger.error(i18n('commands.function.subcommands.deploy.errors.noPackageJson', {
|
|
68
|
+
if ((0, index_1.isHubSpotHttpError)(e) && e.status === 404) {
|
|
69
|
+
logger_1.logger.error((0, lang_1.i18n)('commands.function.subcommands.deploy.errors.noPackageJson', {
|
|
59
70
|
functionPath,
|
|
60
71
|
}));
|
|
61
72
|
}
|
|
62
|
-
else if (e
|
|
63
|
-
await outputBuildLog(e.cdnUrl);
|
|
64
|
-
logger.error(i18n('commands.function.subcommands.deploy.errors.buildError', {
|
|
65
|
-
details: e.errorReason,
|
|
73
|
+
else if (isFunctionBuildError(e)) {
|
|
74
|
+
await (0, serverlessLogs_1.outputBuildLog)(e.cdnUrl);
|
|
75
|
+
logger_1.logger.error((0, lang_1.i18n)('commands.function.subcommands.deploy.errors.buildError', {
|
|
76
|
+
details: String(e.errorReason),
|
|
66
77
|
}));
|
|
67
78
|
}
|
|
68
79
|
else {
|
|
69
|
-
logError(e, new ApiErrorContext({
|
|
80
|
+
(0, index_2.logError)(e, new index_2.ApiErrorContext({
|
|
70
81
|
accountId: derivedAccountId,
|
|
71
82
|
request: functionPath,
|
|
72
83
|
}));
|
|
73
84
|
}
|
|
74
85
|
}
|
|
75
|
-
}
|
|
76
|
-
|
|
86
|
+
}
|
|
87
|
+
function functionDeployBuilder(yargs) {
|
|
77
88
|
yargs.positional('path', {
|
|
78
|
-
describe: i18n('commands.function.subcommands.deploy.positionals.path.describe'),
|
|
89
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.deploy.positionals.path.describe'),
|
|
79
90
|
type: 'string',
|
|
80
91
|
});
|
|
81
92
|
yargs.example([
|
|
82
93
|
[
|
|
83
94
|
'$0 functions deploy myFunctionFolder.functions',
|
|
84
|
-
i18n('commands.function.subcommands.deploy.examples.default'),
|
|
95
|
+
(0, lang_1.i18n)('commands.function.subcommands.deploy.examples.default'),
|
|
85
96
|
],
|
|
86
97
|
]);
|
|
87
|
-
addConfigOptions(yargs);
|
|
88
|
-
addAccountOptions(yargs);
|
|
89
|
-
addUseEnvironmentOptions(yargs);
|
|
90
98
|
return yargs;
|
|
99
|
+
}
|
|
100
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(functionDeployBuilder, command, describe, {
|
|
101
|
+
useConfigOptions: true,
|
|
102
|
+
useAccountOptions: true,
|
|
103
|
+
useEnvironmentOptions: true,
|
|
104
|
+
});
|
|
105
|
+
const functionDeployCommand = {
|
|
106
|
+
command,
|
|
107
|
+
describe,
|
|
108
|
+
handler,
|
|
109
|
+
builder,
|
|
91
110
|
};
|
|
111
|
+
exports.default = functionDeployCommand;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type FunctionListArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
|
+
json?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const functionListCommand: YargsCommandModule<unknown, FunctionListArgs>;
|
|
6
|
+
export default functionListCommand;
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
6
|
+
const moment_1 = __importDefault(require("moment"));
|
|
7
|
+
const functions_1 = require("@hubspot/local-dev-lib/api/functions");
|
|
8
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
9
|
+
const index_1 = require("../../lib/errorHandlers/index");
|
|
10
|
+
const table_1 = require("../../lib/ui/table");
|
|
11
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
12
|
+
const lang_1 = require("../../lib/lang");
|
|
13
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
14
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
15
|
+
const command = ['list', 'ls'];
|
|
16
|
+
const describe = (0, lang_1.i18n)('commands.function.subcommands.list.describe');
|
|
17
|
+
async function handler(args) {
|
|
18
|
+
const { derivedAccountId } = args;
|
|
19
|
+
(0, usageTracking_1.trackCommandUsage)('function-list', undefined, derivedAccountId);
|
|
20
|
+
logger_1.logger.debug((0, lang_1.i18n)('commands.function.subcommands.list.debug.gettingFunctions'));
|
|
21
|
+
const { data: routesResp } = await (0, functions_1.getRoutes)(derivedAccountId).catch(async (e) => {
|
|
22
|
+
(0, index_1.logError)(e, new index_1.ApiErrorContext({ accountId: derivedAccountId }));
|
|
23
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
22
24
|
});
|
|
23
25
|
if (!routesResp.objects.length) {
|
|
24
|
-
return logger.info(i18n('commands.function.subcommands.list.info.noFunctions'));
|
|
26
|
+
return logger_1.logger.info((0, lang_1.i18n)('commands.function.subcommands.list.info.noFunctions'));
|
|
25
27
|
}
|
|
26
|
-
if (
|
|
27
|
-
return logger.log(routesResp.objects);
|
|
28
|
+
if (args.json) {
|
|
29
|
+
return logger_1.logger.log(routesResp.objects);
|
|
28
30
|
}
|
|
29
31
|
const functionsAsArrays = routesResp.objects.map(func => {
|
|
30
32
|
const { route, method, created, updated, secretNames } = func;
|
|
@@ -32,21 +34,31 @@ exports.handler = async (options) => {
|
|
|
32
34
|
route,
|
|
33
35
|
method,
|
|
34
36
|
secretNames.join(', '),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
(0, moment_1.default)(created).format(),
|
|
38
|
+
(0, moment_1.default)(updated).format(),
|
|
37
39
|
];
|
|
38
40
|
});
|
|
39
|
-
functionsAsArrays.unshift(getTableHeader(['Route', 'Method', 'Secrets', 'Created', 'Updated']));
|
|
40
|
-
return logger.log(getTableContents(functionsAsArrays));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
addConfigOptions(yargs);
|
|
44
|
-
addAccountOptions(yargs);
|
|
45
|
-
addUseEnvironmentOptions(yargs);
|
|
41
|
+
functionsAsArrays.unshift((0, table_1.getTableHeader)(['Route', 'Method', 'Secrets', 'Created', 'Updated']));
|
|
42
|
+
return logger_1.logger.log((0, table_1.getTableContents)(functionsAsArrays));
|
|
43
|
+
}
|
|
44
|
+
function functionListBuilder(yargs) {
|
|
46
45
|
yargs.options({
|
|
47
46
|
json: {
|
|
48
|
-
describe: i18n('commands.function.subcommands.list.options.json.describe'),
|
|
47
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.list.options.json.describe'),
|
|
49
48
|
type: 'boolean',
|
|
50
49
|
},
|
|
51
50
|
});
|
|
51
|
+
return yargs;
|
|
52
|
+
}
|
|
53
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(functionListBuilder, command, describe, {
|
|
54
|
+
useConfigOptions: true,
|
|
55
|
+
useAccountOptions: true,
|
|
56
|
+
useEnvironmentOptions: true,
|
|
57
|
+
});
|
|
58
|
+
const functionListCommand = {
|
|
59
|
+
command,
|
|
60
|
+
describe,
|
|
61
|
+
handler,
|
|
62
|
+
builder,
|
|
52
63
|
};
|
|
64
|
+
exports.default = functionListCommand;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
type FunctionServerArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
|
+
path: string;
|
|
4
|
+
port?: string;
|
|
5
|
+
contact?: boolean;
|
|
6
|
+
watch?: boolean;
|
|
7
|
+
'log-output'?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const functionServerCommand: YargsCommandModule<unknown, FunctionServerArgs>;
|
|
10
|
+
export default functionServerCommand;
|
|
@@ -1,57 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
3
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
4
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
5
|
+
// This package is not typed, so we need to use require
|
|
7
6
|
const { start: startTestServer } = require('@hubspot/serverless-dev-runtime');
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
const lang_1 = require("../../lib/lang");
|
|
8
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
9
|
+
const command = 'server <path>';
|
|
10
|
+
const describe = undefined;
|
|
11
|
+
async function handler(args) {
|
|
12
|
+
const { path: functionPath, derivedAccountId } = args;
|
|
13
|
+
(0, usageTracking_1.trackCommandUsage)('functions-server', undefined, derivedAccountId);
|
|
14
|
+
logger_1.logger.debug((0, lang_1.i18n)('commands.function.subcommands.server.debug.startingServer', {
|
|
15
15
|
functionPath,
|
|
16
16
|
}));
|
|
17
17
|
startTestServer({
|
|
18
18
|
accountId: derivedAccountId,
|
|
19
|
-
...
|
|
19
|
+
...args,
|
|
20
20
|
});
|
|
21
|
-
}
|
|
22
|
-
|
|
21
|
+
}
|
|
22
|
+
function functionServerBuilder(yargs) {
|
|
23
23
|
yargs.positional('path', {
|
|
24
|
-
describe: i18n('commands.function.subcommands.server.positionals.path.describe'),
|
|
25
|
-
type: 'string',
|
|
26
|
-
});
|
|
27
|
-
yargs.option('port', {
|
|
28
|
-
describe: i18n('commands.function.subcommands.server.options.port.describe'),
|
|
24
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.server.positionals.path.describe'),
|
|
29
25
|
type: 'string',
|
|
30
|
-
default: 5432,
|
|
31
|
-
});
|
|
32
|
-
yargs.option('contact', {
|
|
33
|
-
describe: i18n('commands.function.subcommands.server.options.contact.describe'),
|
|
34
|
-
type: 'boolean',
|
|
35
|
-
default: true,
|
|
36
|
-
});
|
|
37
|
-
yargs.option('watch', {
|
|
38
|
-
describe: i18n('commands.function.subcommands.server.options.watch.describe'),
|
|
39
|
-
type: 'boolean',
|
|
40
|
-
default: true,
|
|
41
26
|
});
|
|
42
|
-
yargs.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
27
|
+
yargs.options({
|
|
28
|
+
port: {
|
|
29
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.server.options.port.describe'),
|
|
30
|
+
type: 'string',
|
|
31
|
+
default: 5432,
|
|
32
|
+
},
|
|
33
|
+
contact: {
|
|
34
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.server.options.contact.describe'),
|
|
35
|
+
type: 'boolean',
|
|
36
|
+
default: true,
|
|
37
|
+
},
|
|
38
|
+
watch: {
|
|
39
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.server.options.watch.describe'),
|
|
40
|
+
type: 'boolean',
|
|
41
|
+
default: true,
|
|
42
|
+
},
|
|
43
|
+
'log-output': {
|
|
44
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.server.options.logOutput.describe'),
|
|
45
|
+
type: 'boolean',
|
|
46
|
+
default: false,
|
|
47
|
+
},
|
|
46
48
|
});
|
|
47
49
|
yargs.example([
|
|
48
50
|
[
|
|
49
51
|
'$0 functions server ./tmp/myFunctionFolder.functions',
|
|
50
|
-
i18n('commands.function.subcommands.server.examples.default'),
|
|
52
|
+
(0, lang_1.i18n)('commands.function.subcommands.server.examples.default'),
|
|
51
53
|
],
|
|
52
54
|
]);
|
|
53
|
-
addConfigOptions(yargs);
|
|
54
|
-
addAccountOptions(yargs);
|
|
55
|
-
addUseEnvironmentOptions(yargs);
|
|
56
55
|
return yargs;
|
|
56
|
+
}
|
|
57
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(functionServerBuilder, command, describe, {
|
|
58
|
+
useConfigOptions: true,
|
|
59
|
+
useAccountOptions: true,
|
|
60
|
+
useEnvironmentOptions: true,
|
|
61
|
+
});
|
|
62
|
+
const functionServerCommand = {
|
|
63
|
+
command,
|
|
64
|
+
describe,
|
|
65
|
+
handler,
|
|
66
|
+
builder,
|
|
57
67
|
};
|
|
68
|
+
exports.default = functionServerCommand;
|
package/commands/function.d.ts
CHANGED