@hubspot/cli 7.5.11-experimental.0 → 7.6.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +102 -95
- package/commands/account/auth.d.ts +5 -7
- package/commands/account/auth.js +74 -87
- package/commands/account/clean.d.ts +3 -7
- package/commands/account/clean.js +16 -9
- package/commands/account/createOverride.d.ts +3 -7
- package/commands/account/createOverride.js +23 -6
- package/commands/account/info.d.ts +3 -7
- package/commands/account/info.js +13 -5
- package/commands/account/list.d.ts +3 -7
- package/commands/account/list.js +15 -8
- package/commands/account/remove.d.ts +3 -7
- package/commands/account/remove.js +21 -9
- package/commands/account/removeOverride.d.ts +3 -7
- package/commands/account/removeOverride.js +23 -6
- package/commands/account/rename.d.ts +3 -7
- package/commands/account/rename.js +16 -9
- package/commands/account/use.d.ts +5 -9
- package/commands/account/use.js +14 -6
- package/commands/account.d.ts +3 -4
- package/commands/account.js +33 -58
- package/commands/app/migrate.d.ts +1 -2
- package/commands/app/migrate.js +7 -8
- package/commands/app/secret/add.d.ts +7 -0
- package/commands/app/secret/add.js +64 -0
- package/commands/app/secret/delete.d.ts +8 -0
- package/commands/app/secret/delete.js +87 -0
- package/commands/app/secret/list.d.ts +6 -0
- package/commands/app/secret/list.js +64 -0
- package/commands/app/secret/update.d.ts +7 -0
- package/commands/app/secret/update.js +77 -0
- package/commands/app/secret.d.ts +3 -0
- package/commands/app/secret.js +30 -0
- package/commands/app.d.ts +2 -5
- package/commands/app.js +10 -8
- package/commands/auth.d.ts +5 -7
- package/commands/auth.js +29 -28
- package/commands/cms/convertFields.d.ts +7 -1
- package/commands/cms/convertFields.js +57 -41
- package/commands/cms/getReactModule.d.ts +7 -1
- package/commands/cms/getReactModule.js +52 -34
- package/commands/cms/lighthouseScore.d.ts +8 -1
- package/commands/cms/lighthouseScore.js +129 -100
- package/commands/cms.d.ts +3 -1
- package/commands/cms.js +22 -15
- package/commands/completion.d.ts +3 -1
- package/commands/completion.js +23 -12
- package/commands/config/migrate.d.ts +3 -7
- package/commands/config/migrate.js +37 -46
- package/commands/config/set.d.ts +5 -6
- package/commands/config/set.js +38 -14
- package/commands/config.d.ts +3 -4
- package/commands/config.js +18 -44
- package/commands/create/api-sample.d.ts +3 -1
- package/commands/create/api-sample.js +34 -38
- package/commands/create/app.d.ts +3 -1
- package/commands/create/app.js +9 -7
- package/commands/create/function.d.ts +3 -1
- package/commands/create/function.js +11 -10
- package/commands/create/index.d.ts +5 -1
- package/commands/create/index.js +23 -11
- package/commands/create/module.d.ts +3 -1
- package/commands/create/module.js +14 -13
- package/commands/create/react-app.d.ts +3 -1
- package/commands/create/react-app.js +10 -7
- package/commands/create/template.d.ts +3 -1
- package/commands/create/template.js +14 -14
- package/commands/create/vue-app.d.ts +3 -1
- package/commands/create/vue-app.js +10 -7
- package/commands/create/webpack-serverless.d.ts +3 -1
- package/commands/create/webpack-serverless.js +10 -7
- package/commands/create/website-theme.d.ts +3 -1
- package/commands/create/website-theme.js +10 -9
- package/commands/create.d.ts +4 -24
- package/commands/create.js +62 -74
- package/commands/customObject/create.d.ts +4 -9
- package/commands/customObject/create.js +17 -10
- package/commands/customObject/schema/create.d.ts +4 -9
- package/commands/customObject/schema/create.js +18 -11
- package/commands/customObject/schema/delete.d.ts +4 -9
- package/commands/customObject/schema/delete.js +17 -10
- package/commands/customObject/schema/fetch-all.d.ts +4 -9
- package/commands/customObject/schema/fetch-all.js +17 -10
- package/commands/customObject/schema/fetch.d.ts +4 -9
- package/commands/customObject/schema/fetch.js +17 -10
- package/commands/customObject/schema/list.d.ts +4 -8
- package/commands/customObject/schema/list.js +17 -10
- package/commands/customObject/schema/update.d.ts +4 -9
- package/commands/customObject/schema/update.js +18 -11
- package/commands/customObject/schema.d.ts +3 -5
- package/commands/customObject/schema.js +27 -54
- package/commands/customObject.d.ts +3 -4
- package/commands/customObject.js +18 -45
- package/commands/doctor.d.ts +6 -8
- package/commands/doctor.js +30 -21
- package/commands/feedback.d.ts +4 -1
- package/commands/feedback.js +38 -47
- package/commands/fetch.d.ts +12 -1
- package/commands/fetch.js +49 -33
- package/commands/filemanager/fetch.d.ts +4 -9
- package/commands/filemanager/fetch.js +18 -11
- package/commands/filemanager/upload.d.ts +4 -9
- package/commands/filemanager/upload.js +17 -11
- package/commands/filemanager.d.ts +3 -4
- package/commands/filemanager.js +18 -41
- package/commands/function/deploy.d.ts +6 -1
- package/commands/function/deploy.js +70 -50
- package/commands/function/list.d.ts +6 -1
- package/commands/function/list.js +44 -32
- package/commands/function/server.d.ts +10 -1
- package/commands/function/server.js +49 -38
- package/commands/function.d.ts +5 -1
- package/commands/function.js +22 -10
- package/commands/getStarted.d.ts +9 -0
- package/commands/getStarted.js +227 -0
- package/commands/hubdb/clear.d.ts +4 -9
- package/commands/hubdb/clear.js +17 -10
- package/commands/hubdb/create.d.ts +4 -9
- package/commands/hubdb/create.js +17 -10
- package/commands/hubdb/delete.d.ts +4 -9
- package/commands/hubdb/delete.js +17 -10
- package/commands/hubdb/fetch.d.ts +4 -9
- package/commands/hubdb/fetch.js +17 -10
- package/commands/hubdb/list.d.ts +4 -0
- package/commands/hubdb/list.js +83 -0
- package/commands/hubdb.d.ts +3 -2
- package/commands/hubdb.js +23 -45
- package/commands/init.d.ts +3 -7
- package/commands/init.js +17 -8
- package/commands/lint.d.ts +6 -4
- package/commands/lint.js +42 -43
- package/commands/list.d.ts +3 -7
- package/commands/list.js +17 -11
- package/commands/logs.d.ts +10 -1
- package/commands/logs.js +53 -44
- package/commands/mcp/setup.d.ts +7 -0
- package/commands/mcp/setup.js +52 -0
- package/commands/mcp/start.d.ts +3 -0
- package/commands/mcp/start.js +77 -0
- package/commands/mcp.d.ts +3 -0
- package/commands/mcp.js +26 -0
- package/commands/module/marketplace-validate.d.ts +6 -1
- package/commands/module/marketplace-validate.js +39 -29
- package/commands/module.d.ts +3 -1
- package/commands/module.js +23 -10
- package/commands/mv.d.ts +3 -7
- package/commands/mv.js +17 -11
- package/commands/open.d.ts +3 -7
- package/commands/open.js +17 -11
- package/commands/project/add.d.ts +5 -2
- package/commands/project/add.js +43 -80
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/cloneApp.js +2 -2
- package/commands/project/create.d.ts +2 -8
- package/commands/project/create.js +84 -55
- package/commands/project/deploy.d.ts +2 -0
- package/commands/project/deploy.js +67 -13
- package/commands/project/dev/deprecatedFlow.d.ts +8 -2
- package/commands/project/dev/deprecatedFlow.js +9 -1
- package/commands/project/dev/index.d.ts +1 -4
- package/commands/project/dev/index.js +88 -31
- package/commands/project/dev/unifiedFlow.d.ts +11 -2
- package/commands/project/dev/unifiedFlow.js +81 -41
- package/commands/project/listBuilds.js +2 -5
- 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 +22 -8
- package/commands/project/validate.d.ts +6 -0
- package/commands/project/validate.js +82 -0
- package/commands/project.js +4 -2
- package/commands/remove.d.ts +3 -7
- package/commands/remove.js +22 -22
- package/commands/sandbox/create.d.ts +4 -9
- package/commands/sandbox/create.js +18 -11
- package/commands/sandbox/delete.d.ts +4 -9
- package/commands/sandbox/delete.js +18 -11
- package/commands/sandbox.d.ts +3 -4
- package/commands/sandbox.js +18 -43
- package/commands/secret/addSecret.d.ts +4 -9
- package/commands/secret/addSecret.js +17 -10
- package/commands/secret/deleteSecret.d.ts +4 -9
- package/commands/secret/deleteSecret.js +17 -10
- package/commands/secret/listSecret.d.ts +4 -9
- package/commands/secret/listSecret.js +17 -10
- package/commands/secret/updateSecret.d.ts +4 -9
- package/commands/secret/updateSecret.js +17 -10
- package/commands/secret.d.ts +3 -4
- package/commands/secret.js +23 -48
- package/commands/testAccount/create.d.ts +6 -0
- package/commands/testAccount/create.js +100 -0
- package/commands/testAccount/createConfig.d.ts +10 -0
- package/commands/testAccount/createConfig.js +98 -0
- package/commands/testAccount/delete.d.ts +6 -0
- package/commands/testAccount/delete.js +48 -0
- package/commands/testAccount.d.ts +3 -0
- package/commands/testAccount.js +28 -0
- package/commands/theme/generate-selectors.d.ts +3 -7
- package/commands/theme/generate-selectors.js +20 -15
- package/commands/theme/marketplace-validate.d.ts +4 -9
- package/commands/theme/marketplace-validate.js +22 -17
- package/commands/theme/preview.d.ts +4 -9
- package/commands/theme/preview.js +32 -26
- package/commands/theme.d.ts +3 -4
- package/commands/theme.js +22 -47
- package/commands/upload.d.ts +12 -1
- package/commands/upload.js +116 -134
- package/commands/watch.d.ts +14 -1
- package/commands/watch.js +74 -75
- package/lang/en.d.ts +1135 -660
- package/lang/en.js +935 -471
- package/lang/en.lyaml +30 -213
- package/lib/accountTypes.js +1 -2
- package/lib/app/migrate.d.ts +23 -0
- package/lib/app/migrate.js +29 -6
- package/lib/app/migrate_legacy.js +7 -7
- package/lib/app/urls.d.ts +16 -0
- package/lib/app/urls.js +16 -0
- package/lib/commonOpts.d.ts +1 -3
- package/lib/commonOpts.js +1 -1
- package/lib/configMigrate.d.ts +2 -2
- package/lib/configMigrate.js +34 -55
- package/lib/configOptions.d.ts +4 -0
- package/lib/configOptions.js +41 -46
- package/lib/constants.d.ts +29 -0
- package/lib/constants.js +30 -1
- package/lib/dependencyManagement.d.ts +0 -5
- package/lib/dependencyManagement.js +13 -39
- package/lib/doctor/Doctor.js +3 -2
- package/lib/errorHandlers/index.js +7 -0
- package/lib/filesystem.d.ts +1 -1
- package/lib/generateSelectors.js +3 -5
- package/lib/interpolation.d.ts +2 -3
- package/lib/lang.d.ts +2 -3
- package/lib/marketplaceValidate.d.ts +12 -2
- package/lib/marketplaceValidate.js +22 -29
- package/lib/mcp/setup.d.ts +21 -0
- package/lib/mcp/setup.js +218 -0
- package/lib/middleware/autoUpdateMiddleware.d.ts +1 -0
- package/lib/middleware/autoUpdateMiddleware.js +89 -0
- package/lib/middleware/configMiddleware.js +23 -0
- package/lib/middleware/fireAlarmMiddleware.d.ts +2 -2
- package/lib/middleware/fireAlarmMiddleware.js +5 -3
- package/lib/npm.d.ts +9 -0
- package/lib/npm.js +36 -0
- package/lib/projectProfiles.d.ts +7 -0
- package/lib/projectProfiles.js +83 -0
- package/lib/projects/add/legacyAddComponent.d.ts +5 -0
- package/lib/projects/add/legacyAddComponent.js +48 -0
- package/lib/projects/add/v3AddComponent.d.ts +8 -0
- package/lib/projects/add/v3AddComponent.js +85 -0
- package/lib/projects/buildAndDeploy.js +18 -3
- package/lib/projects/components.d.ts +2 -0
- package/lib/projects/components.js +82 -0
- package/lib/projects/create/index.d.ts +23 -0
- package/lib/projects/create/index.js +33 -0
- package/lib/projects/create/legacy.d.ts +6 -0
- package/lib/projects/{create.js → create/legacy.js} +20 -11
- package/lib/projects/create/v3.d.ts +27 -0
- package/lib/projects/create/v3.js +158 -0
- package/lib/projects/localDev/AppDevModeInterface.d.ts +30 -0
- package/lib/projects/localDev/AppDevModeInterface.js +215 -0
- package/lib/projects/localDev/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 +159 -0
- package/lib/projects/localDev/LocalDevManager.js +12 -5
- package/lib/projects/localDev/LocalDevProcess.d.ts +34 -0
- package/lib/projects/localDev/LocalDevProcess.js +201 -0
- package/lib/projects/localDev/LocalDevState.d.ts +50 -0
- package/lib/projects/localDev/LocalDevState.js +119 -0
- package/lib/projects/localDev/LocalDevWatcher.d.ts +10 -0
- package/lib/projects/localDev/LocalDevWatcher.js +53 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +20 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +131 -0
- package/lib/projects/localDev/helpers.d.ts +3 -2
- package/lib/projects/localDev/helpers.js +32 -2
- package/lib/projects/upload.d.ts +5 -1
- package/lib/projects/upload.js +60 -20
- package/lib/projects/urls.d.ts +3 -0
- package/lib/projects/urls.js +17 -1
- package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +17 -0
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +96 -0
- package/lib/prompts/createProjectPrompt.d.ts +14 -5
- package/lib/prompts/createProjectPrompt.js +38 -13
- package/lib/prompts/createTemplatePrompt.d.ts +22 -4
- package/lib/prompts/installAppPrompt.d.ts +2 -0
- package/lib/prompts/installAppPrompt.js +45 -0
- package/lib/prompts/personalAccessKeyPrompt.js +35 -24
- package/lib/prompts/projectAddPrompt.d.ts +5 -1
- package/lib/prompts/projectAddPrompt.js +35 -7
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +6 -6
- package/lib/prompts/promptUtils.d.ts +4 -1
- package/lib/prompts/promptUtils.js +5 -1
- package/lib/prompts/selectAppPrompt.d.ts +2 -0
- package/lib/prompts/selectAppPrompt.js +40 -0
- package/lib/prompts/{selectPublicAppPrompt.d.ts → selectPublicAppForMigrationPrompt.d.ts} +1 -1
- package/lib/prompts/{selectPublicAppPrompt.js → selectPublicAppForMigrationPrompt.js} +8 -8
- package/lib/prompts/setAsDefaultAccountPrompt.js +10 -0
- package/lib/testUtils.d.ts +3 -3
- package/lib/testUtils.js +8 -9
- package/lib/ui/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/server.d.ts +1 -0
- package/mcp-server/server.js +18 -0
- package/mcp-server/tools/index.d.ts +2 -0
- package/mcp-server/tools/index.js +19 -0
- package/mcp-server/tools/project/AddFeatureToProject.d.ts +29 -0
- package/mcp-server/tools/project/AddFeatureToProject.js +85 -0
- package/mcp-server/tools/project/CreateProjectTool.d.ts +35 -0
- package/mcp-server/tools/project/CreateProjectTool.js +104 -0
- package/mcp-server/tools/project/DeployProject.d.ts +20 -0
- package/mcp-server/tools/project/DeployProject.js +50 -0
- package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +17 -0
- package/mcp-server/tools/project/GuidedWalkthroughTool.js +58 -0
- package/mcp-server/tools/project/UploadProjectTools.d.ts +17 -0
- package/mcp-server/tools/project/UploadProjectTools.js +35 -0
- package/mcp-server/tools/project/ValidateProjectTool.d.ts +17 -0
- package/mcp-server/tools/project/ValidateProjectTool.js +35 -0
- package/mcp-server/tools/project/constants.d.ts +3 -0
- package/mcp-server/tools/project/constants.js +13 -0
- package/mcp-server/types.d.ts +14 -0
- package/mcp-server/types.js +17 -0
- package/mcp-server/utils/command.d.ts +3 -0
- package/mcp-server/utils/command.js +16 -0
- package/mcp-server/utils/content.d.ts +3 -0
- package/mcp-server/utils/content.js +21 -0
- package/mcp-server/utils/project.d.ts +5 -0
- package/mcp-server/utils/project.js +17 -0
- package/package.json +24 -16
- package/types/Cms.d.ts +30 -0
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +35 -0
- package/types/LocalDev.js +2 -0
- package/types/Projects.d.ts +19 -2
- package/types/Prompts.d.ts +0 -7
- package/types/Yargs.d.ts +10 -1
- package/lib/projects/create.d.ts +0 -5
- package/lib/projects/localDev/LocalDevManagerV2.d.ts +0 -64
- package/lib/projects/localDev/LocalDevManagerV2.js +0 -345
- package/lib/prompts/installPublicAppPrompt.d.ts +0 -1
- package/lib/prompts/installPublicAppPrompt.js +0 -41
package/commands/hubdb.js
CHANGED
|
@@ -1,55 +1,33 @@
|
|
|
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
6
|
exports.describe = exports.command = void 0;
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const clearCommand = __importStar(require("./hubdb/clear"));
|
|
7
|
+
const create_1 = __importDefault(require("./hubdb/create"));
|
|
8
|
+
const fetch_1 = __importDefault(require("./hubdb/fetch"));
|
|
9
|
+
const delete_1 = __importDefault(require("./hubdb/delete"));
|
|
10
|
+
const clear_1 = __importDefault(require("./hubdb/clear"));
|
|
11
|
+
const list_1 = __importDefault(require("./hubdb/list"));
|
|
43
12
|
const lang_1 = require("../lib/lang");
|
|
13
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
44
14
|
exports.command = 'hubdb';
|
|
45
15
|
exports.describe = (0, lang_1.i18n)('commands.hubdb.describe');
|
|
46
|
-
function
|
|
47
|
-
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
16
|
+
function hubdbBuilder(yargs) {
|
|
48
17
|
yargs
|
|
49
|
-
.command(
|
|
50
|
-
.command(
|
|
51
|
-
.command(
|
|
52
|
-
.command(
|
|
18
|
+
.command(clear_1.default)
|
|
19
|
+
.command(create_1.default)
|
|
20
|
+
.command(fetch_1.default)
|
|
21
|
+
.command(delete_1.default)
|
|
22
|
+
.command(list_1.default)
|
|
53
23
|
.demandCommand(1, '');
|
|
54
24
|
return yargs;
|
|
55
25
|
}
|
|
26
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(hubdbBuilder, exports.command, exports.describe);
|
|
27
|
+
const hubdbCommand = {
|
|
28
|
+
command: exports.command,
|
|
29
|
+
describe: exports.describe,
|
|
30
|
+
builder,
|
|
31
|
+
handler: () => { },
|
|
32
|
+
};
|
|
33
|
+
exports.default = hubdbCommand;
|
package/commands/init.d.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ConfigArgs, CommonArgs, TestingArgs, AccountArgs } from '../types/Yargs';
|
|
3
|
-
export declare const command = "init";
|
|
4
|
-
export declare const describe: string;
|
|
1
|
+
import { ConfigArgs, CommonArgs, TestingArgs, AccountArgs, YargsCommandModule } from '../types/Yargs';
|
|
5
2
|
type InitArgs = CommonArgs & ConfigArgs & TestingArgs & AccountArgs & {
|
|
6
3
|
authType?: string;
|
|
7
4
|
'disable-tracking'?: boolean;
|
|
8
5
|
'use-hidden-config'?: boolean;
|
|
9
6
|
};
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
export {};
|
|
7
|
+
declare const initCommand: YargsCommandModule<unknown, InitArgs>;
|
|
8
|
+
export default initCommand;
|
package/commands/init.js
CHANGED
|
@@ -3,8 +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.builder = exports.describe = exports.command = void 0;
|
|
7
|
-
exports.handler = handler;
|
|
8
6
|
const path_1 = __importDefault(require("path"));
|
|
9
7
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
8
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
@@ -62,8 +60,8 @@ const AUTH_TYPE_NAMES = {
|
|
|
62
60
|
[auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value]: auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.name,
|
|
63
61
|
[auth_1.OAUTH_AUTH_METHOD.value]: auth_1.OAUTH_AUTH_METHOD.name,
|
|
64
62
|
};
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
const command = 'init';
|
|
64
|
+
const describe = (0, lang_1.i18n)(`commands.init.describe`);
|
|
67
65
|
async function handler(args) {
|
|
68
66
|
const { authType: authTypeFlagValue, c: configFlagValue, providedAccountId, disableTracking, useHiddenConfig, } = args;
|
|
69
67
|
const authType = (authTypeFlagValue && authTypeFlagValue.toLowerCase()) ||
|
|
@@ -78,9 +76,8 @@ async function handler(args) {
|
|
|
78
76
|
}
|
|
79
77
|
const env = args.qa ? environments_1.ENVIRONMENTS.QA : environments_1.ENVIRONMENTS.PROD;
|
|
80
78
|
if ((0, config_1.configFileExists)(true)) {
|
|
81
|
-
const globalConfigPath = (0, config_1.getConfigPath)('', true);
|
|
82
79
|
logger_1.logger.error((0, lang_1.i18n)(`commands.init.errors.globalConfigFileExists`, {
|
|
83
|
-
|
|
80
|
+
accountAuthCommand: (0, ui_1.uiCommandReference)('hs account auth'),
|
|
84
81
|
}));
|
|
85
82
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
86
83
|
}
|
|
@@ -135,7 +132,12 @@ async function handler(args) {
|
|
|
135
132
|
authType: AUTH_TYPE_NAMES[authType],
|
|
136
133
|
account: name || accountId,
|
|
137
134
|
}));
|
|
138
|
-
(0, ui_1.uiFeatureHighlight)([
|
|
135
|
+
(0, ui_1.uiFeatureHighlight)([
|
|
136
|
+
'getStartedCommand',
|
|
137
|
+
'helpCommand',
|
|
138
|
+
'authCommand',
|
|
139
|
+
'accountsListCommand',
|
|
140
|
+
]);
|
|
139
141
|
if (!disableTracking) {
|
|
140
142
|
await (0, usageTracking_1.trackAuthAction)('init', authType, TRACKING_STATUS.COMPLETE, accountId);
|
|
141
143
|
}
|
|
@@ -174,7 +176,7 @@ function initBuilder(yargs) {
|
|
|
174
176
|
yargs.conflicts('use-hidden-config', 'config');
|
|
175
177
|
return yargs;
|
|
176
178
|
}
|
|
177
|
-
|
|
179
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(initBuilder, command, (0, lang_1.i18n)(`commands.init.verboseDescribe`, {
|
|
178
180
|
command: (0, ui_1.uiCommandReference)('hs auth'),
|
|
179
181
|
configName: config_2.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME,
|
|
180
182
|
authMethod: auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value,
|
|
@@ -183,3 +185,10 @@ exports.builder = (0, yargsUtils_1.makeYargsBuilder)(initBuilder, exports.comman
|
|
|
183
185
|
useConfigOptions: true,
|
|
184
186
|
useTestingOptions: true,
|
|
185
187
|
});
|
|
188
|
+
const initCommand = {
|
|
189
|
+
command,
|
|
190
|
+
describe,
|
|
191
|
+
handler,
|
|
192
|
+
builder,
|
|
193
|
+
};
|
|
194
|
+
exports.default = initCommand;
|
package/commands/lint.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { AccountArgs, CommonArgs, ConfigArgs, YargsCommandModule } from '../types/Yargs';
|
|
2
|
+
type LintArgs = CommonArgs & ConfigArgs & AccountArgs & {
|
|
3
|
+
path: string;
|
|
4
|
+
};
|
|
5
|
+
declare const lintCommand: YargsCommandModule<unknown, LintArgs>;
|
|
6
|
+
export default lintCommand;
|
package/commands/lint.js
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const { EXIT_CODES } = require('../lib/enums/exitCodes');
|
|
13
|
-
exports.command = 'lint <path>';
|
|
3
|
+
const validate_1 = require("@hubspot/local-dev-lib/cms/validate");
|
|
4
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
5
|
+
const index_1 = require("../lib/errorHandlers/index");
|
|
6
|
+
const usageTracking_1 = require("../lib/usageTracking");
|
|
7
|
+
const lang_1 = require("../lib/lang");
|
|
8
|
+
const filesystem_1 = require("../lib/filesystem");
|
|
9
|
+
const exitCodes_1 = require("../lib/enums/exitCodes");
|
|
10
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
11
|
+
const command = 'lint <path>';
|
|
14
12
|
// Hiding since this command is still experimental
|
|
15
|
-
|
|
13
|
+
const describe = undefined; //'Lint a file or folder for HubL syntax';
|
|
16
14
|
function getErrorsFromHublValidationObject(validation) {
|
|
17
15
|
return ((validation && validation.meta && validation.meta.template_errors) || []);
|
|
18
16
|
}
|
|
19
17
|
function printHublValidationError(err) {
|
|
20
18
|
const { severity, message, lineno, startPosition } = err;
|
|
21
19
|
const method = severity === 'FATAL' ? 'error' : 'warn';
|
|
22
|
-
logger[method]('[%d, %d]: %s', lineno, startPosition, message);
|
|
20
|
+
logger_1.logger[method]('[%d, %d]: %s', lineno, startPosition, message);
|
|
23
21
|
}
|
|
24
22
|
function printHublValidationResult({ file, validation }) {
|
|
25
23
|
let count = 0;
|
|
@@ -30,7 +28,7 @@ function printHublValidationResult({ file, validation }) {
|
|
|
30
28
|
if (!errors.length) {
|
|
31
29
|
return count;
|
|
32
30
|
}
|
|
33
|
-
logger.group(file);
|
|
31
|
+
logger_1.logger.group(file);
|
|
34
32
|
errors.forEach(err => {
|
|
35
33
|
if (err.reason !== 'SYNTAX_ERROR') {
|
|
36
34
|
return;
|
|
@@ -38,49 +36,50 @@ function printHublValidationResult({ file, validation }) {
|
|
|
38
36
|
++count;
|
|
39
37
|
printHublValidationError(err);
|
|
40
38
|
});
|
|
41
|
-
logger.groupEnd();
|
|
39
|
+
logger_1.logger.groupEnd();
|
|
42
40
|
return count;
|
|
43
41
|
}
|
|
44
|
-
|
|
45
|
-
const { path: lintPath } =
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const groupName = i18n(`commands.lint.groupName`, {
|
|
42
|
+
async function handler(args) {
|
|
43
|
+
const { path: lintPath, derivedAccountId } = args;
|
|
44
|
+
const localPath = (0, filesystem_1.resolveLocalPath)(lintPath);
|
|
45
|
+
const groupName = (0, lang_1.i18n)(`commands.lint.groupName`, {
|
|
49
46
|
path: localPath,
|
|
50
47
|
});
|
|
51
|
-
trackCommandUsage('lint',
|
|
52
|
-
logger.group(groupName);
|
|
48
|
+
(0, usageTracking_1.trackCommandUsage)('lint', undefined, derivedAccountId);
|
|
49
|
+
logger_1.logger.group(groupName);
|
|
53
50
|
let count = 0;
|
|
54
51
|
try {
|
|
55
|
-
await lint(derivedAccountId, localPath, result => {
|
|
56
|
-
count += printHublValidationResult(result);
|
|
52
|
+
await (0, validate_1.lint)(derivedAccountId, localPath, (result) => {
|
|
53
|
+
return (count += printHublValidationResult(result));
|
|
57
54
|
});
|
|
58
55
|
}
|
|
59
56
|
catch (err) {
|
|
60
|
-
logger.groupEnd(
|
|
61
|
-
logError(err, { accountId: derivedAccountId });
|
|
62
|
-
process.exit(EXIT_CODES.ERROR);
|
|
57
|
+
logger_1.logger.groupEnd();
|
|
58
|
+
(0, index_1.logError)(err, { accountId: derivedAccountId });
|
|
59
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
63
60
|
}
|
|
64
|
-
logger.groupEnd(
|
|
65
|
-
logger.log(i18n(`commands.lint.issuesFound`, {
|
|
61
|
+
logger_1.logger.groupEnd();
|
|
62
|
+
logger_1.logger.log((0, lang_1.i18n)(`commands.lint.issuesFound`, {
|
|
66
63
|
count,
|
|
67
64
|
}));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const builder = yargs => {
|
|
71
|
-
addConfigOptions(yargs);
|
|
72
|
-
addAccountOptions(yargs);
|
|
73
|
-
addGlobalOptions(yargs);
|
|
65
|
+
}
|
|
66
|
+
function lintBuilder(yargs) {
|
|
74
67
|
yargs.positional('path', {
|
|
75
|
-
describe: i18n(`commands.lint.positionals.path.describe`),
|
|
68
|
+
describe: (0, lang_1.i18n)(`commands.lint.positionals.path.describe`),
|
|
69
|
+
required: true,
|
|
76
70
|
type: 'string',
|
|
77
71
|
});
|
|
78
72
|
return yargs;
|
|
73
|
+
}
|
|
74
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(lintBuilder, command, describe, {
|
|
75
|
+
useGlobalOptions: true,
|
|
76
|
+
useConfigOptions: true,
|
|
77
|
+
useAccountOptions: true,
|
|
78
|
+
});
|
|
79
|
+
const lintCommand = {
|
|
80
|
+
command,
|
|
81
|
+
describe,
|
|
82
|
+
handler,
|
|
83
|
+
builder,
|
|
79
84
|
};
|
|
80
|
-
exports.
|
|
81
|
-
module.exports = {
|
|
82
|
-
builder: exports.builder,
|
|
83
|
-
handler: exports.handler,
|
|
84
|
-
command: exports.command,
|
|
85
|
-
describe: exports.describe,
|
|
86
|
-
};
|
|
85
|
+
exports.default = lintCommand;
|
package/commands/list.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs } from '../types/Yargs';
|
|
3
|
-
export declare const command = "list [path]";
|
|
4
|
-
export declare const describe: string;
|
|
1
|
+
import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs, YargsCommandModule } from '../types/Yargs';
|
|
5
2
|
type ListArgs = CommonArgs & ConfigArgs & EnvironmentArgs & AccountArgs & {
|
|
6
3
|
path: string;
|
|
7
4
|
};
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export {};
|
|
5
|
+
declare const cmsListCommand: YargsCommandModule<unknown, ListArgs>;
|
|
6
|
+
export default cmsListCommand;
|
package/commands/list.js
CHANGED
|
@@ -3,11 +3,7 @@ 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 chalk_1 = __importDefault(require("chalk"));
|
|
10
|
-
const commonOpts_1 = require("../lib/commonOpts");
|
|
11
7
|
const usageTracking_1 = require("../lib/usageTracking");
|
|
12
8
|
const filesystem_1 = require("../lib/filesystem");
|
|
13
9
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
@@ -16,6 +12,7 @@ const fileMapper_1 = require("@hubspot/local-dev-lib/api/fileMapper");
|
|
|
16
12
|
const constants_1 = require("../lib/constants");
|
|
17
13
|
const lang_1 = require("../lib/lang");
|
|
18
14
|
const exitCodes_1 = require("../lib/enums/exitCodes");
|
|
15
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
19
16
|
function addColorToContents(fileOrFolder) {
|
|
20
17
|
if (!(0, filesystem_1.isPathFolder)(fileOrFolder)) {
|
|
21
18
|
return chalk_1.default.reset.cyan(fileOrFolder);
|
|
@@ -42,8 +39,8 @@ function sortContents(a, b) {
|
|
|
42
39
|
}
|
|
43
40
|
return a.localeCompare(b);
|
|
44
41
|
}
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
const command = ['list [path]', 'ls [path]'];
|
|
43
|
+
const describe = (0, lang_1.i18n)(`commands.list.describe`);
|
|
47
44
|
async function handler(args) {
|
|
48
45
|
const { path, derivedAccountId } = args;
|
|
49
46
|
const directoryPath = path || '/';
|
|
@@ -83,11 +80,7 @@ async function handler(args) {
|
|
|
83
80
|
logger_1.logger.log(folderContentsOutput);
|
|
84
81
|
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
85
82
|
}
|
|
86
|
-
function
|
|
87
|
-
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
88
|
-
(0, commonOpts_1.addAccountOptions)(yargs);
|
|
89
|
-
(0, commonOpts_1.addUseEnvironmentOptions)(yargs);
|
|
90
|
-
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
83
|
+
function cmsListBuilder(yargs) {
|
|
91
84
|
yargs.positional('path', {
|
|
92
85
|
describe: (0, lang_1.i18n)(`commands.list.positionals.path.describe`),
|
|
93
86
|
type: 'string',
|
|
@@ -95,3 +88,16 @@ function builder(yargs) {
|
|
|
95
88
|
yargs.example([['$0 list'], ['$0 list /'], ['$0 list my-modules']]);
|
|
96
89
|
return yargs;
|
|
97
90
|
}
|
|
91
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(cmsListBuilder, command, describe, {
|
|
92
|
+
useGlobalOptions: true,
|
|
93
|
+
useConfigOptions: true,
|
|
94
|
+
useAccountOptions: true,
|
|
95
|
+
useEnvironmentOptions: true,
|
|
96
|
+
});
|
|
97
|
+
const cmsListCommand = {
|
|
98
|
+
command,
|
|
99
|
+
describe,
|
|
100
|
+
handler,
|
|
101
|
+
builder,
|
|
102
|
+
};
|
|
103
|
+
exports.default = cmsListCommand;
|
package/commands/logs.d.ts
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, YargsCommandModule, EnvironmentArgs } from '../types/Yargs';
|
|
2
|
+
type LogsArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
|
+
endpoint?: string;
|
|
4
|
+
latest?: boolean;
|
|
5
|
+
compact?: boolean;
|
|
6
|
+
follow?: boolean;
|
|
7
|
+
limit?: number;
|
|
8
|
+
};
|
|
9
|
+
declare const logsCommand: YargsCommandModule<unknown, LogsArgs>;
|
|
10
|
+
export default logsCommand;
|
package/commands/logs.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
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 { isHubSpotHttpError } = require('@hubspot/local-dev-lib/errors/index');
|
|
3
|
+
const usageTracking_1 = require("../lib/usageTracking");
|
|
4
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
5
|
+
const serverlessFunctionLogs_1 = require("../lib/ui/serverlessFunctionLogs");
|
|
6
|
+
const functions_1 = require("@hubspot/local-dev-lib/api/functions");
|
|
7
|
+
const serverlessLogs_1 = require("../lib/serverlessLogs");
|
|
8
|
+
const lang_1 = require("../lib/lang");
|
|
9
|
+
const promptUtils_1 = require("../lib/prompts/promptUtils");
|
|
10
|
+
const exitCodes_1 = require("../lib/enums/exitCodes");
|
|
11
|
+
const index_1 = require("@hubspot/local-dev-lib/errors/index");
|
|
12
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
14
13
|
const handleLogsError = (e, accountId, functionPath) => {
|
|
15
|
-
if (isHubSpotHttpError(e) && (e.status === 404 || e.status == 400)) {
|
|
16
|
-
logger.error(i18n(`commands.logs.errors.noLogsFound`, {
|
|
14
|
+
if ((0, index_1.isHubSpotHttpError)(e) && (e.status === 404 || e.status == 400)) {
|
|
15
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.logs.errors.noLogsFound`, {
|
|
17
16
|
accountId,
|
|
18
17
|
functionPath,
|
|
19
18
|
}));
|
|
@@ -21,101 +20,111 @@ const handleLogsError = (e, accountId, functionPath) => {
|
|
|
21
20
|
};
|
|
22
21
|
const endpointLog = async (accountId, functionPath, options) => {
|
|
23
22
|
const { limit, latest, follow, compact } = options;
|
|
24
|
-
const
|
|
23
|
+
const requestParams = {
|
|
25
24
|
limit,
|
|
26
25
|
latest,
|
|
27
26
|
follow,
|
|
28
|
-
compact,
|
|
29
27
|
endpoint: functionPath,
|
|
30
28
|
};
|
|
31
|
-
logger.debug(i18n(`commands.logs.gettingLogs`, {
|
|
29
|
+
logger_1.logger.debug((0, lang_1.i18n)(`commands.logs.gettingLogs`, {
|
|
32
30
|
latest,
|
|
33
31
|
functionPath,
|
|
34
32
|
}));
|
|
35
33
|
let logsResp;
|
|
36
34
|
if (follow) {
|
|
37
|
-
const tailCall = after => getFunctionLogs(accountId, functionPath, { after });
|
|
35
|
+
const tailCall = (after) => (0, functions_1.getFunctionLogs)(accountId, functionPath, { after });
|
|
38
36
|
const fetchLatest = () => {
|
|
39
37
|
try {
|
|
40
|
-
return getLatestFunctionLog(accountId, functionPath);
|
|
38
|
+
return (0, functions_1.getLatestFunctionLog)(accountId, functionPath);
|
|
41
39
|
}
|
|
42
40
|
catch (e) {
|
|
43
41
|
handleLogsError(e, accountId, functionPath);
|
|
42
|
+
return Promise.reject(e);
|
|
44
43
|
}
|
|
45
44
|
};
|
|
46
|
-
await tailLogs(accountId, functionPath, fetchLatest, tailCall, compact);
|
|
45
|
+
await (0, serverlessLogs_1.tailLogs)(accountId, functionPath, fetchLatest, tailCall, compact);
|
|
47
46
|
}
|
|
48
47
|
else if (latest) {
|
|
49
48
|
try {
|
|
50
|
-
const { data } = await getLatestFunctionLog(accountId, functionPath);
|
|
49
|
+
const { data } = await (0, functions_1.getLatestFunctionLog)(accountId, functionPath);
|
|
51
50
|
logsResp = data;
|
|
52
51
|
}
|
|
53
52
|
catch (e) {
|
|
54
53
|
handleLogsError(e, accountId, functionPath);
|
|
55
|
-
process.exit(EXIT_CODES.ERROR);
|
|
54
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
else {
|
|
59
58
|
try {
|
|
60
|
-
const { data } = await getFunctionLogs(accountId, functionPath,
|
|
59
|
+
const { data } = await (0, functions_1.getFunctionLogs)(accountId, functionPath, requestParams);
|
|
61
60
|
logsResp = data;
|
|
62
61
|
}
|
|
63
62
|
catch (e) {
|
|
64
63
|
handleLogsError(e, accountId, functionPath);
|
|
65
|
-
process.exit(EXIT_CODES.ERROR);
|
|
64
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
if (logsResp) {
|
|
69
|
-
return outputLogs(logsResp,
|
|
68
|
+
return (0, serverlessFunctionLogs_1.outputLogs)(logsResp, { compact });
|
|
70
69
|
}
|
|
71
70
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
const command = 'logs [endpoint]';
|
|
72
|
+
const describe = (0, lang_1.i18n)(`commands.logs.describe`);
|
|
73
|
+
const handler = async (options) => {
|
|
75
74
|
const { endpoint: endpointArgValue, latest, derivedAccountId } = options;
|
|
76
|
-
trackCommandUsage('logs', { latest }, derivedAccountId);
|
|
77
|
-
const { endpointPromptValue } = await promptUser({
|
|
75
|
+
(0, usageTracking_1.trackCommandUsage)('logs', latest ? { action: 'latest' } : {}, derivedAccountId);
|
|
76
|
+
const { endpointPromptValue } = await (0, promptUtils_1.promptUser)({
|
|
78
77
|
name: 'endpointPromptValue',
|
|
79
|
-
message: i18n(`commands.logs.endpointPrompt`),
|
|
78
|
+
message: (0, lang_1.i18n)(`commands.logs.endpointPrompt`),
|
|
80
79
|
when: !endpointArgValue,
|
|
81
80
|
});
|
|
82
|
-
endpointLog(derivedAccountId, endpointArgValue || endpointPromptValue, options);
|
|
81
|
+
await endpointLog(derivedAccountId, endpointArgValue || endpointPromptValue, options);
|
|
83
82
|
};
|
|
84
|
-
|
|
83
|
+
function logsBuilder(yargs) {
|
|
85
84
|
yargs.positional('endpoint', {
|
|
86
|
-
describe: i18n(`commands.logs.positionals.endpoint.describe`),
|
|
85
|
+
describe: (0, lang_1.i18n)(`commands.logs.positionals.endpoint.describe`),
|
|
87
86
|
type: 'string',
|
|
88
87
|
});
|
|
89
88
|
yargs
|
|
90
89
|
.options({
|
|
91
90
|
latest: {
|
|
92
91
|
alias: 'l',
|
|
93
|
-
describe: i18n(`commands.logs.options.latest.describe`),
|
|
92
|
+
describe: (0, lang_1.i18n)(`commands.logs.options.latest.describe`),
|
|
94
93
|
type: 'boolean',
|
|
95
94
|
},
|
|
96
95
|
compact: {
|
|
97
|
-
describe: i18n(`commands.logs.options.compact.describe`),
|
|
96
|
+
describe: (0, lang_1.i18n)(`commands.logs.options.compact.describe`),
|
|
98
97
|
type: 'boolean',
|
|
99
98
|
},
|
|
100
99
|
follow: {
|
|
101
100
|
alias: ['f'],
|
|
102
|
-
describe: i18n(`commands.logs.options.follow.describe`),
|
|
101
|
+
describe: (0, lang_1.i18n)(`commands.logs.options.follow.describe`),
|
|
103
102
|
type: 'boolean',
|
|
104
103
|
},
|
|
105
104
|
limit: {
|
|
106
|
-
describe: i18n(`commands.logs.options.limit.describe`),
|
|
105
|
+
describe: (0, lang_1.i18n)(`commands.logs.options.limit.describe`),
|
|
107
106
|
type: 'number',
|
|
108
107
|
},
|
|
109
108
|
})
|
|
110
109
|
.conflicts('follow', 'limit');
|
|
111
110
|
yargs.example([
|
|
112
|
-
['$0 logs my-endpoint', i18n(`commands.logs.examples.default`)],
|
|
113
|
-
['$0 logs my-endpoint --limit=10', i18n(`commands.logs.examples.limit`)],
|
|
114
|
-
['$0 logs my-endpoint --follow', i18n(`commands.logs.examples.follow`)],
|
|
111
|
+
['$0 logs my-endpoint', (0, lang_1.i18n)(`commands.logs.examples.default`)],
|
|
112
|
+
['$0 logs my-endpoint --limit=10', (0, lang_1.i18n)(`commands.logs.examples.limit`)],
|
|
113
|
+
['$0 logs my-endpoint --follow', (0, lang_1.i18n)(`commands.logs.examples.follow`)],
|
|
115
114
|
]);
|
|
116
|
-
addConfigOptions(yargs);
|
|
117
|
-
addAccountOptions(yargs);
|
|
118
|
-
addUseEnvironmentOptions(yargs);
|
|
119
|
-
addGlobalOptions(yargs);
|
|
120
115
|
return yargs;
|
|
116
|
+
}
|
|
117
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(logsBuilder, command, describe, {
|
|
118
|
+
useGlobalOptions: true,
|
|
119
|
+
useConfigOptions: true,
|
|
120
|
+
useAccountOptions: true,
|
|
121
|
+
useEnvironmentOptions: true,
|
|
122
|
+
});
|
|
123
|
+
const logsCommand = {
|
|
124
|
+
command,
|
|
125
|
+
describe,
|
|
126
|
+
builder,
|
|
127
|
+
handler,
|
|
121
128
|
};
|
|
129
|
+
exports.default = logsCommand;
|
|
130
|
+
module.exports = logsCommand;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommonArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
|
+
interface MCPSetupArgs extends CommonArgs {
|
|
3
|
+
client?: string[];
|
|
4
|
+
addDocsSearch?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const mcpSetupCommand: YargsCommandModule<unknown, MCPSetupArgs>;
|
|
7
|
+
export default mcpSetupCommand;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
4
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
5
|
+
const en_1 = require("../../lang/en");
|
|
6
|
+
const logger_1 = require("../../lib/ui/logger");
|
|
7
|
+
const setup_1 = require("../../lib/mcp/setup");
|
|
8
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
9
|
+
const command = ['setup', 'update'];
|
|
10
|
+
const describe = undefined; // Leave hidden for now
|
|
11
|
+
async function handler(args) {
|
|
12
|
+
try {
|
|
13
|
+
await import('@modelcontextprotocol/sdk/server/mcp.js');
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
logger_1.uiLogger.error(en_1.commands.mcp.setup.errors.needsNode20);
|
|
17
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
18
|
+
}
|
|
19
|
+
(0, usageTracking_1.trackCommandUsage)('mcp-setup', {}, args.derivedAccountId);
|
|
20
|
+
try {
|
|
21
|
+
const derivedTargets = await (0, setup_1.addMcpServerToConfig)(args.client);
|
|
22
|
+
if (args.addDocsSearch) {
|
|
23
|
+
await (0, setup_1.addMintlifyMcpServer)(derivedTargets);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
28
|
+
}
|
|
29
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
30
|
+
}
|
|
31
|
+
function setupBuilder(yargs) {
|
|
32
|
+
yargs
|
|
33
|
+
.option('client', {
|
|
34
|
+
describe: en_1.commands.mcp.setup.args.client,
|
|
35
|
+
type: 'array',
|
|
36
|
+
choices: [...setup_1.supportedTools.map(tool => tool.value)],
|
|
37
|
+
})
|
|
38
|
+
.option('add-docs-search', {
|
|
39
|
+
type: 'boolean',
|
|
40
|
+
});
|
|
41
|
+
return yargs;
|
|
42
|
+
}
|
|
43
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(setupBuilder, command, describe, {
|
|
44
|
+
useGlobalOptions: true,
|
|
45
|
+
});
|
|
46
|
+
const mcpSetupCommand = {
|
|
47
|
+
command,
|
|
48
|
+
describe,
|
|
49
|
+
handler,
|
|
50
|
+
builder,
|
|
51
|
+
};
|
|
52
|
+
exports.default = mcpSetupCommand;
|