@hubspot/cli 8.3.1-experimental.0 → 8.3.1-experimental.2
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/api/feedback.d.ts +10 -0
- package/api/feedback.js +9 -0
- package/bin/cli.js +19 -1
- package/commands/account/auth.js +2 -2
- package/commands/account/createOverride.js +2 -0
- package/commands/account/removeOverride.js +2 -0
- package/commands/app/secret/add.js +1 -1
- package/commands/app/secret/delete.js +1 -1
- package/commands/app/secret/list.js +1 -1
- package/commands/app/secret/update.js +1 -1
- package/commands/app/secret.js +1 -1
- package/commands/auth.js +3 -2
- package/commands/cms/function/create.js +5 -37
- package/commands/cms/function/deploy.js +8 -1
- package/commands/cms/function/list.js +4 -0
- package/commands/cms/function/logs.js +2 -0
- package/commands/cms/function/server.js +6 -0
- package/commands/cms/lighthouseScore.js +1 -1
- package/commands/cms/upload.js +6 -0
- package/commands/cms/watch.js +2 -0
- package/commands/cms/webpack/create.js +5 -32
- package/commands/customObject.js +2 -2
- package/commands/feedback.d.ts +6 -2
- package/commands/feedback.js +82 -8
- package/commands/getStarted.js +4 -4
- package/commands/hubdb/list.js +2 -2
- package/commands/init.js +3 -2
- package/commands/mcp/setup.d.ts +1 -0
- package/commands/mcp/setup.js +11 -3
- package/commands/project/dev/index.js +2 -2
- package/commands/project/download.d.ts +2 -0
- package/commands/project/download.js +56 -16
- package/commands/project/logs.js +2 -2
- package/commands/project/upload.js +6 -2
- package/commands/project/watch.js +2 -2
- package/commands/sandbox/create.js +3 -3
- package/commands/sandbox/delete.js +1 -1
- package/commands/sandbox.js +1 -1
- package/lang/en.d.ts +111 -6
- package/lang/en.js +275 -51
- package/lib/accountAuth.js +12 -0
- package/lib/accountCredentials.d.ts +1 -0
- package/lib/accountCredentials.js +25 -0
- package/lib/agentHelp.d.ts +17 -0
- package/lib/agentHelp.js +90 -0
- package/lib/app/logSystemTypes.d.ts +4 -0
- package/lib/app/logSystemTypes.js +17 -0
- package/lib/app/logs.d.ts +2 -4
- package/lib/app/logs.js +2 -17
- package/lib/app/migrate.js +5 -8
- package/lib/commonOpts.js +4 -0
- package/lib/constants.d.ts +4 -0
- package/lib/constants.js +6 -0
- package/lib/crossPlatformSpawn/escape.d.ts +2 -0
- package/lib/crossPlatformSpawn/escape.js +38 -0
- package/lib/crossPlatformSpawn/index.d.ts +7 -0
- package/lib/crossPlatformSpawn/index.js +43 -0
- package/lib/crossPlatformSpawn/resolveCommand.d.ts +1 -0
- package/lib/crossPlatformSpawn/resolveCommand.js +69 -0
- package/lib/errorHandlers/suppressError.js +3 -3
- package/lib/feedback.d.ts +3 -0
- package/lib/feedback.js +13 -0
- package/lib/jsonOutput/projectDownload.d.ts +1 -0
- package/lib/jsonOutput/projectDownload.js +1 -0
- package/lib/jsonOutput/projectUpload.d.ts +1 -0
- package/lib/jsonOutput/projectUpload.js +1 -0
- package/lib/mcp/clients.d.ts +2 -1
- package/lib/mcp/clients.js +7 -7
- package/lib/mcp/setup.d.ts +7 -2
- package/lib/mcp/setup.js +22 -37
- package/lib/mcp/skills.d.ts +8 -0
- package/lib/mcp/skills.js +64 -0
- package/lib/projects/archive.d.ts +8 -0
- package/lib/projects/archive.js +104 -0
- package/lib/projects/archiveDiff.d.ts +12 -0
- package/lib/projects/archiveDiff.js +68 -0
- package/lib/projects/config.js +1 -1
- package/lib/projects/download.d.ts +37 -0
- package/lib/projects/download.js +123 -0
- package/lib/projects/localDev/AppDevModeInterface.js +3 -3
- package/lib/projects/localDev/LocalDevLogger.js +5 -5
- package/lib/projects/localDev/LocalDevWatcher.js +2 -1
- package/lib/projects/localDev/helpers/project.js +3 -3
- package/lib/projects/pollProjectBuildAndDeploy.js +4 -4
- package/lib/projects/projectInfo.js +4 -4
- package/lib/projects/projectProfiles.js +3 -3
- package/lib/projects/ui.js +3 -3
- package/lib/projects/upload.d.ts +3 -1
- package/lib/projects/upload.js +23 -6
- package/lib/projects/watch.js +4 -2
- package/lib/projects/workspaces.js +4 -4
- package/lib/prompts/importDataTestAccountSelectPrompt.js +1 -1
- package/lib/prompts/personalAccessKeyPrompt.js +2 -2
- package/lib/prompts/selectPublicAppForMigrationPrompt.js +3 -3
- package/lib/serverlessSunset.d.ts +6 -0
- package/lib/serverlessSunset.js +32 -0
- package/lib/testUtils.d.ts +5 -1
- package/lib/testUtils.js +2 -2
- package/lib/ui/appLogs.js +4 -4
- package/lib/ui/formatting.d.ts +13 -0
- package/lib/ui/formatting.js +39 -0
- package/lib/ui/git.js +3 -3
- package/lib/ui/index.d.ts +9 -23
- package/lib/ui/index.js +36 -69
- package/lib/ui/uiMessages.js +1 -1
- package/lib/validation.js +16 -1
- package/lib/yargs/makeWrappedYargsHandler.d.ts +1 -0
- package/lib/yargs/makeWrappedYargsHandler.js +7 -0
- package/mcp-server/Tool.d.ts +1 -0
- package/mcp-server/Tool.js +4 -1
- package/mcp-server/server.js +16 -5
- package/mcp-server/skills/hubspot-fix-build/SKILL.md +61 -0
- package/mcp-server/skills/hubspot-new-app/SKILL.md +84 -0
- package/mcp-server/tools/cms/HsFunctionLogsTool.js +2 -2
- package/mcp-server/tools/cms/HsListFunctionsTool.js +1 -1
- package/mcp-server/tools/cms/HsListTool.js +4 -1
- package/mcp-server/tools/index.js +2 -2
- package/mcp-server/tools/project/DocFetchTool.d.ts +4 -1
- package/mcp-server/tools/project/DocFetchTool.js +53 -12
- package/mcp-server/tools/project/DocsSearchTool.js +2 -7
- package/mcp-server/tools/project/FindProjectsTool.js +4 -1
- package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.js +2 -7
- package/mcp-server/tools/project/GetApplicationInfoTool.js +2 -7
- package/mcp-server/tools/project/GetBuildLogsTool.d.ts +1 -1
- package/mcp-server/tools/project/GetBuildLogsTool.js +2 -12
- package/mcp-server/tools/project/GetBuildStatusTool.js +2 -12
- package/mcp-server/tools/project/KnowledgeSearchTool.js +2 -5
- package/mcp-server/tools/project/SubmitFeedbackTool.d.ts +25 -0
- package/mcp-server/tools/project/SubmitFeedbackTool.js +73 -0
- package/mcp-server/utils/command.js +16 -5
- package/mcp-server/utils/errors.d.ts +1 -0
- package/mcp-server/utils/errors.js +9 -0
- package/mcp-server/utils/feedbackTracking.js +3 -1
- package/package.json +12 -14
- package/mcp-server/tools/cms/HsCreateFunctionTool.d.ts +0 -26
- package/mcp-server/tools/cms/HsCreateFunctionTool.js +0 -100
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { Tool } from '../../Tool.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { absoluteCurrentWorkingDirectory } from '../project/constants.js';
|
|
4
|
-
import { formatTextContents, formatTextContent } from '../../utils/content.js';
|
|
5
|
-
import { HTTP_METHODS } from '../../../types/Cms.js';
|
|
6
|
-
import { HubSpotCommand } from '../../utils/command.js';
|
|
7
|
-
import { setupHubSpotConfig } from '../../utils/config.js';
|
|
8
|
-
import { getErrorMessage } from '../../../lib/errorHandlers/index.js';
|
|
9
|
-
const inputSchema = {
|
|
10
|
-
absoluteCurrentWorkingDirectory,
|
|
11
|
-
dest: z
|
|
12
|
-
.string()
|
|
13
|
-
.describe('The destination path where the function should be created on the current computer.')
|
|
14
|
-
.optional(),
|
|
15
|
-
functionsFolder: z
|
|
16
|
-
.string()
|
|
17
|
-
.describe('Folder name for function creation. Required for non-interactive function creation. If the user has not specified the folder name, ask them to provide it.')
|
|
18
|
-
.optional(),
|
|
19
|
-
filename: z
|
|
20
|
-
.string()
|
|
21
|
-
.describe('Function filename. Required for non-interactive function creation. If the user has not specified the filename, ask them to provide it.')
|
|
22
|
-
.optional(),
|
|
23
|
-
endpointMethod: z
|
|
24
|
-
.enum(HTTP_METHODS)
|
|
25
|
-
.describe(`HTTP method for the function endpoint. Must be one of: ${HTTP_METHODS.join(', ')}. Defaults to GET.`)
|
|
26
|
-
.optional(),
|
|
27
|
-
endpointPath: z
|
|
28
|
-
.string()
|
|
29
|
-
.describe('API endpoint path for the function. Required for non-interactive function creation. If the user has not specified the endpoint path, ask them to provide it.')
|
|
30
|
-
.optional(),
|
|
31
|
-
};
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
33
|
-
const inputSchemaZodObject = z.object({ ...inputSchema });
|
|
34
|
-
const toolName = 'create-cms-function';
|
|
35
|
-
export class HsCreateFunctionTool extends Tool {
|
|
36
|
-
constructor(mcpServer, logger) {
|
|
37
|
-
super(mcpServer, logger, toolName);
|
|
38
|
-
}
|
|
39
|
-
async handler({ dest, functionsFolder, filename, endpointMethod, endpointPath, absoluteCurrentWorkingDirectory, }, extra) {
|
|
40
|
-
setupHubSpotConfig(absoluteCurrentWorkingDirectory);
|
|
41
|
-
const content = [];
|
|
42
|
-
// Require functions folder
|
|
43
|
-
if (!functionsFolder) {
|
|
44
|
-
content.push(formatTextContent(`Ask the user to provide the folder name for the function.`));
|
|
45
|
-
}
|
|
46
|
-
// Require filename
|
|
47
|
-
if (!filename) {
|
|
48
|
-
content.push(formatTextContent(`Ask the user to provide the filename for the function.`));
|
|
49
|
-
}
|
|
50
|
-
// Require endpoint path
|
|
51
|
-
if (!endpointPath) {
|
|
52
|
-
content.push(formatTextContent(`Ask the user to provide the API endpoint path for the function.`));
|
|
53
|
-
}
|
|
54
|
-
// If we have missing required information, return the prompts
|
|
55
|
-
if (content.length > 0) {
|
|
56
|
-
return {
|
|
57
|
-
content,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
// Build the command
|
|
61
|
-
const command = new HubSpotCommand('cms function create');
|
|
62
|
-
if (dest) {
|
|
63
|
-
command.addArg(dest);
|
|
64
|
-
}
|
|
65
|
-
if (functionsFolder) {
|
|
66
|
-
command.addFlag('functions-folder', functionsFolder);
|
|
67
|
-
}
|
|
68
|
-
if (filename) {
|
|
69
|
-
command.addFlag('filename', filename);
|
|
70
|
-
}
|
|
71
|
-
command.addFlag('endpoint-method', endpointMethod ?? 'GET');
|
|
72
|
-
if (endpointPath) {
|
|
73
|
-
command.addFlag('endpoint-path', endpointPath);
|
|
74
|
-
}
|
|
75
|
-
try {
|
|
76
|
-
const { stdout, stderr } = await this.runCommand(absoluteCurrentWorkingDirectory, command, extra);
|
|
77
|
-
return formatTextContents(stdout, stderr);
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
this.logger.debug(toolName, {
|
|
81
|
-
message: 'Handler caught error',
|
|
82
|
-
error: error instanceof Error ? error.message : String(error),
|
|
83
|
-
});
|
|
84
|
-
return formatTextContents(getErrorMessage(error));
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
register() {
|
|
88
|
-
return this.mcpServer.registerTool(toolName, {
|
|
89
|
-
title: 'Create HubSpot CMS Serverless Function',
|
|
90
|
-
description: `Creates a new HubSpot CMS serverless function using the hs cms function create command. This is for CMS/website projects, served at /hs/serverless/<path>. Do NOT use this for developer-platform app functions (the private app-function feature or the public app-function-endpoint feature). For those, use add-feature-to-project. Functions can be created non-interactively by specifying functionsFolder, filename, and endpointPath. Supports all HTTP methods (${HTTP_METHODS.join(', ')}).`,
|
|
91
|
-
inputSchema,
|
|
92
|
-
annotations: {
|
|
93
|
-
readOnlyHint: false,
|
|
94
|
-
destructiveHint: false,
|
|
95
|
-
idempotentHint: false,
|
|
96
|
-
openWorldHint: false,
|
|
97
|
-
},
|
|
98
|
-
}, (input, extra) => this.wrappedHandler(input, extra));
|
|
99
|
-
}
|
|
100
|
-
}
|