@hubspot/cli 8.15.0 → 8.16.0-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 (125) 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/project/add.d.ts +3 -2
  6. package/commands/project/add.js +10 -8
  7. package/commands/project/appInstallStatus.d.ts +2 -2
  8. package/commands/project/appInstallStatus.js +2 -2
  9. package/commands/project/create.d.ts +4 -2
  10. package/commands/project/create.js +16 -4
  11. package/commands/project/deploy.d.ts +2 -2
  12. package/commands/project/deploy.js +2 -2
  13. package/commands/project/download.d.ts +2 -2
  14. package/commands/project/download.js +2 -2
  15. package/commands/project/info.d.ts +1 -1
  16. package/commands/project/info.js +1 -1
  17. package/commands/project/installApp.d.ts +2 -2
  18. package/commands/project/installApp.js +2 -2
  19. package/commands/project/listBuilds.d.ts +2 -2
  20. package/commands/project/listBuilds.js +2 -2
  21. package/commands/project/release/create.d.ts +2 -2
  22. package/commands/project/release/create.js +7 -3
  23. package/commands/project/release/info.d.ts +2 -2
  24. package/commands/project/release/info.js +2 -2
  25. package/commands/project/release/list.d.ts +2 -2
  26. package/commands/project/release/list.js +2 -2
  27. package/commands/project/release/preview.d.ts +9 -0
  28. package/commands/project/release/preview.js +167 -0
  29. package/commands/project/release.js +7 -1
  30. package/commands/project/upload.d.ts +2 -2
  31. package/commands/project/upload.js +2 -2
  32. package/commands/project/validate.d.ts +2 -2
  33. package/commands/project/validate.js +2 -2
  34. package/commands/testAccount/create.d.ts +2 -2
  35. package/commands/testAccount/create.js +2 -2
  36. package/lang/en.d.ts +25 -0
  37. package/lang/en.js +27 -2
  38. package/lib/app/urls.d.ts +0 -1
  39. package/lib/app/urls.js +0 -4
  40. package/lib/constants.d.ts +5 -0
  41. package/lib/constants.js +9 -0
  42. package/lib/jsonOutput/accountAuth.d.ts +7 -0
  43. package/lib/jsonOutput/accountAuth.js +6 -0
  44. package/lib/jsonOutput/projectAdd.d.ts +9 -0
  45. package/lib/jsonOutput/projectAdd.js +10 -0
  46. package/lib/jsonOutput/{appInstallStatus.d.ts → projectAppInstallStatus.d.ts} +2 -2
  47. package/lib/jsonOutput/{appInstallStatus.js → projectAppInstallStatus.js} +1 -1
  48. package/lib/jsonOutput/projectCreate.d.ts +8 -0
  49. package/lib/jsonOutput/projectCreate.js +7 -0
  50. package/lib/jsonOutput/projectDeploy.d.ts +5 -0
  51. package/lib/jsonOutput/{deploy.js → projectDeploy.js} +1 -1
  52. package/lib/jsonOutput/projectDownload.d.ts +7 -0
  53. package/lib/jsonOutput/{download.js → projectDownload.js} +1 -1
  54. package/lib/jsonOutput/{installApp.d.ts → projectInstallApp.d.ts} +2 -2
  55. package/lib/jsonOutput/{installApp.js → projectInstallApp.js} +1 -1
  56. package/lib/jsonOutput/{listBuilds.d.ts → projectListBuilds.d.ts} +2 -2
  57. package/lib/jsonOutput/{listBuilds.js → projectListBuilds.js} +1 -1
  58. package/lib/jsonOutput/{release.d.ts → projectRelease.d.ts} +15 -8
  59. package/lib/jsonOutput/{release.js → projectRelease.js} +11 -4
  60. package/lib/jsonOutput/{upload.d.ts → projectUpload.d.ts} +2 -2
  61. package/lib/jsonOutput/{upload.js → projectUpload.js} +1 -1
  62. package/lib/jsonOutput/{validate.d.ts → projectValidate.d.ts} +2 -2
  63. package/lib/jsonOutput/{validate.js → projectValidate.js} +1 -1
  64. package/lib/jsonOutput/{createTestAccount.d.ts → testAccountCreate.d.ts} +2 -2
  65. package/lib/jsonOutput/{createTestAccount.js → testAccountCreate.js} +1 -1
  66. package/lib/middleware/deprecationWarningMiddleware.d.ts +1 -0
  67. package/lib/middleware/deprecationWarningMiddleware.js +57 -0
  68. package/lib/projects/add/legacyAddComponent.d.ts +2 -1
  69. package/lib/projects/add/legacyAddComponent.js +3 -0
  70. package/lib/projects/add/v2AddComponent.d.ts +2 -1
  71. package/lib/projects/add/v2AddComponent.js +7 -1
  72. package/lib/projects/localDev/LocalDevWatcher.js +1 -1
  73. package/lib/projects/release.d.ts +2 -2
  74. package/lib/projects/validate.d.ts +1 -1
  75. package/mcp-server/Tool.d.ts +6 -1
  76. package/mcp-server/Tool.js +6 -4
  77. package/mcp-server/server.js +26 -4
  78. package/mcp-server/tools/cms/HsCreateFunctionTool.js +1 -1
  79. package/mcp-server/tools/cms/HsFunctionLogsTool.d.ts +1 -1
  80. package/mcp-server/tools/cms/HsFunctionLogsTool.js +59 -5
  81. package/mcp-server/tools/cms/HsListFunctionsTool.js +1 -1
  82. package/mcp-server/tools/index.js +2 -0
  83. package/mcp-server/tools/project/AddFeatureToProjectTool.js +31 -31
  84. package/mcp-server/tools/project/AuthAccountTool.js +12 -2
  85. package/mcp-server/tools/project/CreateProjectTool.js +13 -3
  86. package/mcp-server/tools/project/CreateTestAccountTool.js +13 -13
  87. package/mcp-server/tools/project/DeployProjectTool.js +9 -1
  88. package/mcp-server/tools/project/DocFetchTool.js +1 -1
  89. package/mcp-server/tools/project/DocsSearchTool.d.ts +4 -1
  90. package/mcp-server/tools/project/DocsSearchTool.js +18 -9
  91. package/mcp-server/tools/project/FindProjectsTool.js +12 -0
  92. package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.d.ts +3 -2
  93. package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.js +38 -10
  94. package/mcp-server/tools/project/GetApplicationInfoTool.d.ts +2 -1
  95. package/mcp-server/tools/project/GetApplicationInfoTool.js +13 -14
  96. package/mcp-server/tools/project/GetBuildLogsTool.d.ts +2 -1
  97. package/mcp-server/tools/project/GetBuildLogsTool.js +12 -9
  98. package/mcp-server/tools/project/GetBuildStatusTool.d.ts +2 -1
  99. package/mcp-server/tools/project/GetBuildStatusTool.js +12 -9
  100. package/mcp-server/tools/project/GetConfigValuesTool.d.ts +2 -1
  101. package/mcp-server/tools/project/GetConfigValuesTool.js +11 -8
  102. package/mcp-server/tools/project/KnowledgeSearchTool.d.ts +29 -0
  103. package/mcp-server/tools/project/KnowledgeSearchTool.js +82 -0
  104. package/mcp-server/tools/project/UploadProjectTools.js +3 -3
  105. package/mcp-server/tools/project/ValidateProjectTool.js +23 -7
  106. package/mcp-server/tools/project/apps.d.ts +8 -0
  107. package/mcp-server/tools/project/apps.js +7 -0
  108. package/mcp-server/tools/project/constants.d.ts +2 -0
  109. package/mcp-server/tools/project/constants.js +8 -1
  110. package/mcp-server/tools/project/resolveAccount.d.ts +15 -0
  111. package/mcp-server/tools/project/resolveAccount.js +60 -0
  112. package/mcp-server/utils/command.d.ts +1 -0
  113. package/mcp-server/utils/command.js +8 -0
  114. package/mcp-server/utils/content.d.ts +1 -0
  115. package/mcp-server/utils/content.js +5 -0
  116. package/mcp-server/utils/elicitSelection.d.ts +11 -0
  117. package/mcp-server/utils/elicitSelection.js +25 -0
  118. package/mcp-server/utils/elicitation.d.ts +9 -0
  119. package/mcp-server/utils/elicitation.js +35 -0
  120. package/package.json +23 -22
  121. package/ui/components/Table.d.ts +8 -8
  122. package/lib/jsonOutput/deploy.d.ts +0 -5
  123. package/lib/jsonOutput/download.d.ts +0 -7
  124. /package/lib/jsonOutput/{info.d.ts → projectInfo.d.ts} +0 -0
  125. /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
@@ -1758,6 +1758,7 @@ export declare const commands: {
1758
1758
  verboseDescribe: string;
1759
1759
  confirmPrompt: (projectName: string, buildId: number) => string;
1760
1760
  success: (releaseTag: string, buildId: number) => string;
1761
+ successNoTag: (buildId: number) => string;
1761
1762
  cancelled: string;
1762
1763
  buildIdPrompt: string;
1763
1764
  noUploadMessage: string;
@@ -1820,6 +1821,24 @@ export declare const commands: {
1820
1821
  json: string;
1821
1822
  };
1822
1823
  };
1824
+ preview: {
1825
+ describe: string;
1826
+ verboseDescribe: string;
1827
+ uploadPrompt: (projectName: string) => string;
1828
+ errors: {
1829
+ targetRequired: string;
1830
+ previewFailed: string;
1831
+ };
1832
+ options: {
1833
+ build: string;
1834
+ target: string;
1835
+ force: string;
1836
+ };
1837
+ examples: {
1838
+ default: string;
1839
+ withBuild: string;
1840
+ };
1841
+ };
1823
1842
  };
1824
1843
  listBuilds: {
1825
1844
  describe: string;
@@ -3537,6 +3556,12 @@ export declare const lib: {
3537
3556
  updateFailed: (latestVersion: string) => string;
3538
3557
  enableAutoUpdatesMessage: string;
3539
3558
  };
3559
+ deprecationWarning: {
3560
+ deprecatedTitle: string;
3561
+ deprecatedMessage: (currentVersion: string, eolDate: string) => string;
3562
+ endOfLifeTitle: string;
3563
+ endOfLifeMessage: (currentVersion: string, eolDate: string) => string;
3564
+ };
3540
3565
  };
3541
3566
  projectProfiles: {
3542
3567
  logs: {
package/lang/en.js CHANGED
@@ -2,7 +2,7 @@ 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';
@@ -1774,6 +1774,7 @@ export const commands = {
1774
1774
  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
1775
  confirmPrompt: (projectName, buildId) => `Create a release for project ${chalk.bold(projectName)} using build ${chalk.bold(String(buildId))}?`,
1776
1776
  success: (releaseTag, buildId) => `Release ${chalk.bold(releaseTag)} created for build ${chalk.bold(String(buildId))}.`,
1777
+ successNoTag: (buildId) => `Released build ${chalk.bold(String(buildId))}. Your project is now live.`,
1777
1778
  cancelled: 'Release creation cancelled.',
1778
1779
  buildIdPrompt: '[--build] Select a successful build to release:',
1779
1780
  noUploadMessage: 'No upload message',
@@ -1836,6 +1837,24 @@ export const commands = {
1836
1837
  json: 'Output release details as JSON',
1837
1838
  },
1838
1839
  },
1840
+ preview: {
1841
+ describe: 'Build and preview a project on a target portal.',
1842
+ 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.`,
1843
+ uploadPrompt: (projectName) => `No successful builds for project ${chalk.bold(projectName)}. Would you like to upload it?`,
1844
+ errors: {
1845
+ targetRequired: `${uiCommandReference('--target=<portalId>')} is required to specify the portal to preview on.`,
1846
+ previewFailed: 'The preview failed. You can try again or preview this build from the project UI.',
1847
+ },
1848
+ options: {
1849
+ build: 'Build ID to preview. Defaults to the latest build.',
1850
+ target: 'Portal ID to preview the build on.',
1851
+ force: 'Skip all confirmation prompts, including automatic upload when no build exists.',
1852
+ },
1853
+ examples: {
1854
+ default: 'Build and preview the current project on a target portal',
1855
+ withBuild: 'Preview a specific build on a target portal',
1856
+ },
1857
+ },
1839
1858
  },
1840
1859
  listBuilds: {
1841
1860
  describe: "List the project's builds.",
@@ -1924,7 +1943,7 @@ export const commands = {
1924
1943
  runCommand: (command) => `Run \`${uiCommandReference(command)}\``,
1925
1944
  autoDeployDisabled: (deployCommand) => `Automatic deploys are disabled for this project. Run ${uiCommandReference(deployCommand)} to deploy this build.`,
1926
1945
  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.`,
1946
+ releaseManagementRequired: (releaseCommand) => `This build is not live yet. Run ${uiCommandReference(releaseCommand)} to make it live.`,
1928
1947
  uploadingWithProfile: (profileName, accountId) => `Initializing project upload with ${chalk.bold(profileName)} profile: ${uiAccountDescription(accountId)}`,
1929
1948
  uploadingToAccount: (accountId) => `Initializing project upload to account ${uiAccountDescription(accountId)}`,
1930
1949
  uploadedToAccount: (accountId) => `Project uploaded to ${uiAccountDescription(accountId)}`,
@@ -3576,6 +3595,12 @@ export const lib = {
3576
3595
  updateFailed: (latestVersion) => `Failed to update HubSpot CLI to version ${chalk.bold(latestVersion)}`,
3577
3596
  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
3597
  },
3598
+ deprecationWarning: {
3599
+ deprecatedTitle: 'Deprecated',
3600
+ 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)}`,
3601
+ endOfLifeTitle: 'End of Life',
3602
+ 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)}`,
3603
+ },
3579
3604
  },
3580
3605
  projectProfiles: {
3581
3606
  logs: {
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,6 +4,11 @@ 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;
9
14
  export declare const PROJECT_CONFIG_FILE: "hsproject.json";
package/lib/constants.js CHANGED
@@ -4,6 +4,15 @@ 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;
9
18
  export const PROJECT_CONFIG_FILE = 'hsproject.json';
@@ -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(),
@@ -35,7 +35,7 @@ export declare const BuildSchema: z.ZodObject<{
35
35
  visible: z.ZodOptional<z.ZodBoolean>;
36
36
  }, z.core.$strip>>;
37
37
  }, z.core.$strip>;
38
- export declare const ProjectBuildsListSchema: z.ZodObject<{
38
+ export declare const ProjectListBuildsSchema: z.ZodObject<{
39
39
  projectName: z.ZodString;
40
40
  deployedBuildId: z.ZodOptional<z.ZodNumber>;
41
41
  results: z.ZodArray<z.ZodObject<{
@@ -70,6 +70,6 @@ export declare const ProjectBuildsListSchema: z.ZodObject<{
70
70
  }, z.core.$strip>;
71
71
  export type BuildSubbuildStatusJsonOutput = z.infer<typeof BuildSubbuildStatusSchema>;
72
72
  export type BuildJsonOutput = z.infer<typeof BuildSchema>;
73
- export type ProjectBuildsListJsonOutput = z.infer<typeof ProjectBuildsListSchema>;
73
+ export type ProjectListBuildsJsonOutput = z.infer<typeof ProjectListBuildsSchema>;
74
74
  export declare function mapBuildToJsonOutput(build: Build, deployedBuildId?: number): BuildJsonOutput;
75
75
  export {};
@@ -24,7 +24,7 @@ export const BuildSchema = z.object({
24
24
  createdAt: z.string().optional(),
25
25
  subbuildStatuses: z.array(BuildSubbuildStatusSchema),
26
26
  });
27
- export const ProjectBuildsListSchema = z.object({
27
+ export const ProjectListBuildsSchema = z.object({
28
28
  projectName: z.string(),
29
29
  deployedBuildId: z.number().optional(),
30
30
  results: z.array(BuildSchema),