@hubspot/cli 7.11.1-experimental.0 → 7.11.2-beta.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.
Files changed (39) hide show
  1. package/bin/hs.d.ts +2 -0
  2. package/bin/hscms.d.ts +2 -0
  3. package/commands/cms/__tests__/module.test.d.ts +1 -0
  4. package/commands/cms/__tests__/module.test.js +45 -0
  5. package/commands/cms/module.js +5 -1
  6. package/lang/en.d.ts +1 -0
  7. package/lang/en.js +1 -0
  8. package/lib/app/migrate.js +3 -1
  9. package/lib/middleware/autoUpdateMiddleware.js +1 -1
  10. package/lib/middleware/configMiddleware.js +4 -2
  11. package/lib/middleware/gitMiddleware.js +4 -2
  12. package/lib/projects/upload.js +6 -1
  13. package/mcp-server/server.js +0 -4
  14. package/mcp-server/tools/cms/HsCreateFunctionTool.d.ts +8 -16
  15. package/mcp-server/tools/cms/HsCreateModuleTool.d.ts +2 -20
  16. package/mcp-server/tools/cms/HsCreateTemplateTool.d.ts +11 -12
  17. package/mcp-server/tools/cms/HsFunctionLogsTool.d.ts +1 -15
  18. package/mcp-server/tools/cms/HsListFunctionsTool.d.ts +1 -9
  19. package/mcp-server/tools/cms/HsListTool.d.ts +1 -9
  20. package/mcp-server/tools/project/AddFeatureToProjectTool.d.ts +4 -18
  21. package/mcp-server/tools/project/CreateProjectTool.d.ts +5 -21
  22. package/mcp-server/tools/project/CreateTestAccountTool.d.ts +31 -26
  23. package/mcp-server/tools/project/DeployProjectTool.d.ts +1 -9
  24. package/mcp-server/tools/project/DocFetchTool.d.ts +1 -7
  25. package/mcp-server/tools/project/DocsSearchTool.d.ts +1 -7
  26. package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.d.ts +1 -11
  27. package/mcp-server/tools/project/GetApplicationInfoTool.d.ts +1 -5
  28. package/mcp-server/tools/project/GetBuildLogsTool.d.ts +7 -12
  29. package/mcp-server/tools/project/GetBuildStatusTool.d.ts +1 -11
  30. package/mcp-server/tools/project/GetConfigValuesTool.d.ts +1 -9
  31. package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +2 -8
  32. package/mcp-server/tools/project/UploadProjectTools.d.ts +1 -11
  33. package/mcp-server/tools/project/ValidateProjectTool.d.ts +1 -7
  34. package/mcp-server/tools/project/__tests__/CreateTestAccountTool.test.js +0 -11
  35. package/mcp-server/tools/project/constants.d.ts +1 -1
  36. package/package.json +7 -6
  37. package/ui/components/BoxWithTitle.js +1 -1
  38. /package/bin/{hs → hs.js} +0 -0
  39. /package/bin/{hscms → hscms.js} +0 -0
package/bin/hs.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/bin/hscms.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,45 @@
1
+ import yargs from 'yargs';
2
+ import createCommand from '../module/create.js';
3
+ import marketplaceValidateCommand from '../module/marketplace-validate.js';
4
+ import moduleCommands from '../module.js';
5
+ vi.mock('../module/create');
6
+ vi.mock('../module/marketplace-validate');
7
+ vi.mock('../../lib/commonOpts');
8
+ const commandSpy = vi
9
+ .spyOn(yargs, 'command')
10
+ .mockReturnValue(yargs);
11
+ const demandCommandSpy = vi
12
+ .spyOn(yargs, 'demandCommand')
13
+ .mockReturnValue(yargs);
14
+ describe('commands/cms/module', () => {
15
+ describe('command', () => {
16
+ it('should have the correct command structure', () => {
17
+ expect(moduleCommands.command).toEqual('module');
18
+ });
19
+ });
20
+ describe('describe', () => {
21
+ it('should provide a description', () => {
22
+ expect(moduleCommands.describe).toBeDefined();
23
+ });
24
+ });
25
+ describe('builder', () => {
26
+ beforeEach(() => {
27
+ commandSpy.mockClear();
28
+ demandCommandSpy.mockClear();
29
+ });
30
+ const subcommands = [createCommand, marketplaceValidateCommand];
31
+ it('should demand the command takes one positional argument', () => {
32
+ moduleCommands.builder(yargs);
33
+ expect(demandCommandSpy).toHaveBeenCalledTimes(1);
34
+ expect(demandCommandSpy).toHaveBeenCalledWith(1, '');
35
+ });
36
+ it('should add the correct number of sub commands', () => {
37
+ moduleCommands.builder(yargs);
38
+ expect(commandSpy).toHaveBeenCalledTimes(subcommands.length);
39
+ });
40
+ it.each(subcommands)('should attach the %s subcommand', module => {
41
+ moduleCommands.builder(yargs);
42
+ expect(commandSpy).toHaveBeenCalledWith(module);
43
+ });
44
+ });
45
+ });
@@ -1,10 +1,14 @@
1
1
  import createCommand from './module/create.js';
2
+ import marketplaceValidateCommand from './module/marketplace-validate.js';
2
3
  import { commands } from '../../lang/en.js';
3
4
  import { makeYargsBuilder } from '../../lib/yargsUtils.js';
4
5
  const command = 'module';
5
6
  const describe = commands.cms.subcommands.module.describe;
6
7
  function moduleBuilder(yargs) {
7
- yargs.command(createCommand).demandCommand(1, '');
8
+ yargs
9
+ .command(createCommand)
10
+ .command(marketplaceValidateCommand)
11
+ .demandCommand(1, '');
8
12
  return yargs;
9
13
  }
10
14
  const builder = makeYargsBuilder(moduleBuilder, command, describe);
package/lang/en.d.ts CHANGED
@@ -3085,6 +3085,7 @@ export declare const lib: {
3085
3085
  compressing: (path: string) => string;
3086
3086
  fileFiltered: (filename: string) => string;
3087
3087
  legacyFileDetected: (filename: string, platformVersion: string) => string;
3088
+ projectDoesNotExist: (accountId: number) => string;
3088
3089
  };
3089
3090
  };
3090
3091
  importData: {
package/lang/en.js CHANGED
@@ -3107,6 +3107,7 @@ export const lib = {
3107
3107
  compressing: (path) => `Compressing build files to "${path}"`,
3108
3108
  fileFiltered: (filename) => `Ignore rule triggered for "${filename}"`,
3109
3109
  legacyFileDetected: (filename, platformVersion) => `The ${chalk.bold(filename)} file is not supported on platform version ${chalk.bold(platformVersion)} and will be ignored.`,
3110
+ projectDoesNotExist: (accountId) => `Upload cancelled. Run ${uiCommandReference('hs project upload')} again to create the project in ${uiAccountDescription(accountId)}.`,
3110
3111
  },
3111
3112
  },
3112
3113
  importData: {
@@ -300,7 +300,9 @@ export async function downloadProjectFiles(derivedAccountId, projectName, buildI
300
300
  const { projectDir } = projectConfig;
301
301
  absoluteDestPath = projectDir;
302
302
  const { srcDir } = projectConfig.projectConfig;
303
- const archiveDest = path.join(projectDir, 'archive');
303
+ const archiveDest = srcDir === '.'
304
+ ? path.join(path.dirname(projectDir), `${path.basename(projectDir)}-archive`)
305
+ : path.join(projectDir, 'archive');
304
306
  // Move the existing source directory to archive
305
307
  fs.renameSync(path.join(projectDir, srcDir), archiveDest);
306
308
  uiLogger.info(lib.migrate.sourceContentsMoved(archiveDest));
@@ -58,7 +58,7 @@ export async function autoUpdateCLI(argv) {
58
58
  notifier.update &&
59
59
  !argv.useEnv &&
60
60
  !process.env.SKIP_HUBSPOT_CLI_AUTO_UPDATES &&
61
- config?.allowAutoUpdates !== false &&
61
+ config?.allowAutoUpdates === true &&
62
62
  !preventAutoUpdateForCommand(argv._)) {
63
63
  // Ignore all update notifications if the current version is a pre-release
64
64
  if (!notifier.update.current.includes('-')) {
@@ -1,5 +1,6 @@
1
1
  import path from 'path';
2
2
  import { getConfigAccountIfExists, validateConfig, getConfigDefaultAccountIfExists, configFileExists, } from '@hubspot/local-dev-lib/config';
3
+ import { ENVIRONMENT_VARIABLES } from '@hubspot/local-dev-lib/constants/config';
3
4
  import { getCwd } from '@hubspot/local-dev-lib/path';
4
5
  import { validateAccount } from '../validation.js';
5
6
  import { EXIT_CODES } from '../enums/exitCodes.js';
@@ -22,7 +23,7 @@ export function handleDeprecatedEnvVariables(argv) {
22
23
  export function handleCustomConfigLocationMiddleware(argv) {
23
24
  const { useEnv, config } = argv;
24
25
  if (useEnv) {
25
- process.env.USE_ENVIRONMENT_HUBSPOT_CONFIG = 'true';
26
+ process.env[ENVIRONMENT_VARIABLES.USE_ENVIRONMENT_HUBSPOT_CONFIG] = 'true';
26
27
  }
27
28
  else if (config && typeof config === 'string') {
28
29
  const absoluteConfigPath = path.isAbsolute(config)
@@ -74,7 +75,8 @@ export async function validateConfigMiddleware(argv) {
74
75
  }
75
76
  // We don't run validation for auth because users should be able to run it when
76
77
  // no accounts are configured, but we still want to exit if the config file is not found
77
- if (!process.env.USE_ENVIRONMENT_HUBSPOT_CONFIG && !configFileExists()) {
78
+ if (!process.env[ENVIRONMENT_VARIABLES.USE_ENVIRONMENT_HUBSPOT_CONFIG] &&
79
+ !configFileExists()) {
78
80
  console.error('Config file not found, run hs account auth to configure your account');
79
81
  process.exit(EXIT_CODES.ERROR);
80
82
  }
@@ -1,9 +1,11 @@
1
1
  import { getConfigFilePath, globalConfigFileExists, } from '@hubspot/local-dev-lib/config';
2
+ import { ENVIRONMENT_VARIABLES } from '@hubspot/local-dev-lib/constants/config';
2
3
  import { checkAndWarnGitInclusion } from '../ui/git.js';
3
4
  import { debugError } from '../errorHandlers/index.js';
4
5
  export function checkAndWarnGitInclusionMiddleware(argv) {
5
- // Skip this when no command is provided
6
- if (argv._.length) {
6
+ // Skip this when no command is provided or if using environment config
7
+ if (argv._.length &&
8
+ !process.env[ENVIRONMENT_VARIABLES.USE_ENVIRONMENT_HUBSPOT_CONFIG]) {
7
9
  // Skip if using global config
8
10
  if (globalConfigFileExists()) {
9
11
  return;
@@ -75,10 +75,15 @@ export async function handleProjectUpload({ accountId, projectConfig, projectDir
75
75
  resolve({ uploadError: e });
76
76
  }
77
77
  }
78
- await ensureProjectExists(accountId, projectConfig.name, {
78
+ const { projectExists } = await ensureProjectExists(accountId, projectConfig.name, {
79
79
  forceCreate,
80
80
  uploadCommand: isUploadCommand,
81
+ noLogs: true,
81
82
  });
83
+ if (!projectExists) {
84
+ uiLogger.log(lib.projectUpload.handleProjectUpload.projectDoesNotExist(accountId));
85
+ process.exit(EXIT_CODES.SUCCESS);
86
+ }
82
87
  const { buildId, error } = await uploadProjectFiles(accountId, projectConfig.name, tempFile.name, uploadMessage, projectConfig.platformVersion, intermediateRepresentation);
83
88
  if (error) {
84
89
  resolve({ uploadError: error });
@@ -5,10 +5,6 @@ const server = new McpServer({
5
5
  name: 'HubSpot CLI MCP Server',
6
6
  version: '0.0.1',
7
7
  description: 'Helps perform tasks for local development of HubSpot projects.',
8
- capabilities: {
9
- tools: {},
10
- prompts: {},
11
- },
12
8
  });
13
9
  registerProjectTools(server);
14
10
  registerCmsTools(server);
@@ -6,23 +6,15 @@ declare const inputSchemaZodObject: z.ZodObject<{
6
6
  dest: z.ZodOptional<z.ZodString>;
7
7
  functionsFolder: z.ZodOptional<z.ZodString>;
8
8
  filename: z.ZodOptional<z.ZodString>;
9
- endpointMethod: z.ZodOptional<z.ZodEnum<["DELETE", "GET", "PATCH", "POST", "PUT"]>>;
9
+ endpointMethod: z.ZodOptional<z.ZodEnum<{
10
+ DELETE: "DELETE";
11
+ GET: "GET";
12
+ PATCH: "PATCH";
13
+ POST: "POST";
14
+ PUT: "PUT";
15
+ }>>;
10
16
  endpointPath: z.ZodOptional<z.ZodString>;
11
- }, "strip", z.ZodTypeAny, {
12
- absoluteCurrentWorkingDirectory: string;
13
- dest?: string | undefined;
14
- functionsFolder?: string | undefined;
15
- filename?: string | undefined;
16
- endpointMethod?: "DELETE" | "GET" | "PATCH" | "POST" | "PUT" | undefined;
17
- endpointPath?: string | undefined;
18
- }, {
19
- absoluteCurrentWorkingDirectory: string;
20
- dest?: string | undefined;
21
- functionsFolder?: string | undefined;
22
- filename?: string | undefined;
23
- endpointMethod?: "DELETE" | "GET" | "PATCH" | "POST" | "PUT" | undefined;
24
- endpointPath?: string | undefined;
25
- }>;
17
+ }, z.core.$strip>;
26
18
  export type HsCreateFunctionInputSchema = z.infer<typeof inputSchemaZodObject>;
27
19
  export declare class HsCreateFunctionTool extends Tool<HsCreateFunctionInputSchema> {
28
20
  constructor(mcpServer: McpServer);
@@ -7,28 +7,10 @@ declare const inputSchemaZodObject: z.ZodObject<{
7
7
  dest: z.ZodOptional<z.ZodString>;
8
8
  moduleLabel: z.ZodOptional<z.ZodString>;
9
9
  reactType: z.ZodOptional<z.ZodBoolean>;
10
- contentTypes: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
10
+ contentTypes: z.ZodOptional<z.ZodString>;
11
11
  global: z.ZodOptional<z.ZodBoolean>;
12
12
  availableForNewContent: z.ZodOptional<z.ZodBoolean>;
13
- }, "strip", z.ZodTypeAny, {
14
- absoluteCurrentWorkingDirectory: string;
15
- dest?: string | undefined;
16
- global?: boolean | undefined;
17
- moduleLabel?: string | undefined;
18
- reactType?: boolean | undefined;
19
- contentTypes?: string | undefined;
20
- availableForNewContent?: boolean | undefined;
21
- userSuppliedName?: string | undefined;
22
- }, {
23
- absoluteCurrentWorkingDirectory: string;
24
- dest?: string | undefined;
25
- global?: boolean | undefined;
26
- moduleLabel?: string | undefined;
27
- reactType?: boolean | undefined;
28
- contentTypes?: string | undefined;
29
- availableForNewContent?: boolean | undefined;
30
- userSuppliedName?: string | undefined;
31
- }>;
13
+ }, z.core.$strip>;
32
14
  export type HsCreateModuleInputSchema = z.infer<typeof inputSchemaZodObject>;
33
15
  export declare class HsCreateModuleTool extends Tool<HsCreateModuleInputSchema> {
34
16
  constructor(mcpServer: McpServer);
@@ -5,18 +5,17 @@ declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteCurrentWorkingDirectory: z.ZodString;
6
6
  userSuppliedName: z.ZodOptional<z.ZodString>;
7
7
  dest: z.ZodOptional<z.ZodString>;
8
- templateType: z.ZodOptional<z.ZodEnum<["page-template", "email-template", "partial", "global-partial", "blog-listing-template", "blog-post-template", "search-template", "section"]>>;
9
- }, "strip", z.ZodTypeAny, {
10
- absoluteCurrentWorkingDirectory: string;
11
- dest?: string | undefined;
12
- templateType?: "page-template" | "email-template" | "partial" | "global-partial" | "blog-listing-template" | "blog-post-template" | "search-template" | "section" | undefined;
13
- userSuppliedName?: string | undefined;
14
- }, {
15
- absoluteCurrentWorkingDirectory: string;
16
- dest?: string | undefined;
17
- templateType?: "page-template" | "email-template" | "partial" | "global-partial" | "blog-listing-template" | "blog-post-template" | "search-template" | "section" | undefined;
18
- userSuppliedName?: string | undefined;
19
- }>;
8
+ templateType: z.ZodOptional<z.ZodEnum<{
9
+ "page-template": "page-template";
10
+ "email-template": "email-template";
11
+ partial: "partial";
12
+ "global-partial": "global-partial";
13
+ "blog-listing-template": "blog-listing-template";
14
+ "blog-post-template": "blog-post-template";
15
+ "search-template": "search-template";
16
+ section: "section";
17
+ }>>;
18
+ }, z.core.$strip>;
20
19
  export type HsCreateTemplateInputSchema = z.infer<typeof inputSchemaZodObject>;
21
20
  export declare class HsCreateTemplateTool extends Tool<HsCreateTemplateInputSchema> {
22
21
  constructor(mcpServer: McpServer);
@@ -8,21 +8,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
8
8
  latest: z.ZodOptional<z.ZodBoolean>;
9
9
  compact: z.ZodOptional<z.ZodBoolean>;
10
10
  limit: z.ZodOptional<z.ZodNumber>;
11
- }, "strip", z.ZodTypeAny, {
12
- endpoint: string;
13
- absoluteCurrentWorkingDirectory: string;
14
- account?: string | undefined;
15
- latest?: boolean | undefined;
16
- compact?: boolean | undefined;
17
- limit?: number | undefined;
18
- }, {
19
- endpoint: string;
20
- absoluteCurrentWorkingDirectory: string;
21
- account?: string | undefined;
22
- latest?: boolean | undefined;
23
- compact?: boolean | undefined;
24
- limit?: number | undefined;
25
- }>;
11
+ }, z.core.$strip>;
26
12
  export type HsFunctionLogsInputSchema = z.infer<typeof inputSchemaZodObject>;
27
13
  export declare class HsFunctionLogsTool extends Tool<HsFunctionLogsInputSchema> {
28
14
  constructor(mcpServer: McpServer);
@@ -5,15 +5,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteCurrentWorkingDirectory: z.ZodString;
6
6
  account: z.ZodOptional<z.ZodString>;
7
7
  json: z.ZodOptional<z.ZodBoolean>;
8
- }, "strip", z.ZodTypeAny, {
9
- absoluteCurrentWorkingDirectory: string;
10
- account?: string | undefined;
11
- json?: boolean | undefined;
12
- }, {
13
- absoluteCurrentWorkingDirectory: string;
14
- account?: string | undefined;
15
- json?: boolean | undefined;
16
- }>;
8
+ }, z.core.$strip>;
17
9
  export type HsListFunctionsInputSchema = z.infer<typeof inputSchemaZodObject>;
18
10
  export declare class HsListFunctionsTool extends Tool<HsListFunctionsInputSchema> {
19
11
  constructor(mcpServer: McpServer);
@@ -5,15 +5,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteCurrentWorkingDirectory: z.ZodString;
6
6
  path: z.ZodOptional<z.ZodString>;
7
7
  account: z.ZodOptional<z.ZodString>;
8
- }, "strip", z.ZodTypeAny, {
9
- absoluteCurrentWorkingDirectory: string;
10
- account?: string | undefined;
11
- path?: string | undefined;
12
- }, {
13
- absoluteCurrentWorkingDirectory: string;
14
- account?: string | undefined;
15
- path?: string | undefined;
16
- }>;
8
+ }, z.core.$strip>;
17
9
  export type HsListInputSchema = z.infer<typeof inputSchemaZodObject>;
18
10
  export declare class HsListTool extends Tool<HsListInputSchema> {
19
11
  constructor(mcpServer: McpServer);
@@ -5,24 +5,10 @@ declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteProjectPath: z.ZodString;
6
6
  absoluteCurrentWorkingDirectory: z.ZodString;
7
7
  addApp: z.ZodBoolean;
8
- distribution: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"marketplace">, z.ZodLiteral<"private">]>>;
9
- auth: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"static">, z.ZodLiteral<"oauth">]>>;
10
- features: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">, z.ZodLiteral<"workflow-action">, z.ZodLiteral<"workflow-action-tool">, z.ZodLiteral<"app-object">, z.ZodLiteral<"app-event">, z.ZodLiteral<"scim">, z.ZodLiteral<"page">]>, "many">>;
11
- }, "strip", z.ZodTypeAny, {
12
- absoluteProjectPath: string;
13
- absoluteCurrentWorkingDirectory: string;
14
- addApp: boolean;
15
- auth?: "oauth" | "static" | undefined;
16
- distribution?: "marketplace" | "private" | undefined;
17
- features?: ("card" | "settings" | "page" | "app-event" | "workflow-action-tool" | "workflow-action" | "app-function" | "webhooks" | "app-object" | "scim")[] | undefined;
18
- }, {
19
- absoluteProjectPath: string;
20
- absoluteCurrentWorkingDirectory: string;
21
- addApp: boolean;
22
- auth?: "oauth" | "static" | undefined;
23
- distribution?: "marketplace" | "private" | undefined;
24
- features?: ("card" | "settings" | "page" | "app-event" | "workflow-action-tool" | "workflow-action" | "app-function" | "webhooks" | "app-object" | "scim")[] | undefined;
25
- }>;
8
+ distribution: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"marketplace">, z.ZodLiteral<"private">]>>;
9
+ auth: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"static">, z.ZodLiteral<"oauth">]>>;
10
+ features: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">, z.ZodLiteral<"workflow-action">, z.ZodLiteral<"workflow-action-tool">, z.ZodLiteral<"app-object">, z.ZodLiteral<"app-event">, z.ZodLiteral<"scim">, z.ZodLiteral<"page">]>>>;
11
+ }, z.core.$strip>;
26
12
  export type AddFeatureInputSchema = z.infer<typeof inputSchemaZodObject>;
27
13
  export declare class AddFeatureToProjectTool extends Tool<AddFeatureInputSchema> {
28
14
  constructor(mcpServer: McpServer);
@@ -5,27 +5,11 @@ declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteCurrentWorkingDirectory: z.ZodString;
6
6
  name: z.ZodOptional<z.ZodString>;
7
7
  destination: z.ZodString;
8
- projectBase: z.ZodUnion<[z.ZodLiteral<"empty">, z.ZodLiteral<"app">]>;
9
- distribution: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"marketplace">, z.ZodLiteral<"private">]>>;
10
- auth: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"static">, z.ZodLiteral<"oauth">]>>>;
11
- features: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">, z.ZodLiteral<"workflow-action">, z.ZodLiteral<"workflow-action-tool">, z.ZodLiteral<"app-object">, z.ZodLiteral<"app-event">, z.ZodLiteral<"scim">, z.ZodLiteral<"page">]>, "many">>;
12
- }, "strip", z.ZodTypeAny, {
13
- projectBase: "app" | "empty";
14
- absoluteCurrentWorkingDirectory: string;
15
- destination: string;
16
- name?: string | undefined;
17
- auth?: "oauth" | "static" | undefined;
18
- distribution?: "marketplace" | "private" | undefined;
19
- features?: ("card" | "settings" | "page" | "app-event" | "workflow-action-tool" | "workflow-action" | "app-function" | "webhooks" | "app-object" | "scim")[] | undefined;
20
- }, {
21
- projectBase: "app" | "empty";
22
- absoluteCurrentWorkingDirectory: string;
23
- destination: string;
24
- name?: string | undefined;
25
- auth?: "oauth" | "static" | undefined;
26
- distribution?: "marketplace" | "private" | undefined;
27
- features?: ("card" | "settings" | "page" | "app-event" | "workflow-action-tool" | "workflow-action" | "app-function" | "webhooks" | "app-object" | "scim")[] | undefined;
28
- }>;
8
+ projectBase: z.ZodUnion<readonly [z.ZodLiteral<"empty">, z.ZodLiteral<"app">]>;
9
+ distribution: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"marketplace">, z.ZodLiteral<"private">]>>;
10
+ auth: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"static">, z.ZodLiteral<"oauth">]>>>;
11
+ features: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">, z.ZodLiteral<"workflow-action">, z.ZodLiteral<"workflow-action-tool">, z.ZodLiteral<"app-object">, z.ZodLiteral<"app-event">, z.ZodLiteral<"scim">, z.ZodLiteral<"page">]>>>;
12
+ }, z.core.$strip>;
29
13
  export type CreateProjectInputSchema = z.infer<typeof inputSchemaZodObject>;
30
14
  export declare class CreateProjectTool extends Tool<CreateProjectInputSchema> {
31
15
  constructor(mcpServer: McpServer);
@@ -6,32 +6,37 @@ declare const createTestAccountInputSchema: z.ZodObject<{
6
6
  configPath: z.ZodOptional<z.ZodString>;
7
7
  name: z.ZodOptional<z.ZodString>;
8
8
  description: z.ZodOptional<z.ZodString>;
9
- marketingLevel: z.ZodOptional<z.ZodEnum<["FREE", "STARTER", "PROFESSIONAL", "ENTERPRISE"]>>;
10
- opsLevel: z.ZodOptional<z.ZodEnum<["FREE", "STARTER", "PROFESSIONAL", "ENTERPRISE"]>>;
11
- serviceLevel: z.ZodOptional<z.ZodEnum<["FREE", "STARTER", "PROFESSIONAL", "ENTERPRISE"]>>;
12
- salesLevel: z.ZodOptional<z.ZodEnum<["FREE", "STARTER", "PROFESSIONAL", "ENTERPRISE"]>>;
13
- contentLevel: z.ZodOptional<z.ZodEnum<["FREE", "STARTER", "PROFESSIONAL", "ENTERPRISE"]>>;
14
- }, "strip", z.ZodTypeAny, {
15
- absoluteCurrentWorkingDirectory: string;
16
- name?: string | undefined;
17
- description?: string | undefined;
18
- marketingLevel?: "FREE" | "STARTER" | "PROFESSIONAL" | "ENTERPRISE" | undefined;
19
- opsLevel?: "FREE" | "STARTER" | "PROFESSIONAL" | "ENTERPRISE" | undefined;
20
- serviceLevel?: "FREE" | "STARTER" | "PROFESSIONAL" | "ENTERPRISE" | undefined;
21
- salesLevel?: "FREE" | "STARTER" | "PROFESSIONAL" | "ENTERPRISE" | undefined;
22
- contentLevel?: "FREE" | "STARTER" | "PROFESSIONAL" | "ENTERPRISE" | undefined;
23
- configPath?: string | undefined;
24
- }, {
25
- absoluteCurrentWorkingDirectory: string;
26
- name?: string | undefined;
27
- description?: string | undefined;
28
- marketingLevel?: "FREE" | "STARTER" | "PROFESSIONAL" | "ENTERPRISE" | undefined;
29
- opsLevel?: "FREE" | "STARTER" | "PROFESSIONAL" | "ENTERPRISE" | undefined;
30
- serviceLevel?: "FREE" | "STARTER" | "PROFESSIONAL" | "ENTERPRISE" | undefined;
31
- salesLevel?: "FREE" | "STARTER" | "PROFESSIONAL" | "ENTERPRISE" | undefined;
32
- contentLevel?: "FREE" | "STARTER" | "PROFESSIONAL" | "ENTERPRISE" | undefined;
33
- configPath?: string | undefined;
34
- }>;
9
+ marketingLevel: z.ZodOptional<z.ZodEnum<{
10
+ FREE: "FREE";
11
+ STARTER: "STARTER";
12
+ PROFESSIONAL: "PROFESSIONAL";
13
+ ENTERPRISE: "ENTERPRISE";
14
+ }>>;
15
+ opsLevel: z.ZodOptional<z.ZodEnum<{
16
+ FREE: "FREE";
17
+ STARTER: "STARTER";
18
+ PROFESSIONAL: "PROFESSIONAL";
19
+ ENTERPRISE: "ENTERPRISE";
20
+ }>>;
21
+ serviceLevel: z.ZodOptional<z.ZodEnum<{
22
+ FREE: "FREE";
23
+ STARTER: "STARTER";
24
+ PROFESSIONAL: "PROFESSIONAL";
25
+ ENTERPRISE: "ENTERPRISE";
26
+ }>>;
27
+ salesLevel: z.ZodOptional<z.ZodEnum<{
28
+ FREE: "FREE";
29
+ STARTER: "STARTER";
30
+ PROFESSIONAL: "PROFESSIONAL";
31
+ ENTERPRISE: "ENTERPRISE";
32
+ }>>;
33
+ contentLevel: z.ZodOptional<z.ZodEnum<{
34
+ FREE: "FREE";
35
+ STARTER: "STARTER";
36
+ PROFESSIONAL: "PROFESSIONAL";
37
+ ENTERPRISE: "ENTERPRISE";
38
+ }>>;
39
+ }, z.core.$strip>;
35
40
  export type CreateTestAccountInputSchema = z.infer<typeof createTestAccountInputSchema>;
36
41
  export declare class CreateTestAccountTool extends Tool<CreateTestAccountInputSchema> {
37
42
  constructor(mcpServer: McpServer);
@@ -5,15 +5,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteProjectPath: z.ZodString;
6
6
  absoluteCurrentWorkingDirectory: z.ZodString;
7
7
  buildNumber: z.ZodOptional<z.ZodNumber>;
8
- }, "strip", z.ZodTypeAny, {
9
- absoluteProjectPath: string;
10
- absoluteCurrentWorkingDirectory: string;
11
- buildNumber?: number | undefined;
12
- }, {
13
- absoluteProjectPath: string;
14
- absoluteCurrentWorkingDirectory: string;
15
- buildNumber?: number | undefined;
16
- }>;
8
+ }, z.core.$strip>;
17
9
  type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
18
10
  export declare class DeployProjectTool extends Tool<InputSchemaType> {
19
11
  constructor(mcpServer: McpServer);
@@ -4,13 +4,7 @@ import { TextContentResponse, Tool } from '../../types.js';
4
4
  declare const inputSchemaZodObject: z.ZodObject<{
5
5
  docUrl: z.ZodString;
6
6
  absoluteCurrentWorkingDirectory: z.ZodString;
7
- }, "strip", z.ZodTypeAny, {
8
- absoluteCurrentWorkingDirectory: string;
9
- docUrl: string;
10
- }, {
11
- absoluteCurrentWorkingDirectory: string;
12
- docUrl: string;
13
- }>;
7
+ }, z.z.core.$strip>;
14
8
  type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
15
9
  export declare class DocFetchTool extends Tool<InputSchemaType> {
16
10
  constructor(mcpServer: McpServer);
@@ -4,13 +4,7 @@ import { TextContentResponse, Tool } from '../../types.js';
4
4
  declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteCurrentWorkingDirectory: z.ZodString;
6
6
  docsSearchQuery: z.ZodString;
7
- }, "strip", z.ZodTypeAny, {
8
- absoluteCurrentWorkingDirectory: string;
9
- docsSearchQuery: string;
10
- }, {
11
- absoluteCurrentWorkingDirectory: string;
12
- docsSearchQuery: string;
13
- }>;
7
+ }, z.z.core.$strip>;
14
8
  export interface DocsSearchResponse {
15
9
  results: {
16
10
  title: string;
@@ -6,17 +6,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
6
6
  appId: z.ZodString;
7
7
  startDate: z.ZodOptional<z.ZodString>;
8
8
  endDate: z.ZodOptional<z.ZodString>;
9
- }, "strip", z.ZodTypeAny, {
10
- appId: string;
11
- absoluteCurrentWorkingDirectory: string;
12
- startDate?: string | undefined;
13
- endDate?: string | undefined;
14
- }, {
15
- appId: string;
16
- absoluteCurrentWorkingDirectory: string;
17
- startDate?: string | undefined;
18
- endDate?: string | undefined;
19
- }>;
9
+ }, z.core.$strip>;
20
10
  export type GetApiUsagePatternsByAppIdInputSchema = z.infer<typeof inputSchemaZodObject>;
21
11
  export declare class GetApiUsagePatternsByAppIdTool extends Tool<GetApiUsagePatternsByAppIdInputSchema> {
22
12
  constructor(mcpServer: McpServer);
@@ -3,11 +3,7 @@ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.
3
3
  import { z } from 'zod';
4
4
  declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteCurrentWorkingDirectory: z.ZodString;
6
- }, "strip", z.ZodTypeAny, {
7
- absoluteCurrentWorkingDirectory: string;
8
- }, {
9
- absoluteCurrentWorkingDirectory: string;
10
- }>;
6
+ }, z.core.$strip>;
11
7
  export type GetApplicationInfoInputSchema = z.infer<typeof inputSchemaZodObject>;
12
8
  export declare class GetApplicationInfoTool extends Tool<GetApplicationInfoInputSchema> {
13
9
  constructor(mcpServer: McpServer);
@@ -5,18 +5,13 @@ declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteProjectPath: z.ZodString;
6
6
  absoluteCurrentWorkingDirectory: z.ZodString;
7
7
  buildId: z.ZodNumber;
8
- logLevel: z.ZodDefault<z.ZodOptional<z.ZodEnum<["ERROR", "WARN", "INFO", "ALL"]>>>;
9
- }, "strip", z.ZodTypeAny, {
10
- buildId: number;
11
- absoluteProjectPath: string;
12
- absoluteCurrentWorkingDirectory: string;
13
- logLevel: "ERROR" | "WARN" | "INFO" | "ALL";
14
- }, {
15
- buildId: number;
16
- absoluteProjectPath: string;
17
- absoluteCurrentWorkingDirectory: string;
18
- logLevel?: "ERROR" | "WARN" | "INFO" | "ALL" | undefined;
19
- }>;
8
+ logLevel: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
9
+ ERROR: "ERROR";
10
+ WARN: "WARN";
11
+ INFO: "INFO";
12
+ ALL: "ALL";
13
+ }>>>;
14
+ }, z.core.$strip>;
20
15
  export type GetBuildLogsInputSchema = z.infer<typeof inputSchemaZodObject>;
21
16
  export declare class GetBuildLogsTool extends Tool<GetBuildLogsInputSchema> {
22
17
  constructor(mcpServer: McpServer);
@@ -6,17 +6,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
6
6
  absoluteCurrentWorkingDirectory: z.ZodString;
7
7
  buildId: z.ZodOptional<z.ZodNumber>;
8
8
  limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
9
- }, "strip", z.ZodTypeAny, {
10
- limit: number;
11
- absoluteProjectPath: string;
12
- absoluteCurrentWorkingDirectory: string;
13
- buildId?: number | undefined;
14
- }, {
15
- absoluteProjectPath: string;
16
- absoluteCurrentWorkingDirectory: string;
17
- limit?: number | undefined;
18
- buildId?: number | undefined;
19
- }>;
9
+ }, z.core.$strip>;
20
10
  export type GetBuildStatusInputSchema = z.infer<typeof inputSchemaZodObject>;
21
11
  export declare class GetBuildStatusTool extends Tool<GetBuildStatusInputSchema> {
22
12
  constructor(mcpServer: McpServer);
@@ -5,15 +5,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteCurrentWorkingDirectory: z.ZodString;
6
6
  platformVersion: z.ZodString;
7
7
  featureType: z.ZodString;
8
- }, "strip", z.ZodTypeAny, {
9
- platformVersion: string;
10
- absoluteCurrentWorkingDirectory: string;
11
- featureType: string;
12
- }, {
13
- platformVersion: string;
14
- absoluteCurrentWorkingDirectory: string;
15
- featureType: string;
16
- }>;
8
+ }, z.core.$strip>;
17
9
  type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
18
10
  export declare class GetConfigValuesTool extends Tool<InputSchemaType> {
19
11
  constructor(mcpServer: McpServer);
@@ -3,14 +3,8 @@ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.
3
3
  import { z } from 'zod';
4
4
  declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteCurrentWorkingDirectory: z.ZodString;
6
- command: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"hs init">, z.ZodLiteral<"hs auth">, z.ZodLiteral<"hs project create">, z.ZodLiteral<"hs project upload">]>>;
7
- }, "strip", z.ZodTypeAny, {
8
- absoluteCurrentWorkingDirectory: string;
9
- command?: "hs auth" | "hs project create" | "hs project upload" | "hs init" | undefined;
10
- }, {
11
- absoluteCurrentWorkingDirectory: string;
12
- command?: "hs auth" | "hs project create" | "hs project upload" | "hs init" | undefined;
13
- }>;
6
+ command: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"hs init">, z.ZodLiteral<"hs auth">, z.ZodLiteral<"hs project create">, z.ZodLiteral<"hs project upload">]>>;
7
+ }, z.core.$strip>;
14
8
  type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
15
9
  export declare class GuidedWalkthroughTool extends Tool<InputSchemaType> {
16
10
  constructor(mcpServer: McpServer);
@@ -6,17 +6,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
6
6
  absoluteCurrentWorkingDirectory: z.ZodString;
7
7
  uploadMessage: z.ZodString;
8
8
  profile: z.ZodOptional<z.ZodString>;
9
- }, "strip", z.ZodTypeAny, {
10
- uploadMessage: string;
11
- absoluteProjectPath: string;
12
- absoluteCurrentWorkingDirectory: string;
13
- profile?: string | undefined;
14
- }, {
15
- uploadMessage: string;
16
- absoluteProjectPath: string;
17
- absoluteCurrentWorkingDirectory: string;
18
- profile?: string | undefined;
19
- }>;
9
+ }, z.z.core.$strip>;
20
10
  type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
21
11
  export declare class UploadProjectTools extends Tool<InputSchemaType> {
22
12
  constructor(mcpServer: McpServer);
@@ -4,13 +4,7 @@ import { z } from 'zod';
4
4
  declare const inputSchemaZodObject: z.ZodObject<{
5
5
  absoluteProjectPath: z.ZodString;
6
6
  absoluteCurrentWorkingDirectory: z.ZodString;
7
- }, "strip", z.ZodTypeAny, {
8
- absoluteProjectPath: string;
9
- absoluteCurrentWorkingDirectory: string;
10
- }, {
11
- absoluteProjectPath: string;
12
- absoluteCurrentWorkingDirectory: string;
13
- }>;
7
+ }, z.core.$strip>;
14
8
  export type CreateProjectInputSchema = z.infer<typeof inputSchemaZodObject>;
15
9
  export declare class ValidateProjectTool extends Tool<CreateProjectInputSchema> {
16
10
  constructor(mcpServer: McpServer);
@@ -51,17 +51,6 @@ describe('mcp-server/tools/project/CreateTestAccountTool', () => {
51
51
  }), expect.any(Function));
52
52
  expect(result).toBe(mockRegisteredTool);
53
53
  });
54
- it('should include all key information in description', () => {
55
- tool.register();
56
- const registerCall = mockMcpServer.registerTool.mock.calls[0];
57
- const config = registerCall[1];
58
- expect(config.description).toContain('test account');
59
- expect(config.description).toContain('WORKFLOW');
60
- expect(config.description).toContain('config file');
61
- expect(config.description).toContain('ALL account details');
62
- expect(config.description).toContain('non-interactive execution');
63
- expect(config.description).toContain('FREE, STARTER, PROFESSIONAL, ENTERPRISE');
64
- });
65
54
  });
66
55
  describe('handler', () => {
67
56
  describe('config file approach', () => {
@@ -1,6 +1,6 @@
1
1
  import z from 'zod';
2
2
  export declare const absoluteProjectPath: z.ZodString;
3
3
  export declare const absoluteCurrentWorkingDirectory: z.ZodString;
4
- export declare const features: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">, z.ZodLiteral<"workflow-action">, z.ZodLiteral<"workflow-action-tool">, z.ZodLiteral<"app-object">, z.ZodLiteral<"app-event">, z.ZodLiteral<"scim">, z.ZodLiteral<"page">]>, "many">>;
4
+ export declare const features: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"card">, z.ZodLiteral<"settings">, z.ZodLiteral<"app-function">, z.ZodLiteral<"webhooks">, z.ZodLiteral<"workflow-action">, z.ZodLiteral<"workflow-action-tool">, z.ZodLiteral<"app-object">, z.ZodLiteral<"app-event">, z.ZodLiteral<"scim">, z.ZodLiteral<"page">]>>>;
5
5
  export declare const docsSearchQuery: z.ZodString;
6
6
  export declare const docUrl: z.ZodString;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "7.11.1-experimental.0",
3
+ "version": "7.11.2-beta.0",
4
4
  "description": "The official CLI for developing on HubSpot",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "https://github.com/HubSpot/hubspot-cli",
7
7
  "type": "module",
8
8
  "dependencies": {
9
- "@hubspot/local-dev-lib": "4.0.1",
9
+ "@hubspot/local-dev-lib": "4.0.4",
10
10
  "@hubspot/project-parsing-lib": "0.10.2",
11
11
  "@hubspot/serverless-dev-runtime": "7.0.7",
12
12
  "@hubspot/theme-preview-dev-server": "0.0.12",
@@ -35,7 +35,7 @@
35
35
  "yargs-parser": "21.1.1"
36
36
  },
37
37
  "devDependencies": {
38
- "@hubspot/npm-scripts": "0.0.6",
38
+ "@hubspot/npm-scripts": "0.1.0",
39
39
  "@types/archiver": "^6.0.3",
40
40
  "@types/cli-progress": "^3.11.6",
41
41
  "@types/express": "^5.0.0",
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "optionalDependencies": {
70
70
  "@hubspot/cms-dev-server": "^1.2.1",
71
- "@modelcontextprotocol/sdk": "1.13.3"
71
+ "@modelcontextprotocol/sdk": "1.25.0"
72
72
  },
73
73
  "scripts": {
74
74
  "build": "tsx ./scripts/build.ts",
@@ -84,6 +84,7 @@
84
84
  "mcp-local": "yarn tsx ./scripts/mcp-local.ts",
85
85
  "prettier:write": "prettier --write './**/*.{ts,js,json}'",
86
86
  "release": "yarn tsx ./scripts/release.ts release",
87
+ "sync-to-public": "yarn tsx ./scripts/sync-to-public.ts repo-sync",
87
88
  "view-ui": "yarn build && yarn tsx ./scripts/view-ui.ts",
88
89
  "test": "vitest run",
89
90
  "test-dev": "vitest",
@@ -110,8 +111,8 @@
110
111
  "node": ">=18"
111
112
  },
112
113
  "bin": {
113
- "hs": "./bin/hs",
114
- "hscms": "./bin/hscms"
114
+ "hs": "./bin/hs.js",
115
+ "hscms": "./bin/hscms.js"
115
116
  },
116
117
  "publishConfig": {
117
118
  "access": "public",
@@ -5,5 +5,5 @@ export function getBoxWithTitle(props) {
5
5
  return _jsx(BoxWithTitle, { ...props });
6
6
  }
7
7
  export function BoxWithTitle({ title, message, titleBackgroundColor, borderColor, textCentered, }) {
8
- return (_jsxs(Box, { ...CONTAINER_STYLES, borderStyle: "round", borderColor: borderColor, alignSelf: "flex-start", children: [_jsx(Box, { position: "absolute", marginTop: -2, paddingX: 0, alignSelf: "flex-start", justifyContent: "center", alignItems: "center", children: _jsx(Text, { backgroundColor: titleBackgroundColor, bold: true, children: ` ${title} ` }) }), _jsx(Box, { flexDirection: "column", width: "100%", rowGap: 1, children: message.split('\n\n').map((section, sectionIndex) => (_jsx(Box, { flexDirection: "column", alignItems: textCentered ? 'center' : 'flex-start', children: section.split('\n').map((line, lineIndex) => (_jsx(Text, { children: line }, `${sectionIndex}-${lineIndex}`))) }, sectionIndex))) })] }));
8
+ return (_jsxs(Box, { ...CONTAINER_STYLES, borderStyle: "round", borderColor: borderColor, alignSelf: "flex-start", children: [_jsx(Box, { position: "absolute", marginTop: -2, paddingX: 0, alignSelf: "flex-start", justifyContent: "center", alignItems: "center", children: _jsx(Text, { backgroundColor: titleBackgroundColor, bold: true, children: ` ${title} ` }) }), _jsx(Box, { flexDirection: "column", width: "100%", rowGap: 1, children: message?.split('\n\n').map((section, sectionIndex) => (_jsx(Box, { flexDirection: "column", alignItems: textCentered ? 'center' : 'flex-start', children: section.split('\n').map((line, lineIndex) => (_jsx(Text, { children: line }, `${sectionIndex}-${lineIndex}`))) }, sectionIndex))) })] }));
9
9
  }
File without changes
File without changes