@hubspot/cli 8.15.0 → 8.16.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.
Files changed (141) hide show
  1. package/api/releases.d.ts +4 -1
  2. package/bin/cli.js +2 -0
  3. package/commands/account/auth.d.ts +3 -2
  4. package/commands/account/auth.js +21 -10
  5. package/commands/app/migrate.js +3 -3
  6. package/commands/project/add.d.ts +3 -2
  7. package/commands/project/add.js +10 -8
  8. package/commands/project/appInstallStatus.d.ts +2 -2
  9. package/commands/project/appInstallStatus.js +2 -2
  10. package/commands/project/create.d.ts +4 -2
  11. package/commands/project/create.js +16 -4
  12. package/commands/project/deploy.d.ts +2 -2
  13. package/commands/project/deploy.js +2 -2
  14. package/commands/project/download.d.ts +2 -2
  15. package/commands/project/download.js +2 -2
  16. package/commands/project/info.d.ts +1 -1
  17. package/commands/project/info.js +1 -1
  18. package/commands/project/installApp.d.ts +2 -2
  19. package/commands/project/installApp.js +2 -2
  20. package/commands/project/listBuilds.d.ts +2 -2
  21. package/commands/project/listBuilds.js +2 -2
  22. package/commands/project/migrate.js +4 -4
  23. package/commands/project/release/create.d.ts +2 -2
  24. package/commands/project/release/create.js +7 -3
  25. package/commands/project/release/info.d.ts +2 -2
  26. package/commands/project/release/info.js +2 -2
  27. package/commands/project/release/list.d.ts +2 -2
  28. package/commands/project/release/list.js +2 -2
  29. package/commands/project/release/preview.d.ts +9 -0
  30. package/commands/project/release/preview.js +167 -0
  31. package/commands/project/release.js +7 -1
  32. package/commands/project/upload.d.ts +2 -2
  33. package/commands/project/upload.js +2 -2
  34. package/commands/project/validate.d.ts +2 -2
  35. package/commands/project/validate.js +2 -2
  36. package/commands/testAccount/create.d.ts +2 -2
  37. package/commands/testAccount/create.js +2 -2
  38. package/lang/en.d.ts +27 -0
  39. package/lang/en.js +32 -4
  40. package/lib/accountAuth.d.ts +1 -0
  41. package/lib/accountAuth.js +8 -0
  42. package/lib/app/urls.d.ts +0 -1
  43. package/lib/app/urls.js +0 -4
  44. package/lib/constants.d.ts +6 -0
  45. package/lib/constants.js +11 -0
  46. package/lib/jsonOutput/accountAuth.d.ts +7 -0
  47. package/lib/jsonOutput/accountAuth.js +6 -0
  48. package/lib/jsonOutput/projectAdd.d.ts +9 -0
  49. package/lib/jsonOutput/projectAdd.js +10 -0
  50. package/lib/jsonOutput/{appInstallStatus.d.ts → projectAppInstallStatus.d.ts} +2 -2
  51. package/lib/jsonOutput/{appInstallStatus.js → projectAppInstallStatus.js} +1 -1
  52. package/lib/jsonOutput/projectCreate.d.ts +8 -0
  53. package/lib/jsonOutput/projectCreate.js +7 -0
  54. package/lib/jsonOutput/projectDeploy.d.ts +5 -0
  55. package/lib/jsonOutput/{deploy.js → projectDeploy.js} +1 -1
  56. package/lib/jsonOutput/projectDownload.d.ts +7 -0
  57. package/lib/jsonOutput/{download.js → projectDownload.js} +1 -1
  58. package/lib/jsonOutput/{installApp.d.ts → projectInstallApp.d.ts} +2 -2
  59. package/lib/jsonOutput/{installApp.js → projectInstallApp.js} +1 -1
  60. package/lib/jsonOutput/{listBuilds.d.ts → projectListBuilds.d.ts} +2 -2
  61. package/lib/jsonOutput/{listBuilds.js → projectListBuilds.js} +1 -1
  62. package/lib/jsonOutput/{release.d.ts → projectRelease.d.ts} +15 -8
  63. package/lib/jsonOutput/{release.js → projectRelease.js} +11 -4
  64. package/lib/jsonOutput/{upload.d.ts → projectUpload.d.ts} +2 -2
  65. package/lib/jsonOutput/{upload.js → projectUpload.js} +1 -1
  66. package/lib/jsonOutput/{validate.d.ts → projectValidate.d.ts} +2 -2
  67. package/lib/jsonOutput/{validate.js → projectValidate.js} +1 -1
  68. package/lib/jsonOutput/{createTestAccount.d.ts → testAccountCreate.d.ts} +2 -2
  69. package/lib/jsonOutput/{createTestAccount.js → testAccountCreate.js} +1 -1
  70. package/lib/middleware/deprecationWarningMiddleware.d.ts +1 -0
  71. package/lib/middleware/deprecationWarningMiddleware.js +57 -0
  72. package/lib/projects/add/legacyAddComponent.d.ts +2 -1
  73. package/lib/projects/add/legacyAddComponent.js +3 -0
  74. package/lib/projects/add/v2AddComponent.d.ts +2 -1
  75. package/lib/projects/add/v2AddComponent.js +7 -1
  76. package/lib/projects/localDev/LocalDevWatcher.js +1 -1
  77. package/lib/projects/release.d.ts +2 -2
  78. package/lib/projects/validate.d.ts +1 -1
  79. package/lib/prompts/projectProfilePrompt.d.ts +7 -0
  80. package/lib/prompts/projectProfilePrompt.js +1 -1
  81. package/lib/testUtils.d.ts +5 -0
  82. package/lib/testUtils.js +24 -0
  83. package/lib/ui/index.js +11 -1
  84. package/lib/ui/uiMessages.d.ts +1 -0
  85. package/lib/ui/uiMessages.js +1 -0
  86. package/mcp-server/Tool.d.ts +6 -1
  87. package/mcp-server/Tool.js +6 -4
  88. package/mcp-server/server.js +26 -4
  89. package/mcp-server/tools/cms/HsCreateFunctionTool.js +1 -1
  90. package/mcp-server/tools/cms/HsFunctionLogsTool.d.ts +1 -1
  91. package/mcp-server/tools/cms/HsFunctionLogsTool.js +59 -5
  92. package/mcp-server/tools/cms/HsListFunctionsTool.js +1 -1
  93. package/mcp-server/tools/index.js +2 -0
  94. package/mcp-server/tools/project/AddFeatureToProjectTool.js +31 -31
  95. package/mcp-server/tools/project/AuthAccountTool.d.ts +1 -0
  96. package/mcp-server/tools/project/AuthAccountTool.js +36 -5
  97. package/mcp-server/tools/project/CreateProjectTool.js +13 -3
  98. package/mcp-server/tools/project/CreateTestAccountTool.js +13 -13
  99. package/mcp-server/tools/project/DeployProjectTool.d.ts +2 -2
  100. package/mcp-server/tools/project/DeployProjectTool.js +34 -16
  101. package/mcp-server/tools/project/DocFetchTool.js +1 -1
  102. package/mcp-server/tools/project/DocsSearchTool.d.ts +4 -1
  103. package/mcp-server/tools/project/DocsSearchTool.js +18 -9
  104. package/mcp-server/tools/project/FindProjectsTool.js +12 -0
  105. package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.d.ts +3 -2
  106. package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.js +38 -10
  107. package/mcp-server/tools/project/GetApplicationInfoTool.d.ts +2 -1
  108. package/mcp-server/tools/project/GetApplicationInfoTool.js +13 -14
  109. package/mcp-server/tools/project/GetBuildLogsTool.d.ts +2 -1
  110. package/mcp-server/tools/project/GetBuildLogsTool.js +12 -9
  111. package/mcp-server/tools/project/GetBuildStatusTool.d.ts +2 -1
  112. package/mcp-server/tools/project/GetBuildStatusTool.js +12 -9
  113. package/mcp-server/tools/project/GetConfigValuesTool.d.ts +2 -1
  114. package/mcp-server/tools/project/GetConfigValuesTool.js +11 -8
  115. package/mcp-server/tools/project/KnowledgeSearchTool.d.ts +29 -0
  116. package/mcp-server/tools/project/KnowledgeSearchTool.js +82 -0
  117. package/mcp-server/tools/project/UploadProjectTools.d.ts +2 -2
  118. package/mcp-server/tools/project/UploadProjectTools.js +52 -39
  119. package/mcp-server/tools/project/ValidateProjectTool.js +23 -7
  120. package/mcp-server/tools/project/apps.d.ts +8 -0
  121. package/mcp-server/tools/project/apps.js +7 -0
  122. package/mcp-server/tools/project/constants.d.ts +3 -0
  123. package/mcp-server/tools/project/constants.js +11 -1
  124. package/mcp-server/tools/project/productionConfirmation.d.ts +12 -0
  125. package/mcp-server/tools/project/productionConfirmation.js +45 -0
  126. package/mcp-server/tools/project/resolveAccount.d.ts +15 -0
  127. package/mcp-server/tools/project/resolveAccount.js +60 -0
  128. package/mcp-server/utils/command.d.ts +1 -0
  129. package/mcp-server/utils/command.js +8 -0
  130. package/mcp-server/utils/content.d.ts +1 -0
  131. package/mcp-server/utils/content.js +5 -0
  132. package/mcp-server/utils/elicitSelection.d.ts +11 -0
  133. package/mcp-server/utils/elicitSelection.js +25 -0
  134. package/mcp-server/utils/elicitation.d.ts +11 -0
  135. package/mcp-server/utils/elicitation.js +38 -0
  136. package/package.json +23 -22
  137. package/ui/components/Table.d.ts +8 -8
  138. package/lib/jsonOutput/deploy.d.ts +0 -5
  139. package/lib/jsonOutput/download.d.ts +0 -7
  140. /package/lib/jsonOutput/{info.d.ts → projectInfo.d.ts} +0 -0
  141. /package/lib/jsonOutput/{info.js → projectInfo.js} +0 -0
@@ -0,0 +1,167 @@
1
+ import { fetchProject } from '@hubspot/local-dev-lib/api/projects';
2
+ import { handleProjectUpload } from '../../../lib/projects/upload.js';
3
+ import { pollProjectBuildAndDeploy } from '../../../lib/projects/pollProjectBuildAndDeploy.js';
4
+ import { resolveBuildId } from '../../../lib/projects/release.js';
5
+ import { triggerAndPollPreview } from '../../../lib/projects/preview.js';
6
+ import { logError, ApiErrorContext } from '../../../lib/errorHandlers/index.js';
7
+ import { isPromptExitError } from '../../../lib/errors/PromptExitError.js';
8
+ import { getProjectConfig } from '../../../lib/projects/config.js';
9
+ import { confirmPrompt } from '../../../lib/prompts/promptUtils.js';
10
+ import { EXIT_CODES } from '../../../lib/enums/exitCodes.js';
11
+ import { uiLogger } from '../../../lib/ui/logger.js';
12
+ import { makeYargsBuilder } from '../../../lib/yargsUtils.js';
13
+ import { commands } from '../../../lang/en.js';
14
+ import { makeWrappedYargsHandler } from '../../../lib/yargs/makeWrappedYargsHandler.js';
15
+ import { ProjectReleasePreviewSchema, } from '../../../lib/jsonOutput/projectRelease.js';
16
+ const command = 'preview';
17
+ // const describe = commands.project.release.preview.describe;
18
+ const describe = undefined;
19
+ // const verboseDescribe = commands.project.release.preview.verboseDescribe;
20
+ const verboseDescribe = undefined;
21
+ function logUploadError(error, accountId) {
22
+ if (!error) {
23
+ return;
24
+ }
25
+ logError(error, new ApiErrorContext({
26
+ accountId,
27
+ request: 'project release preview',
28
+ }));
29
+ }
30
+ async function handler(args) {
31
+ const { exit, derivedAccountId, build: buildOption, target: targetPortalId, json: formatOutputAsJson, force, addJsonOutput, } = args;
32
+ let projectConfig;
33
+ let projectDir;
34
+ try {
35
+ ({ projectConfig, projectDir } = getProjectConfig());
36
+ }
37
+ catch (error) {
38
+ logError(error);
39
+ return exit(EXIT_CODES.ERROR);
40
+ }
41
+ const projectName = projectConfig.name;
42
+ let buildId;
43
+ try {
44
+ buildId = await resolveBuildId(derivedAccountId, projectName, buildOption, force);
45
+ }
46
+ catch (e) {
47
+ if (isPromptExitError(e)) {
48
+ return exit(e.exitCode);
49
+ }
50
+ logError(e, new ApiErrorContext({
51
+ accountId: derivedAccountId,
52
+ request: 'project release preview',
53
+ }));
54
+ return exit(EXIT_CODES.ERROR);
55
+ }
56
+ if (buildId === null) {
57
+ return exit(EXIT_CODES.ERROR);
58
+ }
59
+ if (!buildId && !force) {
60
+ let shouldUpload;
61
+ try {
62
+ shouldUpload = await confirmPrompt(commands.project.release.preview.uploadPrompt(projectName));
63
+ }
64
+ catch (e) {
65
+ if (isPromptExitError(e)) {
66
+ return exit(e.exitCode);
67
+ }
68
+ throw e;
69
+ }
70
+ if (!shouldUpload) {
71
+ return exit(EXIT_CODES.SUCCESS);
72
+ }
73
+ }
74
+ let projectId;
75
+ if (!buildId) {
76
+ const { result: pollResult, uploadError, projectNotFound, projectId: uploadedProjectId, } = await handleProjectUpload({
77
+ accountId: derivedAccountId,
78
+ projectConfig,
79
+ projectDir,
80
+ sendIR: true,
81
+ forceCreate: force,
82
+ force,
83
+ callbackFunc: (...args) => pollProjectBuildAndDeploy(...args, { skipDeploy: true }),
84
+ });
85
+ if (projectNotFound || !pollResult || !pollResult.succeeded) {
86
+ logUploadError(uploadError, derivedAccountId);
87
+ return exit(EXIT_CODES.ERROR);
88
+ }
89
+ buildId = pollResult.buildId;
90
+ projectId = uploadedProjectId;
91
+ }
92
+ if (!projectId) {
93
+ try {
94
+ const { data } = await fetchProject(derivedAccountId, projectName);
95
+ projectId = data.id;
96
+ }
97
+ catch (e) {
98
+ logError(e, new ApiErrorContext({
99
+ accountId: derivedAccountId,
100
+ request: 'project release preview',
101
+ }));
102
+ return exit(EXIT_CODES.ERROR);
103
+ }
104
+ }
105
+ const previewResult = await triggerAndPollPreview(derivedAccountId, projectId, buildId, targetPortalId);
106
+ addJsonOutput({
107
+ buildId,
108
+ targetPortalId,
109
+ releaseTag: previewResult.releaseTag,
110
+ succeeded: previewResult.succeeded,
111
+ });
112
+ if (!previewResult.succeeded) {
113
+ if (!formatOutputAsJson) {
114
+ uiLogger.error(commands.project.release.preview.errors.previewFailed);
115
+ }
116
+ return exit(EXIT_CODES.ERROR);
117
+ }
118
+ return exit(EXIT_CODES.SUCCESS);
119
+ }
120
+ function projectReleasePreviewBuilder(yargs) {
121
+ yargs.options({
122
+ build: {
123
+ alias: ['build-id'],
124
+ describe: commands.project.release.preview.options.build,
125
+ type: 'number',
126
+ },
127
+ target: {
128
+ describe: commands.project.release.preview.options.target,
129
+ type: 'number',
130
+ requiresArg: true,
131
+ demandOption: commands.project.release.preview.errors.targetRequired,
132
+ },
133
+ force: {
134
+ alias: ['f'],
135
+ describe: commands.project.release.preview.options.force,
136
+ default: false,
137
+ type: 'boolean',
138
+ },
139
+ });
140
+ yargs.example([
141
+ [
142
+ '$0 project release preview --target=12345',
143
+ commands.project.release.preview.examples.default,
144
+ ],
145
+ [
146
+ '$0 project release preview --build=5 --target=12345',
147
+ commands.project.release.preview.examples.withBuild,
148
+ ],
149
+ ]);
150
+ return yargs;
151
+ }
152
+ const builder = makeYargsBuilder(projectReleasePreviewBuilder, command, verboseDescribe, {
153
+ useGlobalOptions: true,
154
+ useConfigOptions: true,
155
+ useAccountOptions: true,
156
+ useEnvironmentOptions: true,
157
+ useJSONOutputOptions: true,
158
+ });
159
+ const projectReleasePreviewCommand = {
160
+ command,
161
+ describe,
162
+ builder,
163
+ handler: makeWrappedYargsHandler('project-release-preview', handler, {
164
+ jsonOutputSchema: ProjectReleasePreviewSchema,
165
+ }),
166
+ };
167
+ export default projectReleasePreviewCommand;
@@ -1,13 +1,19 @@
1
1
  import create from './release/create.js';
2
2
  import info from './release/info.js';
3
3
  import list from './release/list.js';
4
+ import preview from './release/preview.js';
4
5
  import { makeYargsBuilder } from '../../lib/yargsUtils.js';
5
6
  // import { commands } from '../../lang/en.js';
6
7
  const command = 'release';
7
8
  // const describe = commands.project.release.describe;
8
9
  const describe = undefined;
9
10
  function projectReleaseBuilder(yargs) {
10
- yargs.command(create).command(info).command(list).demandCommand(1, '');
11
+ yargs
12
+ .command(create)
13
+ .command(preview)
14
+ .command(info)
15
+ .command(list)
16
+ .demandCommand(1, '');
11
17
  return yargs;
12
18
  }
13
19
  const builder = makeYargsBuilder(projectReleaseBuilder, command, describe);
@@ -1,6 +1,6 @@
1
1
  import { CommonArgs, JSONOutputArgs, YargsCommandModule } from '../../types/Yargs.js';
2
- import { UploadJsonOutput } from '../../lib/jsonOutput/upload.js';
3
- export type ProjectUploadArgs = CommonArgs & JSONOutputArgs<UploadJsonOutput> & {
2
+ import { ProjectUploadJsonOutput } from '../../lib/jsonOutput/projectUpload.js';
3
+ export type ProjectUploadArgs = CommonArgs & JSONOutputArgs<ProjectUploadJsonOutput> & {
4
4
  force: boolean;
5
5
  forceCreate: boolean;
6
6
  message: string;
@@ -14,7 +14,7 @@ import { PROJECT_ERROR_TYPES } from '../../lib/constants.js';
14
14
  import { logError, ApiErrorContext } from '../../lib/errorHandlers/index.js';
15
15
  import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
16
16
  import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
17
- import { mapAccountToTargetAccount, UploadSchema, } from '../../lib/jsonOutput/upload.js';
17
+ import { mapAccountToTargetAccount, ProjectUploadSchema, } from '../../lib/jsonOutput/projectUpload.js';
18
18
  import { makeYargsBuilder } from '../../lib/yargsUtils.js';
19
19
  import { projectProfilePrompt } from '../../lib/prompts/projectProfilePrompt.js';
20
20
  import { uiDeprecatedTag } from '../../lib/ui/index.js';
@@ -262,7 +262,7 @@ const projectUploadCommand = {
262
262
  command,
263
263
  describe,
264
264
  handler: makeWrappedYargsHandler('project-upload', handler, {
265
- jsonOutputSchema: UploadSchema,
265
+ jsonOutputSchema: ProjectUploadSchema,
266
266
  }),
267
267
  builder,
268
268
  };
@@ -1,6 +1,6 @@
1
1
  import { CommonArgs, JSONOutputArgs, YargsCommandModule } from '../../types/Yargs.js';
2
- import { ValidateJsonOutput } from '../../lib/jsonOutput/validate.js';
3
- export type ProjectValidateArgs = CommonArgs & JSONOutputArgs<ValidateJsonOutput> & {
2
+ import { ProjectValidateJsonOutput } from '../../lib/jsonOutput/projectValidate.js';
3
+ export type ProjectValidateArgs = CommonArgs & JSONOutputArgs<ProjectValidateJsonOutput> & {
4
4
  profile?: string;
5
5
  };
6
6
  declare const projectValidateCommand: YargsCommandModule<unknown, ProjectValidateArgs>;
@@ -8,7 +8,7 @@ import { makeYargsBuilder } from '../../lib/yargsUtils.js';
8
8
  import { commands } from '../../lang/en.js';
9
9
  import { logError } from '../../lib/errorHandlers/index.js';
10
10
  import { validateProject, toIssue, } from '../../lib/projects/validate.js';
11
- import { ValidateSchema, } from '../../lib/jsonOutput/validate.js';
11
+ import { ProjectValidateSchema, } from '../../lib/jsonOutput/projectValidate.js';
12
12
  const command = 'validate';
13
13
  const describe = commands.project.validate.describe;
14
14
  function generateJson({ result, projectConfig, profile, }) {
@@ -119,7 +119,7 @@ const projectValidateCommand = {
119
119
  command,
120
120
  describe,
121
121
  handler: makeWrappedYargsHandler('project-validate', handler, {
122
- jsonOutputSchema: ValidateSchema,
122
+ jsonOutputSchema: ProjectValidateSchema,
123
123
  }),
124
124
  builder,
125
125
  };
@@ -1,7 +1,7 @@
1
1
  import { AccountLevel } from '@hubspot/local-dev-lib/types/developerTestAccounts.js';
2
2
  import { CommonArgs, ConfigArgs, AccountArgs, TestingArgs, EnvironmentArgs, JSONOutputArgs, YargsCommandModule } from '../../types/Yargs.js';
3
- import { CreateTestAccountJsonOutput } from '../../lib/jsonOutput/createTestAccount.js';
4
- type CreateTestAccountArgs = CommonArgs & AccountArgs & ConfigArgs & TestingArgs & EnvironmentArgs & JSONOutputArgs<CreateTestAccountJsonOutput> & {
3
+ import { TestAccountCreateJsonOutput } from '../../lib/jsonOutput/testAccountCreate.js';
4
+ type CreateTestAccountArgs = CommonArgs & AccountArgs & ConfigArgs & TestingArgs & EnvironmentArgs & JSONOutputArgs<TestAccountCreateJsonOutput> & {
5
5
  configPath?: string;
6
6
  name?: string;
7
7
  description?: string;
@@ -4,7 +4,7 @@ import { getValidEnv } from '@hubspot/local-dev-lib/environment';
4
4
  import { getConfigAccountEnvironment } from '@hubspot/local-dev-lib/config';
5
5
  import { getCwd } from '@hubspot/local-dev-lib/path';
6
6
  import { makeWrappedYargsHandler } from '../../lib/yargs/makeWrappedYargsHandler.js';
7
- import { CreateTestAccountSchema, } from '../../lib/jsonOutput/createTestAccount.js';
7
+ import { TestAccountCreateSchema, } from '../../lib/jsonOutput/testAccountCreate.js';
8
8
  import { makeYargsBuilder } from '../../lib/yargsUtils.js';
9
9
  import { promptUser, listPrompt } from '../../lib/prompts/promptUtils.js';
10
10
  import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
@@ -229,7 +229,7 @@ const createTestAccountCommand = {
229
229
  command,
230
230
  describe,
231
231
  handler: makeWrappedYargsHandler('test-account-create', handler, {
232
- jsonOutputSchema: CreateTestAccountSchema,
232
+ jsonOutputSchema: TestAccountCreateSchema,
233
233
  }),
234
234
  builder,
235
235
  };
package/lang/en.d.ts CHANGED
@@ -1601,6 +1601,7 @@ export declare const commands: {
1601
1601
  };
1602
1602
  migrateApp: {
1603
1603
  describe: string;
1604
+ verboseDescribe: string;
1604
1605
  examples: {
1605
1606
  default: string;
1606
1607
  };
@@ -1645,6 +1646,7 @@ export declare const commands: {
1645
1646
  migrate: {
1646
1647
  preamble: (platformVersion: string) => string;
1647
1648
  describe: string;
1649
+ verboseDescribe: string;
1648
1650
  errors: {
1649
1651
  noProjectConfig: (command: string) => string;
1650
1652
  };
@@ -1758,6 +1760,7 @@ export declare const commands: {
1758
1760
  verboseDescribe: string;
1759
1761
  confirmPrompt: (projectName: string, buildId: number) => string;
1760
1762
  success: (releaseTag: string, buildId: number) => string;
1763
+ successNoTag: (buildId: number) => string;
1761
1764
  cancelled: string;
1762
1765
  buildIdPrompt: string;
1763
1766
  noUploadMessage: string;
@@ -1820,6 +1823,24 @@ export declare const commands: {
1820
1823
  json: string;
1821
1824
  };
1822
1825
  };
1826
+ preview: {
1827
+ describe: string;
1828
+ verboseDescribe: string;
1829
+ uploadPrompt: (projectName: string) => string;
1830
+ errors: {
1831
+ targetRequired: string;
1832
+ previewFailed: string;
1833
+ };
1834
+ options: {
1835
+ build: string;
1836
+ target: string;
1837
+ force: string;
1838
+ };
1839
+ examples: {
1840
+ default: string;
1841
+ withBuild: string;
1842
+ };
1843
+ };
1823
1844
  };
1824
1845
  listBuilds: {
1825
1846
  describe: string;
@@ -3537,6 +3558,12 @@ export declare const lib: {
3537
3558
  updateFailed: (latestVersion: string) => string;
3538
3559
  enableAutoUpdatesMessage: string;
3539
3560
  };
3561
+ deprecationWarning: {
3562
+ deprecatedTitle: string;
3563
+ deprecatedMessage: (currentVersion: string, eolDate: string) => string;
3564
+ endOfLifeTitle: string;
3565
+ endOfLifeMessage: (currentVersion: string, eolDate: string) => string;
3566
+ };
3540
3567
  };
3541
3568
  projectProfiles: {
3542
3569
  logs: {
package/lang/en.js CHANGED
@@ -2,11 +2,12 @@ import chalk from 'chalk';
2
2
  import { mapToUserFriendlyName } from '@hubspot/project-parsing-lib/transform';
3
3
  import { PLATFORM_VERSIONS } from '@hubspot/project-parsing-lib/constants';
4
4
  import { PERSONAL_ACCESS_KEY_AUTH_METHOD } from '@hubspot/local-dev-lib/constants/auth';
5
- import { APP_AUTH_TYPES, APP_DISTRIBUTION_TYPES, LEGACY_PUBLIC_APP_FILE, LOCAL_DEV_DEFAULT_PORT, PROJECT_CONFIG_FILE, PROJECT_WITH_APP, } from '../lib/constants.js';
5
+ import { APP_AUTH_TYPES, APP_DISTRIBUTION_TYPES, CLI_SUPPORT_GUIDELINES_URL, LEGACY_PUBLIC_APP_FILE, LOCAL_DEV_DEFAULT_PORT, PROJECT_CONFIG_FILE, PROJECT_WITH_APP, } from '../lib/constants.js';
6
6
  import { ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME, DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME, GLOBAL_CONFIG_PATH, } from '@hubspot/local-dev-lib/constants/config';
7
7
  import { indent, UI_COLORS, uiAccountDescription, uiAuthCommandReference, uiBetaTag, uiCommandReference, uiDeprecatedTag, uiLink, } from '../lib/ui/index.js';
8
8
  import { getLocalDevUiUrl, getProjectDetailUrl, getProjectSettingsUrl, } from '../lib/projects/urls.js';
9
9
  import { getProductUpdatesUrl } from '../lib/links.js';
10
+ const MIGRATION_SUPPORT_CUTOFF_NOTICE = 'Automated platform version migrations beyond 2026.09 will not be supported.';
10
11
  export const commands = {
11
12
  generalErrors: {
12
13
  srcIsProject: (src, command) => `"${src}" is in a project folder. Did you mean "hs project ${command}"?`,
@@ -1616,7 +1617,8 @@ export const commands = {
1616
1617
  },
1617
1618
  },
1618
1619
  migrateApp: {
1619
- describe: 'Migrate a public app to the projects framework.',
1620
+ describe: uiDeprecatedTag(`Migrate a public app to the projects framework. ${MIGRATION_SUPPORT_CUTOFF_NOTICE}`, false),
1621
+ verboseDescribe: uiDeprecatedTag(`Migrate a public app to the projects framework. This command walks you through the fields required to complete the migration and downloads the project source code into a directory of your choosing.\n\n${chalk.bold.yellow(MIGRATION_SUPPORT_CUTOFF_NOTICE)}`, false),
1620
1622
  examples: {
1621
1623
  default: 'Migrate a public app to the projects framework',
1622
1624
  },
@@ -1660,7 +1662,8 @@ export const commands = {
1660
1662
  },
1661
1663
  migrate: {
1662
1664
  preamble: (platformVersion) => `This command will migrate an existing project to platformVersion ${platformVersion}. It will walk you through the fields required to complete the migration and download the new project source code into the project source directory. It will also copy all of your existing files to a new directory (archive) in case you need access to your old files later.`,
1663
- describe: 'Migrate an existing project to the new version of the projects framework.',
1665
+ describe: uiDeprecatedTag(`Migrate an existing project to the new version of the projects framework. ${MIGRATION_SUPPORT_CUTOFF_NOTICE}`, false),
1666
+ verboseDescribe: uiDeprecatedTag(`Migrate an existing project to a newer platform version. This command walks you through the fields required to complete the migration and downloads the new project source code into the project source directory. Your existing files are copied to a new directory (archive) in case you need access to them later.\n\n${chalk.bold.yellow(MIGRATION_SUPPORT_CUTOFF_NOTICE)}`, false),
1664
1667
  errors: {
1665
1668
  noProjectConfig: (command) => `No project detected. Please run this command again from a project directory. If you are trying to migrate an app, run ${command}`,
1666
1669
  },
@@ -1774,6 +1777,7 @@ export const commands = {
1774
1777
  verboseDescribe: `Create a release for a project build\n\nReleases mark an uploaded build with an auto-generated semantic version tag (e.g. v1.0.0).\n\nBy default, the latest build is used. Use ${uiCommandReference('--build')} to specify a different build ID.`,
1775
1778
  confirmPrompt: (projectName, buildId) => `Create a release for project ${chalk.bold(projectName)} using build ${chalk.bold(String(buildId))}?`,
1776
1779
  success: (releaseTag, buildId) => `Release ${chalk.bold(releaseTag)} created for build ${chalk.bold(String(buildId))}.`,
1780
+ successNoTag: (buildId) => `Released build ${chalk.bold(String(buildId))}. Your project is now live.`,
1777
1781
  cancelled: 'Release creation cancelled.',
1778
1782
  buildIdPrompt: '[--build] Select a successful build to release:',
1779
1783
  noUploadMessage: 'No upload message',
@@ -1836,6 +1840,24 @@ export const commands = {
1836
1840
  json: 'Output release details as JSON',
1837
1841
  },
1838
1842
  },
1843
+ preview: {
1844
+ describe: 'Build and preview a project on a target portal.',
1845
+ verboseDescribe: `Build and preview a project on a target portal\n\nUploads the current project (unless ${uiCommandReference('--build')} is passed), then deploys that build to the target portal so you can try it before releasing it. Use ${uiCommandReference('--target')} to choose the portal.`,
1846
+ uploadPrompt: (projectName) => `No successful builds for project ${chalk.bold(projectName)}. Would you like to upload it?`,
1847
+ errors: {
1848
+ targetRequired: `${uiCommandReference('--target=<portalId>')} is required to specify the portal to preview on.`,
1849
+ previewFailed: 'The preview failed. You can try again or preview this build from the project UI.',
1850
+ },
1851
+ options: {
1852
+ build: 'Build ID to preview. Defaults to the latest build.',
1853
+ target: 'Portal ID to preview the build on.',
1854
+ force: 'Skip all confirmation prompts, including automatic upload when no build exists.',
1855
+ },
1856
+ examples: {
1857
+ default: 'Build and preview the current project on a target portal',
1858
+ withBuild: 'Preview a specific build on a target portal',
1859
+ },
1860
+ },
1839
1861
  },
1840
1862
  listBuilds: {
1841
1863
  describe: "List the project's builds.",
@@ -1924,7 +1946,7 @@ export const commands = {
1924
1946
  runCommand: (command) => `Run \`${uiCommandReference(command)}\``,
1925
1947
  autoDeployDisabled: (deployCommand) => `Automatic deploys are disabled for this project. Run ${uiCommandReference(deployCommand)} to deploy this build.`,
1926
1948
  autoDeploySkipped: (deployCommand) => `Auto-deploy was skipped for this build. Run ${uiCommandReference(deployCommand)} to deploy this build.`,
1927
- releaseManagementRequired: (releaseCommand) => `Run ${uiCommandReference(releaseCommand)} to create a release for this build.`,
1949
+ releaseManagementRequired: (releaseCommand) => `This build is not live yet. Run ${uiCommandReference(releaseCommand)} to make it live.`,
1928
1950
  uploadingWithProfile: (profileName, accountId) => `Initializing project upload with ${chalk.bold(profileName)} profile: ${uiAccountDescription(accountId)}`,
1929
1951
  uploadingToAccount: (accountId) => `Initializing project upload to account ${uiAccountDescription(accountId)}`,
1930
1952
  uploadedToAccount: (accountId) => `Project uploaded to ${uiAccountDescription(accountId)}`,
@@ -3576,6 +3598,12 @@ export const lib = {
3576
3598
  updateFailed: (latestVersion) => `Failed to update HubSpot CLI to version ${chalk.bold(latestVersion)}`,
3577
3599
  enableAutoUpdatesMessage: `The HubSpot CLI can automatically keep itself up to date.\n\nThis helps ensure compatibility with the HubSpot platform. You can change this later at any time.\n\nRun ${uiCommandReference('hs config set --allow-auto-updates=true')}`,
3578
3600
  },
3601
+ deprecationWarning: {
3602
+ deprecatedTitle: 'Deprecated',
3603
+ deprecatedMessage: (currentVersion, eolDate) => `Version: HubSpot CLI v${currentVersion}\n\nStatus: Deprecated (End of Life: ${eolDate})\n\nAction Required: Upgrade to the latest major version to continue receiving new features\n\nReplacement: Run ${uiCommandReference('npm install -g @hubspot/cli@latest')} to upgrade\n\n${uiLink('CLI Support Guidelines', CLI_SUPPORT_GUIDELINES_URL)}`,
3604
+ endOfLifeTitle: 'End of Life',
3605
+ endOfLifeMessage: (currentVersion, eolDate) => `Version: HubSpot CLI v${currentVersion}\n\nStatus: End of Life (as of ${eolDate})\n\nAction Required: This version is no longer supported. Upgrade immediately to continue receiving updates\n\nReplacement: Run ${uiCommandReference('npm install -g @hubspot/cli@latest')} to upgrade\n\n${uiLink('CLI Support Guidelines', CLI_SUPPORT_GUIDELINES_URL)}`,
3606
+ },
3579
3607
  },
3580
3608
  projectProfiles: {
3581
3609
  logs: {
@@ -1,5 +1,6 @@
1
1
  import { Environment } from '@hubspot/local-dev-lib/types/Accounts';
2
2
  import { HubSpotConfigAccount } from '@hubspot/local-dev-lib/types/Accounts';
3
+ export declare function getCurrentDefaultAccount(): HubSpotConfigAccount | undefined;
3
4
  type AuthenticateNewAccountOptions = {
4
5
  env: Environment;
5
6
  providedPersonalAccessKey?: string;
@@ -100,6 +100,14 @@ async function handleConfigMigration() {
100
100
  return false;
101
101
  }
102
102
  }
103
+ export function getCurrentDefaultAccount() {
104
+ try {
105
+ return getConfigDefaultAccountIfExists();
106
+ }
107
+ catch {
108
+ return undefined;
109
+ }
110
+ }
103
111
  export async function authenticateNewAccount({ env, providedPersonalAccessKey, accountId, setAsDefaultAccount, accountName: providedAccountName, useDefaultAccountName, }) {
104
112
  const configMigrationSuccess = await handleConfigMigration();
105
113
  if (!configMigrationSuccess) {
package/lib/app/urls.d.ts CHANGED
@@ -13,7 +13,6 @@ type PublicAppInstallUrlArgs = {
13
13
  };
14
14
  export declare function getOauthAppInstallUrl({ targetAccountId, env, clientId, scopes, redirectUrls, }: PublicAppInstallUrlArgs): string;
15
15
  export declare function getStaticAuthAppInstallUrl({ targetAccountId, env, appId, }: PrivateAppInstallUrlArgs): string;
16
- export declare function getAppCardSetupUrl({ targetAccountId, env, appId, }: PrivateAppInstallUrlArgs): string;
17
16
  export declare function getAppLogsUrl(accountId: number, appId: number, systemType: string): string;
18
17
  export declare function getAppLogDetailsUrl(accountId: number, appId: number, systemType: string, logId: string): string;
19
18
  export {};
package/lib/app/urls.js CHANGED
@@ -10,10 +10,6 @@ export function getStaticAuthAppInstallUrl({ targetAccountId, env, appId, }) {
10
10
  const websiteOrigin = getHubSpotWebsiteOrigin(env);
11
11
  return `${websiteOrigin}/static-token/${targetAccountId}/authorize?appId=${appId}`;
12
12
  }
13
- export function getAppCardSetupUrl({ targetAccountId, env, appId, }) {
14
- const websiteOrigin = getHubSpotWebsiteOrigin(env);
15
- return `${websiteOrigin}/integrations-settings/${targetAccountId}/installed/framework/${appId}/app-cards?tourId=get-started`;
16
- }
17
13
  export function getAppLogsUrl(accountId, appId, systemType) {
18
14
  return `${getHubSpotWebsiteOriginByAccountId(accountId)}/developer-monitoring/${accountId}/?logType=${systemType}&appId=${appId}`;
19
15
  }
@@ -4,8 +4,14 @@ export declare const DEFAULT_PROJECT_TEMPLATE_BRANCH: "main";
4
4
  export declare const FEEDBACK_INTERVAL: 10;
5
5
  export declare const HUBSPOT_FOLDER: "@hubspot";
6
6
  export declare const MARKETPLACE_FOLDER: "@marketplace";
7
+ export declare const ONE_DAY_IN_MILLISECONDS: number;
8
+ export declare const CLI_DEPRECATED_MAJOR_VERSION = 7;
9
+ export declare const CLI_DEPRECATED_MAJOR_VERSION_DEPRECATION_DATE = "2026-09-02";
10
+ export declare const CLI_DEPRECATED_MAJOR_VERSION_EOL_DATE = "2027-03-01";
11
+ export declare const CLI_SUPPORT_GUIDELINES_URL: "https://developers.hubspot.com/docs/developer-tooling/local-development/hubspot-cli/version-support";
7
12
  export declare const DEFAULT_POLLING_DELAY = 2000;
8
13
  export declare const PREVIEW_POLL_TIMEOUT: number;
14
+ export declare const MCP_ELICITATION_TIMEOUT: number;
9
15
  export declare const PROJECT_CONFIG_FILE: "hsproject.json";
10
16
  export declare const PROJECT_BUILD_STATES: {
11
17
  readonly BUILDING: "BUILDING";
package/lib/constants.js CHANGED
@@ -4,8 +4,19 @@ export const DEFAULT_PROJECT_TEMPLATE_BRANCH = 'main';
4
4
  export const FEEDBACK_INTERVAL = 10;
5
5
  export const HUBSPOT_FOLDER = '@hubspot';
6
6
  export const MARKETPLACE_FOLDER = '@marketplace';
7
+ export const ONE_DAY_IN_MILLISECONDS = 24 * 60 * 60 * 1000;
8
+ // The previous major CLI version, per the CLI Version Support &
9
+ // Deprecation Policy. Only 1 previous major version is supported at a time.
10
+ export const CLI_DEPRECATED_MAJOR_VERSION = 7;
11
+ // The date CLI_DEPRECATED_MAJOR_VERSION enters its Deprecation Phase
12
+ export const CLI_DEPRECATED_MAJOR_VERSION_DEPRECATION_DATE = '2026-09-02';
13
+ // The date CLI_DEPRECATED_MAJOR_VERSION reaches end of life
14
+ export const CLI_DEPRECATED_MAJOR_VERSION_EOL_DATE = '2027-03-01';
15
+ export const CLI_SUPPORT_GUIDELINES_URL = 'https://developers.hubspot.com/docs/developer-tooling/local-development/hubspot-cli/version-support';
7
16
  export const DEFAULT_POLLING_DELAY = 2000;
8
17
  export const PREVIEW_POLL_TIMEOUT = 5 * 60 * 1000;
18
+ // MCP forms wait on a person, so they need longer than the SDK default of 60s.
19
+ export const MCP_ELICITATION_TIMEOUT = 5 * 60 * 1000;
9
20
  export const PROJECT_CONFIG_FILE = 'hsproject.json';
10
21
  export const PROJECT_BUILD_STATES = {
11
22
  BUILDING: 'BUILDING',
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export declare const AccountAuthSchema: z.ZodObject<{
3
+ accountId: z.ZodNumber;
4
+ accountName: z.ZodOptional<z.ZodString>;
5
+ authType: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>;
7
+ export type AccountAuthJsonOutput = z.infer<typeof AccountAuthSchema>;
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ export const AccountAuthSchema = z.object({
3
+ accountId: z.number(),
4
+ accountName: z.string().optional(),
5
+ authType: z.string().optional(),
6
+ });
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ export declare const ProjectAddSchema: z.ZodObject<{
3
+ addedFeatures: z.ZodOptional<z.ZodArray<z.ZodString>>;
4
+ app: z.ZodOptional<z.ZodObject<{
5
+ distribution: z.ZodString;
6
+ auth: z.ZodString;
7
+ }, z.core.$strip>>;
8
+ }, z.core.$strip>;
9
+ export type ProjectAddJsonOutput = z.infer<typeof ProjectAddSchema>;
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ export const ProjectAddSchema = z.object({
3
+ addedFeatures: z.array(z.string()).optional(),
4
+ app: z
5
+ .object({
6
+ distribution: z.string(),
7
+ auth: z.string(),
8
+ })
9
+ .optional(),
10
+ });
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export declare const InstallStatusSchema: z.ZodObject<{
2
+ export declare const ProjectAppInstallStatusSchema: z.ZodObject<{
3
3
  appId: z.ZodOptional<z.ZodNumber>;
4
4
  appUid: z.ZodString;
5
5
  accountId: z.ZodNumber;
@@ -11,4 +11,4 @@ export declare const InstallStatusSchema: z.ZodObject<{
11
11
  name: z.ZodString;
12
12
  }, z.core.$strip>>;
13
13
  }, z.core.$strip>;
14
- export type InstallStatusJsonOutput = z.infer<typeof InstallStatusSchema>;
14
+ export type ProjectAppInstallStatusJsonOutput = z.infer<typeof ProjectAppInstallStatusSchema>;
@@ -3,7 +3,7 @@ const ScopeGroupSchema = z.object({
3
3
  id: z.number(),
4
4
  name: z.string(),
5
5
  });
6
- export const InstallStatusSchema = z.object({
6
+ export const ProjectAppInstallStatusSchema = z.object({
7
7
  appId: z.number().optional(),
8
8
  appUid: z.string(),
9
9
  accountId: z.number(),
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ export declare const ProjectCreateSchema: z.ZodObject<{
3
+ name: z.ZodOptional<z.ZodString>;
4
+ location: z.ZodOptional<z.ZodString>;
5
+ platformVersion: z.ZodOptional<z.ZodString>;
6
+ projectBase: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strip>;
8
+ export type ProjectCreateJsonOutput = z.infer<typeof ProjectCreateSchema>;
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export const ProjectCreateSchema = z.object({
3
+ name: z.string().optional(),
4
+ location: z.string().optional(),
5
+ platformVersion: z.string().optional(),
6
+ projectBase: z.string().optional(),
7
+ });
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ export declare const ProjectDeploySchema: z.ZodObject<{
3
+ deployId: z.ZodOptional<z.ZodNumber>;
4
+ }, z.core.$strip>;
5
+ export type ProjectDeployJsonOutput = z.infer<typeof ProjectDeploySchema>;
@@ -1,4 +1,4 @@
1
1
  import { z } from 'zod';
2
- export const DeploySchema = z.object({
2
+ export const ProjectDeploySchema = z.object({
3
3
  deployId: z.number().optional(),
4
4
  });
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export declare const ProjectDownloadSchema: z.ZodObject<{
3
+ projectName: z.ZodString;
4
+ buildId: z.ZodNumber;
5
+ dest: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export type ProjectDownloadJsonOutput = z.infer<typeof ProjectDownloadSchema>;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export const DownloadSchema = z.object({
2
+ export const ProjectDownloadSchema = z.object({
3
3
  projectName: z.string(),
4
4
  buildId: z.number(),
5
5
  dest: z.string(),
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export declare const InstallAppSchema: z.ZodObject<{
2
+ export declare const ProjectInstallAppSchema: z.ZodObject<{
3
3
  appId: z.ZodNumber;
4
4
  appUid: z.ZodString;
5
5
  accountId: z.ZodNumber;
@@ -8,4 +8,4 @@ export declare const InstallAppSchema: z.ZodObject<{
8
8
  installed: z.ZodBoolean;
9
9
  reinstalled: z.ZodBoolean;
10
10
  }, z.core.$strip>;
11
- export type InstallAppJsonOutput = z.infer<typeof InstallAppSchema>;
11
+ export type ProjectInstallAppJsonOutput = z.infer<typeof ProjectInstallAppSchema>;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export const InstallAppSchema = z.object({
2
+ export const ProjectInstallAppSchema = z.object({
3
3
  appId: z.number(),
4
4
  appUid: z.string(),
5
5
  accountId: z.number(),