@hubspot/cli 7.10.0-beta.1 → 7.10.0-experimental.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 (201) hide show
  1. package/bin/cli.js +5 -4
  2. package/commands/__tests__/getStarted.test.js +10 -0
  3. package/commands/__tests__/project.test.js +3 -0
  4. package/commands/account/__tests__/rename.test.js +10 -3
  5. package/commands/account/auth.js +10 -14
  6. package/commands/account/clean.js +11 -19
  7. package/commands/account/createOverride.js +15 -11
  8. package/commands/account/info.js +8 -5
  9. package/commands/account/list.js +15 -19
  10. package/commands/account/remove.js +23 -22
  11. package/commands/account/removeOverride.js +6 -6
  12. package/commands/account/rename.js +2 -2
  13. package/commands/account/use.js +19 -8
  14. package/commands/app/__tests__/migrate.test.js +8 -4
  15. package/commands/app/migrate.js +2 -2
  16. package/commands/auth.js +18 -14
  17. package/commands/config/migrate.js +5 -5
  18. package/commands/customObject/createSchema.js +2 -3
  19. package/commands/customObject/updateSchema.js +2 -3
  20. package/commands/getStarted.js +2 -3
  21. package/commands/hubdb/__tests__/list.test.js +1 -0
  22. package/commands/hubdb/list.js +2 -2
  23. package/commands/init.js +36 -32
  24. package/commands/project/__tests__/deploy.test.js +10 -5
  25. package/commands/project/__tests__/devUnifiedFlow.test.js +6 -4
  26. package/commands/project/__tests__/lint.test.js +709 -0
  27. package/commands/project/__tests__/logs.test.js +4 -0
  28. package/commands/project/__tests__/validate.test.js +2 -2
  29. package/commands/project/cloneApp.js +2 -2
  30. package/commands/project/deploy.js +2 -2
  31. package/commands/project/dev/deprecatedFlow.js +4 -5
  32. package/commands/project/dev/index.js +6 -3
  33. package/commands/project/dev/unifiedFlow.js +4 -5
  34. package/commands/project/lint.d.ts +6 -0
  35. package/commands/project/lint.js +178 -0
  36. package/commands/project/logs.js +2 -3
  37. package/commands/project/profile/add.js +6 -7
  38. package/commands/project/profile/delete.js +2 -2
  39. package/commands/project/upload.js +2 -2
  40. package/commands/project/validate.js +2 -2
  41. package/commands/project.js +2 -0
  42. package/commands/sandbox/__tests__/create.test.js +14 -5
  43. package/commands/sandbox/create.js +4 -5
  44. package/commands/sandbox/delete.js +23 -20
  45. package/commands/testAccount/__tests__/create.test.js +5 -5
  46. package/commands/testAccount/create.js +2 -2
  47. package/commands/testAccount/delete.js +9 -8
  48. package/lang/en.d.ts +40 -6
  49. package/lang/en.js +54 -14
  50. package/lib/__tests__/buildAccount.test.js +22 -30
  51. package/lib/__tests__/commonOpts.test.js +9 -13
  52. package/lib/__tests__/developerTestAccounts.test.js +29 -17
  53. package/lib/__tests__/importData.test.js +20 -10
  54. package/lib/__tests__/oauth.test.js +19 -8
  55. package/lib/__tests__/sandboxSync.test.js +33 -11
  56. package/lib/__tests__/sandboxes.test.js +30 -19
  57. package/lib/__tests__/usageTracking.test.js +10 -10
  58. package/lib/__tests__/validation.test.js +32 -32
  59. package/lib/accountTypes.d.ts +9 -9
  60. package/lib/accountTypes.js +2 -4
  61. package/lib/app/__tests__/migrate.test.js +15 -0
  62. package/lib/app/__tests__/migrate_legacy.test.js +9 -0
  63. package/lib/app/migrate_legacy.d.ts +2 -2
  64. package/lib/buildAccount.d.ts +4 -4
  65. package/lib/buildAccount.js +7 -14
  66. package/lib/commonOpts.js +3 -3
  67. package/lib/configMigrate.d.ts +2 -2
  68. package/lib/configMigrate.js +42 -18
  69. package/lib/configOptions.js +3 -2
  70. package/lib/developerTestAccounts.d.ts +3 -3
  71. package/lib/developerTestAccounts.js +4 -7
  72. package/lib/doctor/DiagnosticInfoBuilder.d.ts +1 -1
  73. package/lib/doctor/DiagnosticInfoBuilder.js +9 -6
  74. package/lib/doctor/Doctor.js +4 -3
  75. package/lib/doctor/__tests__/Diagnosis.test.js +4 -3
  76. package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.js +17 -9
  77. package/lib/doctor/__tests__/Doctor.test.js +14 -0
  78. package/lib/importData.js +8 -7
  79. package/lib/links.js +5 -5
  80. package/lib/middleware/{__test__ → __tests__}/commandTargetingUtils.test.js +3 -3
  81. package/lib/middleware/{__test__ → __tests__}/configMiddleware.test.js +23 -22
  82. package/lib/middleware/{__test__ → __tests__}/gitMiddleware.test.js +9 -7
  83. package/lib/middleware/autoUpdateMiddleware.js +12 -4
  84. package/lib/middleware/commandTargetingUtils.js +3 -2
  85. package/lib/middleware/configMiddleware.d.ts +6 -1
  86. package/lib/middleware/configMiddleware.js +36 -15
  87. package/lib/middleware/gitMiddleware.js +8 -4
  88. package/lib/oauth.d.ts +2 -2
  89. package/lib/oauth.js +8 -10
  90. package/lib/projects/__tests__/AppDevModeInterface.test.js +17 -6
  91. package/lib/projects/__tests__/DevServerManager.test.js +1 -0
  92. package/lib/projects/__tests__/LocalDevProcess.test.js +1 -0
  93. package/lib/projects/__tests__/components.test.js +1 -1
  94. package/lib/projects/__tests__/deploy.test.js +1 -0
  95. package/lib/projects/__tests__/uieLinting.test.js +640 -0
  96. package/lib/projects/components.js +1 -1
  97. package/lib/projects/create/__tests__/v2.test.js +11 -0
  98. package/lib/projects/localDev/AppDevModeInterface.js +2 -2
  99. package/lib/projects/localDev/DevServerManager_DEPRECATED.js +2 -2
  100. package/lib/projects/localDev/DevSessionManager.d.ts +17 -0
  101. package/lib/projects/localDev/DevSessionManager.js +56 -0
  102. package/lib/projects/localDev/LocalDevLogger.d.ts +3 -0
  103. package/lib/projects/localDev/LocalDevLogger.js +13 -4
  104. package/lib/projects/localDev/LocalDevManager_DEPRECATED.js +3 -3
  105. package/lib/projects/localDev/LocalDevProcess.d.ts +1 -0
  106. package/lib/projects/localDev/LocalDevProcess.js +12 -1
  107. package/lib/projects/localDev/LocalDevState.d.ts +3 -0
  108. package/lib/projects/localDev/LocalDevState.js +9 -0
  109. package/lib/projects/localDev/helpers/account.d.ts +10 -10
  110. package/lib/projects/localDev/helpers/account.js +6 -11
  111. package/lib/projects/localDev/helpers/devSessionsApi.d.ts +9 -0
  112. package/lib/projects/localDev/helpers/devSessionsApi.js +19 -0
  113. package/lib/projects/uieLinting.d.ts +33 -0
  114. package/lib/projects/uieLinting.js +222 -0
  115. package/lib/projects/urls.js +5 -6
  116. package/lib/prompts/__tests__/downloadProjectPrompt.test.js +7 -5
  117. package/lib/prompts/accountNamePrompt.js +3 -3
  118. package/lib/prompts/accountsPrompt.d.ts +1 -1
  119. package/lib/prompts/accountsPrompt.js +6 -7
  120. package/lib/prompts/confirmImportDataPrompt.js +2 -2
  121. package/lib/prompts/downloadProjectPrompt.d.ts +1 -0
  122. package/lib/prompts/downloadProjectPrompt.js +5 -2
  123. package/lib/prompts/importDataTestAccountSelectPrompt.js +4 -5
  124. package/lib/prompts/personalAccessKeyPrompt.js +2 -2
  125. package/lib/prompts/projectDevTargetAccountPrompt.d.ts +3 -3
  126. package/lib/prompts/projectDevTargetAccountPrompt.js +5 -7
  127. package/lib/prompts/sandboxesPrompt.js +7 -8
  128. package/lib/prompts/setAsDefaultAccountPrompt.js +7 -6
  129. package/lib/sandboxSync.d.ts +2 -2
  130. package/lib/sandboxSync.js +3 -9
  131. package/lib/sandboxes.d.ts +4 -4
  132. package/lib/sandboxes.js +6 -11
  133. package/lib/serverlessLogs.js +2 -2
  134. package/lib/theme/__tests__/migrate.test.js +15 -0
  135. package/lib/ui/index.js +6 -3
  136. package/lib/usageTracking.js +15 -8
  137. package/lib/validation.js +13 -11
  138. package/mcp-server/tools/cms/HsCreateFunctionTool.js +4 -2
  139. package/mcp-server/tools/cms/HsCreateModuleTool.js +4 -2
  140. package/mcp-server/tools/cms/HsCreateTemplateTool.js +4 -2
  141. package/mcp-server/tools/cms/HsFunctionLogsTool.js +4 -2
  142. package/mcp-server/tools/cms/HsListFunctionsTool.js +3 -1
  143. package/mcp-server/tools/cms/HsListTool.js +3 -1
  144. package/mcp-server/tools/cms/__tests__/HsCreateFunctionTool.test.js +1 -0
  145. package/mcp-server/tools/index.js +4 -0
  146. package/mcp-server/tools/project/AddFeatureToProjectTool.js +4 -2
  147. package/mcp-server/tools/project/CreateProjectTool.js +4 -2
  148. package/mcp-server/tools/project/CreateTestAccountTool.js +42 -19
  149. package/mcp-server/tools/project/DeployProjectTool.js +3 -1
  150. package/mcp-server/tools/project/DocFetchTool.js +6 -4
  151. package/mcp-server/tools/project/DocsSearchTool.d.ts +1 -1
  152. package/mcp-server/tools/project/DocsSearchTool.js +10 -8
  153. package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.d.ts +1 -1
  154. package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.js +9 -7
  155. package/mcp-server/tools/project/GetApplicationInfoTool.js +8 -6
  156. package/mcp-server/tools/project/GetBuildLogsTool.d.ts +26 -0
  157. package/mcp-server/tools/project/GetBuildLogsTool.js +125 -0
  158. package/mcp-server/tools/project/GetBuildStatusTool.d.ts +26 -0
  159. package/mcp-server/tools/project/GetBuildStatusTool.js +166 -0
  160. package/mcp-server/tools/project/GetConfigValuesTool.d.ts +1 -1
  161. package/mcp-server/tools/project/GetConfigValuesTool.js +9 -7
  162. package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +1 -1
  163. package/mcp-server/tools/project/GuidedWalkthroughTool.js +5 -3
  164. package/mcp-server/tools/project/UploadProjectTools.js +3 -1
  165. package/mcp-server/tools/project/ValidateProjectTool.js +4 -2
  166. package/mcp-server/tools/project/__tests__/CreateTestAccountTool.test.js +226 -3
  167. package/mcp-server/tools/project/__tests__/DocFetchTool.test.js +5 -1
  168. package/mcp-server/tools/project/__tests__/DocsSearchTool.test.js +23 -11
  169. package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.js +7 -5
  170. package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.js +7 -5
  171. package/mcp-server/tools/project/__tests__/GetBuildLogsTool.test.d.ts +1 -0
  172. package/mcp-server/tools/project/__tests__/GetBuildLogsTool.test.js +305 -0
  173. package/mcp-server/tools/project/__tests__/GetBuildStatusTool.test.d.ts +1 -0
  174. package/mcp-server/tools/project/__tests__/GetBuildStatusTool.test.js +240 -0
  175. package/mcp-server/tools/project/__tests__/GetConfigValuesTool.test.js +8 -6
  176. package/mcp-server/utils/__tests__/content.test.js +21 -20
  177. package/mcp-server/utils/__tests__/feedbackTracking.test.js +34 -28
  178. package/mcp-server/utils/config.d.ts +1 -0
  179. package/mcp-server/utils/config.js +10 -0
  180. package/mcp-server/utils/content.d.ts +1 -1
  181. package/mcp-server/utils/content.js +2 -2
  182. package/mcp-server/utils/feedbackTracking.d.ts +1 -1
  183. package/mcp-server/utils/feedbackTracking.js +3 -3
  184. package/mcp-server/utils/toolUsageTracking.js +4 -3
  185. package/package.json +8 -7
  186. package/types/LocalDev.d.ts +1 -0
  187. package/lib/middleware/__test__/notificationsMiddleware.test.js +0 -8
  188. package/lib/middleware/notificationsMiddleware.d.ts +0 -1
  189. package/lib/middleware/notificationsMiddleware.js +0 -28
  190. package/mcp-server/utils/__tests__/cliConfig.test.js +0 -110
  191. package/mcp-server/utils/cliConfig.d.ts +0 -1
  192. package/mcp-server/utils/cliConfig.js +0 -12
  193. /package/{lib/middleware/__test__/commandTargetingUtils.test.d.ts → commands/project/__tests__/lint.test.d.ts} +0 -0
  194. /package/lib/middleware/{__test__/configMiddleware.test.d.ts → __tests__/commandTargetingUtils.test.d.ts} +0 -0
  195. /package/lib/middleware/{__test__/gitMiddleware.test.d.ts → __tests__/configMiddleware.test.d.ts} +0 -0
  196. /package/lib/middleware/{__test__/notificationsMiddleware.test.d.ts → __tests__/gitMiddleware.test.d.ts} +0 -0
  197. /package/lib/middleware/{__test__ → __tests__}/requestMiddleware.test.d.ts +0 -0
  198. /package/lib/middleware/{__test__ → __tests__}/requestMiddleware.test.js +0 -0
  199. /package/lib/middleware/{__test__ → __tests__}/yargsChecksMiddleware.test.d.ts +0 -0
  200. /package/lib/middleware/{__test__ → __tests__}/yargsChecksMiddleware.test.js +0 -0
  201. /package/{mcp-server/utils/__tests__/cliConfig.test.d.ts → lib/projects/__tests__/uieLinting.test.d.ts} +0 -0
@@ -3,7 +3,6 @@ import { mcpFeedbackRequest } from '../feedbackTracking.js';
3
3
  vi.mock('../feedbackTracking');
4
4
  const mockMcpFeedbackRequest = mcpFeedbackRequest;
5
5
  describe('mcp-server/utils/content', () => {
6
- const mockWorkingDirectory = '/test/working/directory';
7
6
  beforeEach(() => {
8
7
  vi.clearAllMocks();
9
8
  });
@@ -34,8 +33,8 @@ describe('mcp-server/utils/content', () => {
34
33
  describe('formatTextContents', () => {
35
34
  it('should format single output without feedback', async () => {
36
35
  mockMcpFeedbackRequest.mockResolvedValue('');
37
- const result = await formatTextContents(mockWorkingDirectory, 'Test output');
38
- expect(mockMcpFeedbackRequest).toHaveBeenCalledWith(mockWorkingDirectory);
36
+ const result = await formatTextContents('Test output');
37
+ expect(mockMcpFeedbackRequest).toHaveBeenCalled();
39
38
  expect(result).toEqual({
40
39
  content: [
41
40
  {
@@ -47,7 +46,7 @@ describe('mcp-server/utils/content', () => {
47
46
  });
48
47
  it('should format multiple outputs without feedback', async () => {
49
48
  mockMcpFeedbackRequest.mockResolvedValue('');
50
- const result = await formatTextContents(mockWorkingDirectory, 'First output', 'Second output', 'Third output');
49
+ const result = await formatTextContents('First output', 'Second output', 'Third output');
51
50
  expect(result).toEqual({
52
51
  content: [
53
52
  { type: 'text', text: 'First output' },
@@ -59,8 +58,8 @@ describe('mcp-server/utils/content', () => {
59
58
  it('should append feedback message when feedback is returned', async () => {
60
59
  const feedbackMessage = 'Please share your feedback!';
61
60
  mockMcpFeedbackRequest.mockResolvedValue(feedbackMessage);
62
- const result = await formatTextContents(mockWorkingDirectory, 'Command output');
63
- expect(mockMcpFeedbackRequest).toHaveBeenCalledWith(mockWorkingDirectory);
61
+ const result = await formatTextContents('Command output');
62
+ expect(mockMcpFeedbackRequest).toHaveBeenCalled();
64
63
  expect(result).toEqual({
65
64
  content: [
66
65
  { type: 'text', text: 'Command output' },
@@ -71,7 +70,7 @@ describe('mcp-server/utils/content', () => {
71
70
  it('should append feedback to multiple outputs', async () => {
72
71
  const feedbackMessage = 'Feedback request message';
73
72
  mockMcpFeedbackRequest.mockResolvedValue(feedbackMessage);
74
- const result = await formatTextContents(mockWorkingDirectory, 'First output', 'Second output');
73
+ const result = await formatTextContents('First output', 'Second output');
75
74
  expect(result).toEqual({
76
75
  content: [
77
76
  { type: 'text', text: 'First output' },
@@ -82,7 +81,7 @@ describe('mcp-server/utils/content', () => {
82
81
  });
83
82
  it('should filter out undefined outputs', async () => {
84
83
  mockMcpFeedbackRequest.mockResolvedValue('');
85
- const result = await formatTextContents(mockWorkingDirectory, 'First output', undefined, 'Third output', undefined);
84
+ const result = await formatTextContents('First output', undefined, 'Third output', undefined);
86
85
  expect(result).toEqual({
87
86
  content: [
88
87
  { type: 'text', text: 'First output' },
@@ -92,7 +91,7 @@ describe('mcp-server/utils/content', () => {
92
91
  });
93
92
  it('should not call mcpFeedbackRequest when no outputs provided', async () => {
94
93
  mockMcpFeedbackRequest.mockResolvedValue('Feedback message');
95
- const result = await formatTextContents(mockWorkingDirectory);
94
+ const result = await formatTextContents();
96
95
  expect(mockMcpFeedbackRequest).not.toHaveBeenCalled();
97
96
  expect(result).toEqual({
98
97
  content: [],
@@ -100,24 +99,24 @@ describe('mcp-server/utils/content', () => {
100
99
  });
101
100
  it('should call mcpFeedbackRequest but not add feedback when all outputs are undefined and feedback is empty', async () => {
102
101
  mockMcpFeedbackRequest.mockResolvedValue('');
103
- const result = await formatTextContents(mockWorkingDirectory, undefined, undefined);
102
+ const result = await formatTextContents(undefined, undefined);
104
103
  // mcpFeedbackRequest is still called because outputs.length > 0, but content is empty
105
- expect(mockMcpFeedbackRequest).toHaveBeenCalledWith(mockWorkingDirectory);
104
+ expect(mockMcpFeedbackRequest).toHaveBeenCalled();
106
105
  expect(result).toEqual({
107
106
  content: [],
108
107
  });
109
108
  });
110
109
  it('should handle empty string outputs and still request feedback', async () => {
111
110
  mockMcpFeedbackRequest.mockResolvedValue('');
112
- const result = await formatTextContents(mockWorkingDirectory, '');
113
- expect(mockMcpFeedbackRequest).toHaveBeenCalledWith(mockWorkingDirectory);
111
+ const result = await formatTextContents('');
112
+ expect(mockMcpFeedbackRequest).toHaveBeenCalled();
114
113
  expect(result).toEqual({
115
114
  content: [{ type: 'text', text: '' }],
116
115
  });
117
116
  });
118
117
  it('should not add feedback when empty string is returned from mcpFeedbackRequest', async () => {
119
118
  mockMcpFeedbackRequest.mockResolvedValue('');
120
- const result = await formatTextContents(mockWorkingDirectory, 'Output 1', 'Output 2');
119
+ const result = await formatTextContents('Output 1', 'Output 2');
121
120
  // Should not have a third content item with empty feedback
122
121
  expect(result.content).toHaveLength(2);
123
122
  expect(result).toEqual({
@@ -137,7 +136,7 @@ describe('mcp-server/utils/content', () => {
137
136
 
138
137
  Say: "📝 **Before we continue, would you mind sharing feedback on your experience with the HubSpot Developer MCP?** Your input helps us improve: [Share feedback here](https://app.hubspot.com/l/product-updates/in-beta?rollout=239890)"`;
139
138
  mockMcpFeedbackRequest.mockResolvedValue(realisticFeedback);
140
- const result = await formatTextContents(mockWorkingDirectory, 'Project created successfully');
139
+ const result = await formatTextContents('Project created successfully');
141
140
  expect(result.content).toHaveLength(2);
142
141
  expect(result.content[0]).toEqual({
143
142
  type: 'text',
@@ -149,16 +148,18 @@ describe('mcp-server/utils/content', () => {
149
148
  });
150
149
  expect(result.content[1].text).toContain('FEEDBACK REQUEST');
151
150
  });
152
- it('should correctly use absoluteCurrentWorkingDirectory parameter', async () => {
153
- const customDirectory = '/custom/working/directory';
151
+ it('should not require absoluteCurrentWorkingDirectory parameter', async () => {
154
152
  mockMcpFeedbackRequest.mockResolvedValue('');
155
- await formatTextContents(customDirectory, 'Test output');
156
- expect(mockMcpFeedbackRequest).toHaveBeenCalledWith(customDirectory);
153
+ const result = await formatTextContents('Test output');
154
+ expect(mockMcpFeedbackRequest).toHaveBeenCalled();
155
+ expect(result).toEqual({
156
+ content: [{ type: 'text', text: 'Test output' }],
157
+ });
157
158
  });
158
159
  it('should await mcpFeedbackRequest and handle async properly', async () => {
159
160
  const feedbackPromise = Promise.resolve('Async feedback message');
160
161
  mockMcpFeedbackRequest.mockReturnValue(feedbackPromise);
161
- const result = await formatTextContents(mockWorkingDirectory, 'Output');
162
+ const result = await formatTextContents('Output');
162
163
  expect(result.content).toHaveLength(2);
163
164
  expect(result.content[1].text).toBe('Async feedback message');
164
165
  });
@@ -1,82 +1,86 @@
1
1
  import { mcpFeedbackRequest } from '../feedbackTracking.js';
2
2
  import { getStateValue, setStateValue, } from '@hubspot/local-dev-lib/config/state';
3
- import { getAccountIdFromCliConfig } from '../cliConfig.js';
3
+ import { getConfigDefaultAccountIfExists } from '@hubspot/local-dev-lib/config';
4
4
  import { hasFeature } from '../../../lib/hasFeature.js';
5
5
  import { FEATURES } from '../../../lib/constants.js';
6
6
  vi.mock('@hubspot/local-dev-lib/config/state');
7
- vi.mock('../cliConfig');
7
+ vi.mock('@hubspot/local-dev-lib/config');
8
+ vi.mock('@hubspot/local-dev-lib/logger');
8
9
  vi.mock('../../../lib/hasFeature');
9
10
  vi.mock('../../../lib/errorHandlers/index');
10
11
  const mockGetStateValue = getStateValue;
11
12
  const mockSetStateValue = setStateValue;
12
- const mockGetAccountIdFromCliConfig = getAccountIdFromCliConfig;
13
+ const mockGetConfigDefaultAccountIfExists = getConfigDefaultAccountIfExists;
13
14
  const mockHasFeature = hasFeature;
14
15
  describe('mcp-server/utils/feedbackTracking', () => {
15
- const mockWorkingDirectory = '/test/working/directory';
16
16
  beforeEach(() => {
17
17
  vi.clearAllMocks();
18
18
  });
19
19
  describe('mcpFeedbackRequest', () => {
20
20
  it('should return empty string when not at a threshold', async () => {
21
21
  mockGetStateValue.mockReturnValue(10);
22
- const result = await mcpFeedbackRequest(mockWorkingDirectory);
22
+ const result = await mcpFeedbackRequest();
23
23
  expect(mockSetStateValue).toHaveBeenCalledWith('mcpTotalToolCalls', 11);
24
24
  expect(result).toBe(undefined);
25
25
  });
26
26
  it('should return feedback message at threshold 50', async () => {
27
27
  mockGetStateValue.mockReturnValue(49);
28
- mockGetAccountIdFromCliConfig.mockReturnValue(null);
29
- const result = await mcpFeedbackRequest(mockWorkingDirectory);
28
+ mockGetConfigDefaultAccountIfExists.mockReturnValue(undefined);
29
+ const result = await mcpFeedbackRequest();
30
30
  expect(mockSetStateValue).toHaveBeenCalledWith('mcpTotalToolCalls', 50);
31
31
  expect(result).toContain('FEEDBACK REQUEST');
32
32
  expect(result).toContain('https://app.hubspot.com/l/product-updates/in-beta?rollout=239890');
33
33
  });
34
34
  it('should return feedback message at threshold 250', async () => {
35
35
  mockGetStateValue.mockReturnValue(249);
36
- mockGetAccountIdFromCliConfig.mockReturnValue(null);
37
- const result = await mcpFeedbackRequest(mockWorkingDirectory);
36
+ mockGetConfigDefaultAccountIfExists.mockReturnValue(undefined);
37
+ const result = await mcpFeedbackRequest();
38
38
  expect(mockSetStateValue).toHaveBeenCalledWith('mcpTotalToolCalls', 250);
39
39
  expect(result).toContain('FEEDBACK REQUEST');
40
40
  });
41
41
  it('should return feedback message at threshold 550', async () => {
42
42
  mockGetStateValue.mockReturnValue(549);
43
- mockGetAccountIdFromCliConfig.mockReturnValue(null);
44
- const result = await mcpFeedbackRequest(mockWorkingDirectory);
43
+ mockGetConfigDefaultAccountIfExists.mockReturnValue(undefined);
44
+ const result = await mcpFeedbackRequest();
45
45
  expect(mockSetStateValue).toHaveBeenCalledWith('mcpTotalToolCalls', 550);
46
46
  expect(result).toContain('FEEDBACK REQUEST');
47
47
  });
48
48
  it('should return feedback message at threshold 1050', async () => {
49
49
  mockGetStateValue.mockReturnValue(1049);
50
- mockGetAccountIdFromCliConfig.mockReturnValue(null);
51
- const result = await mcpFeedbackRequest(mockWorkingDirectory);
50
+ mockGetConfigDefaultAccountIfExists.mockReturnValue(undefined);
51
+ const result = await mcpFeedbackRequest();
52
52
  expect(mockSetStateValue).toHaveBeenCalledWith('mcpTotalToolCalls', 1050);
53
53
  expect(result).toContain('FEEDBACK REQUEST');
54
54
  });
55
55
  it('should use account-specific URL when account has MCP access', async () => {
56
56
  const accountId = 12345;
57
57
  mockGetStateValue.mockReturnValue(49);
58
- mockGetAccountIdFromCliConfig.mockReturnValue(accountId);
58
+ mockGetConfigDefaultAccountIfExists.mockReturnValue({
59
+ accountId,
60
+ });
59
61
  mockHasFeature.mockResolvedValue(true);
60
- const result = await mcpFeedbackRequest(mockWorkingDirectory);
61
- expect(mockGetAccountIdFromCliConfig).toHaveBeenCalledWith(mockWorkingDirectory);
62
+ const result = await mcpFeedbackRequest();
63
+ expect(mockGetConfigDefaultAccountIfExists).toHaveBeenCalled();
62
64
  expect(mockHasFeature).toHaveBeenCalledWith(accountId, FEATURES.MCP_ACCESS);
63
65
  expect(result).toContain(`https://app.hubspot.com/product-updates/${accountId}/in-beta?rollout=239890`);
64
66
  });
65
67
  it('should use default URL when account does not have MCP access', async () => {
66
68
  const accountId = 12345;
67
69
  mockGetStateValue.mockReturnValue(49);
68
- mockGetAccountIdFromCliConfig.mockReturnValue(accountId);
70
+ mockGetConfigDefaultAccountIfExists.mockReturnValue({
71
+ accountId,
72
+ });
69
73
  mockHasFeature.mockResolvedValue(false);
70
- const result = await mcpFeedbackRequest(mockWorkingDirectory);
74
+ const result = await mcpFeedbackRequest();
71
75
  expect(mockHasFeature).toHaveBeenCalledWith(accountId, FEATURES.MCP_ACCESS);
72
76
  expect(result).toContain('https://app.hubspot.com/l/product-updates/in-beta?rollout=239890');
73
77
  expect(result).not.toContain(`/product-updates/${accountId}/`);
74
78
  });
75
79
  it('should use default URL when no account ID is found', async () => {
76
80
  mockGetStateValue.mockReturnValue(49);
77
- mockGetAccountIdFromCliConfig.mockReturnValue(null);
78
- const result = await mcpFeedbackRequest(mockWorkingDirectory);
79
- expect(mockGetAccountIdFromCliConfig).toHaveBeenCalledWith(mockWorkingDirectory);
81
+ mockGetConfigDefaultAccountIfExists.mockReturnValue(undefined);
82
+ const result = await mcpFeedbackRequest();
83
+ expect(mockGetConfigDefaultAccountIfExists).toHaveBeenCalled();
80
84
  expect(mockHasFeature).not.toHaveBeenCalled();
81
85
  expect(result).toContain('https://app.hubspot.com/l/product-updates/in-beta?rollout=239890');
82
86
  });
@@ -84,35 +88,37 @@ describe('mcp-server/utils/feedbackTracking', () => {
84
88
  mockGetStateValue.mockImplementation(() => {
85
89
  throw new Error('State error');
86
90
  });
87
- const result = await mcpFeedbackRequest(mockWorkingDirectory);
91
+ const result = await mcpFeedbackRequest();
88
92
  expect(result).toBe(undefined);
89
93
  });
90
94
  it('should handle hasFeature errors and use default URL', async () => {
91
95
  const accountId = 12345;
92
96
  mockGetStateValue.mockReturnValue(49);
93
- mockGetAccountIdFromCliConfig.mockReturnValue(accountId);
97
+ mockGetConfigDefaultAccountIfExists.mockReturnValue({
98
+ accountId,
99
+ });
94
100
  mockHasFeature.mockRejectedValue(new Error('Feature check failed'));
95
- const result = await mcpFeedbackRequest(mockWorkingDirectory);
101
+ const result = await mcpFeedbackRequest();
96
102
  expect(result).toContain('https://app.hubspot.com/l/product-updates/in-beta?rollout=239890');
97
103
  expect(result).not.toContain(`/product-updates/${accountId}/`);
98
104
  });
99
105
  it('should not return feedback at threshold + 1', async () => {
100
106
  mockGetStateValue.mockReturnValue(50);
101
- const result = await mcpFeedbackRequest(mockWorkingDirectory);
107
+ const result = await mcpFeedbackRequest();
102
108
  expect(mockSetStateValue).toHaveBeenCalledWith('mcpTotalToolCalls', 51);
103
109
  expect(result).toBe(undefined);
104
110
  });
105
111
  it('should increment tool calls counter on every invocation', async () => {
106
112
  const initialCount = 100;
107
113
  mockGetStateValue.mockReturnValue(initialCount);
108
- await mcpFeedbackRequest(mockWorkingDirectory);
114
+ await mcpFeedbackRequest();
109
115
  expect(mockGetStateValue).toHaveBeenCalledWith('mcpTotalToolCalls');
110
116
  expect(mockSetStateValue).toHaveBeenCalledWith('mcpTotalToolCalls', initialCount + 1);
111
117
  });
112
118
  it('should include feedback request instructions in message', async () => {
113
119
  mockGetStateValue.mockReturnValue(49);
114
- mockGetAccountIdFromCliConfig.mockReturnValue(null);
115
- const result = await mcpFeedbackRequest(mockWorkingDirectory);
120
+ mockGetConfigDefaultAccountIfExists.mockReturnValue(undefined);
121
+ const result = await mcpFeedbackRequest();
116
122
  expect(result).toContain('IMPORTANT - FEEDBACK REQUEST');
117
123
  expect(result).toContain('This message appears only once');
118
124
  expect(result).toContain('Share feedback here');
@@ -0,0 +1 @@
1
+ export declare function setupHubSpotConfig(absoluteCurrentWorkingDirectory: string): void;
@@ -0,0 +1,10 @@
1
+ import { getLocalConfigFilePathIfExists } from '@hubspot/local-dev-lib/config';
2
+ export function setupHubSpotConfig(absoluteCurrentWorkingDirectory) {
3
+ if (!absoluteCurrentWorkingDirectory) {
4
+ return;
5
+ }
6
+ const configPath = getLocalConfigFilePathIfExists(absoluteCurrentWorkingDirectory);
7
+ if (configPath) {
8
+ process.env.HUBSPOT_CONFIG_PATH = configPath;
9
+ }
10
+ }
@@ -1,3 +1,3 @@
1
1
  import { TextContent, TextContentResponse } from '../types.js';
2
- export declare function formatTextContents(absoluteCurrentWorkingDirectory: string, ...outputs: (string | undefined)[]): Promise<TextContentResponse>;
2
+ export declare function formatTextContents(...outputs: (string | undefined)[]): Promise<TextContentResponse>;
3
3
  export declare function formatTextContent(text: string): TextContent;
@@ -1,5 +1,5 @@
1
1
  import { mcpFeedbackRequest } from './feedbackTracking.js';
2
- export async function formatTextContents(absoluteCurrentWorkingDirectory, ...outputs) {
2
+ export async function formatTextContents(...outputs) {
3
3
  const content = [];
4
4
  outputs.forEach(output => {
5
5
  if (output !== undefined) {
@@ -7,7 +7,7 @@ export async function formatTextContents(absoluteCurrentWorkingDirectory, ...out
7
7
  }
8
8
  });
9
9
  if (outputs.length > 0) {
10
- const feedback = await mcpFeedbackRequest(absoluteCurrentWorkingDirectory);
10
+ const feedback = await mcpFeedbackRequest();
11
11
  if (feedback) {
12
12
  content.push(formatTextContent(feedback));
13
13
  }
@@ -1 +1 @@
1
- export declare function mcpFeedbackRequest(absoluteCurrentWorkingDirectory: string): Promise<string | undefined>;
1
+ export declare function mcpFeedbackRequest(): Promise<string | undefined>;
@@ -1,11 +1,11 @@
1
1
  import { getStateValue, setStateValue, } from '@hubspot/local-dev-lib/config/state';
2
- import { getAccountIdFromCliConfig } from './cliConfig.js';
2
+ import { getConfigDefaultAccountIfExists } from '@hubspot/local-dev-lib/config';
3
3
  import { hasFeature } from '../../lib/hasFeature.js';
4
4
  import { FEATURES } from '../../lib/constants.js';
5
5
  import { logger } from '@hubspot/local-dev-lib/logger';
6
6
  import { MCP_TOTAL_TOOL_CALLS_STATE } from '@hubspot/local-dev-lib/constants/config';
7
7
  const FEEDBACK_THRESHOLDS = [50, 250, 550, 1050];
8
- export async function mcpFeedbackRequest(absoluteCurrentWorkingDirectory) {
8
+ export async function mcpFeedbackRequest() {
9
9
  let feedbackUrl = 'https://app.hubspot.com/l/product-updates/in-beta?rollout=239890';
10
10
  try {
11
11
  const currentCount = getStateValue(MCP_TOTAL_TOOL_CALLS_STATE);
@@ -14,7 +14,7 @@ export async function mcpFeedbackRequest(absoluteCurrentWorkingDirectory) {
14
14
  if (!FEEDBACK_THRESHOLDS.includes(newCount)) {
15
15
  return;
16
16
  }
17
- const accountId = getAccountIdFromCliConfig(absoluteCurrentWorkingDirectory);
17
+ const accountId = getConfigDefaultAccountIfExists()?.accountId;
18
18
  if (accountId) {
19
19
  try {
20
20
  const hasMcpAccess = await hasFeature(accountId, FEATURES.MCP_ACCESS);
@@ -1,9 +1,10 @@
1
1
  import { trackUsage } from '@hubspot/local-dev-lib/trackUsage';
2
2
  import { EventClass, getNodeVersionData, getPlatform, } from '../../lib/usageTracking.js';
3
- import { getAccountId, isTrackingAllowed } from '@hubspot/local-dev-lib/config';
3
+ import { getConfig, getConfigDefaultAccountIfExists, } from '@hubspot/local-dev-lib/config';
4
4
  import { uiLogger } from '../../lib/ui/logger.js';
5
5
  export async function trackToolUsage(toolName, meta) {
6
- if (!isTrackingAllowed()) {
6
+ const config = getConfig();
7
+ if (config?.allowUsageTracking === false) {
7
8
  return;
8
9
  }
9
10
  const usageTrackingEvent = {
@@ -14,7 +15,7 @@ export async function trackToolUsage(toolName, meta) {
14
15
  type: process.env.HUBSPOT_MCP_AI_AGENT,
15
16
  ...meta,
16
17
  };
17
- const accountId = getAccountId() || undefined;
18
+ const accountId = getConfigDefaultAccountIfExists()?.accountId || undefined;
18
19
  try {
19
20
  uiLogger.info('Tracking tool usage');
20
21
  await trackUsage('cli-interaction', EventClass.INTERACTION, usageTrackingEvent, accountId);
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@hubspot/cli",
3
- "version": "7.10.0-beta.1",
3
+ "version": "7.10.0-experimental.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": "3.21.2",
10
- "@hubspot/project-parsing-lib": "0.10.1",
11
- "@hubspot/serverless-dev-runtime": "7.0.6",
12
- "@hubspot/theme-preview-dev-server": "0.0.10",
13
- "@hubspot/ui-extensions-dev-server": "0.10.2",
9
+ "@hubspot/local-dev-lib": "4.0.1",
10
+ "@hubspot/project-parsing-lib": "0.10.2",
11
+ "@hubspot/serverless-dev-runtime": "7.0.7",
12
+ "@hubspot/theme-preview-dev-server": "0.0.12",
13
+ "@hubspot/ui-extensions-dev-server": "1.0.0",
14
14
  "archiver": "7.0.1",
15
15
  "boxen": "8.0.1",
16
16
  "chalk": "5.4.1",
@@ -68,7 +68,7 @@
68
68
  "vitest": "^2.1.9"
69
69
  },
70
70
  "optionalDependencies": {
71
- "@hubspot/cms-dev-server": "^1.0.9",
71
+ "@hubspot/cms-dev-server": "^1.2.1",
72
72
  "@modelcontextprotocol/sdk": "1.13.3"
73
73
  },
74
74
  "scripts": {
@@ -92,6 +92,7 @@
92
92
  "test-cli-debug": "yarn build && yarn --cwd 'acceptance-tests' test-debug",
93
93
  "test-cli-latest": "yarn build && yarn build-docker && docker container run -it --rm --name=hs-cli-container hs-cli-image yarn --cwd 'acceptance-tests' test-latest",
94
94
  "test-cli-qa": "yarn build && yarn --cwd 'acceptance-tests' test-qa",
95
+ "test-cli-qa-debug": "yarn build && yarn --cwd 'acceptance-tests' test-qa-debug",
95
96
  "update-ldl": "yarn add --exact @hubspot/local-dev-lib@latest",
96
97
  "view-unreleased-changes": "node ./scripts/unreleasedChanges.js"
97
98
  },
@@ -18,6 +18,7 @@ export type LocalDevStateConstructorOptions = {
18
18
  };
19
19
  initialProjectProfileData: HSProfileVariables;
20
20
  env: Environment;
21
+ devSessionId?: number;
21
22
  };
22
23
  export type LocalDevWebsocketMessage = {
23
24
  type: string;
@@ -1,8 +0,0 @@
1
- import { notifyAboutUpdates } from '../notificationsMiddleware.js';
2
- describe('lib/middleware/notificationsMiddleware', () => {
3
- describe('notifyAboutUpdates()', () => {
4
- it('should safely execute without throwing an error', () => {
5
- expect(() => notifyAboutUpdates()).not.toThrow();
6
- });
7
- });
8
- });
@@ -1 +0,0 @@
1
- export declare function notifyAboutUpdates(): void;
@@ -1,28 +0,0 @@
1
- import updateNotifier from 'update-notifier';
2
- import { pkg } from '../jsonLoader.js';
3
- import { UI_COLORS } from '../ui/index.js';
4
- import { lib } from '../../lang/en.js';
5
- const notifier = updateNotifier({
6
- pkg: { ...pkg, name: '@hubspot/cli' },
7
- distTag: 'latest',
8
- shouldNotifyInNpmScript: true,
9
- });
10
- const CMS_CLI_PACKAGE_NAME = '@hubspot/cms-cli';
11
- export function notifyAboutUpdates() {
12
- notifier.notify({
13
- message: pkg.name === CMS_CLI_PACKAGE_NAME
14
- ? lib.middleware.updateNotification.cmsUpdateNotification(CMS_CLI_PACKAGE_NAME)
15
- : lib.middleware.updateNotification.cliUpdateNotification,
16
- defer: false,
17
- boxenOptions: {
18
- borderColor: UI_COLORS.MARIGOLD_DARK,
19
- margin: 1,
20
- padding: 1,
21
- textAlignment: 'center',
22
- borderStyle: 'round',
23
- title: pkg.name === CMS_CLI_PACKAGE_NAME
24
- ? undefined
25
- : lib.middleware.updateNotification.notifyTitle,
26
- },
27
- });
28
- }
@@ -1,110 +0,0 @@
1
- import { getAccountIdFromCliConfig } from '../cliConfig.js';
2
- import { configFileExists, findConfig, getAccountId, loadConfig, } from '@hubspot/local-dev-lib/config';
3
- vi.mock('@hubspot/local-dev-lib/config');
4
- const mockConfigFileExists = configFileExists;
5
- const mockFindConfig = findConfig;
6
- const mockGetAccountId = getAccountId;
7
- const mockLoadConfig = loadConfig;
8
- describe('mcp-server/utils/cliConfig', () => {
9
- const mockWorkingDirectory = '/test/working/directory';
10
- beforeEach(() => {
11
- vi.clearAllMocks();
12
- });
13
- describe('getAccountIdFromCliConfig', () => {
14
- it('should load global config when it exists and return account ID', () => {
15
- const expectedAccountId = 12345;
16
- mockConfigFileExists.mockReturnValue(true);
17
- mockGetAccountId.mockReturnValue(expectedAccountId);
18
- const result = getAccountIdFromCliConfig(mockWorkingDirectory);
19
- expect(mockConfigFileExists).toHaveBeenCalledWith(true);
20
- expect(mockLoadConfig).toHaveBeenCalledWith('');
21
- expect(mockFindConfig).not.toHaveBeenCalled();
22
- expect(mockGetAccountId).toHaveBeenCalledWith(undefined);
23
- expect(result).toBe(expectedAccountId);
24
- });
25
- it('should load local config when global config does not exist and return account ID', () => {
26
- const expectedAccountId = 67890;
27
- const localConfigPath = '/path/to/local/config';
28
- mockConfigFileExists.mockReturnValue(false);
29
- mockFindConfig.mockReturnValue(localConfigPath);
30
- mockGetAccountId.mockReturnValue(expectedAccountId);
31
- const result = getAccountIdFromCliConfig(mockWorkingDirectory);
32
- expect(mockConfigFileExists).toHaveBeenCalledWith(true);
33
- expect(mockFindConfig).toHaveBeenCalledWith(mockWorkingDirectory);
34
- expect(mockLoadConfig).toHaveBeenCalledWith(localConfigPath);
35
- expect(mockGetAccountId).toHaveBeenCalledWith(undefined);
36
- expect(result).toBe(expectedAccountId);
37
- });
38
- it('should pass accountNameOrId parameter to getAccountId when provided as string', () => {
39
- const expectedAccountId = 11111;
40
- const accountName = 'test-account';
41
- mockConfigFileExists.mockReturnValue(true);
42
- mockGetAccountId.mockReturnValue(expectedAccountId);
43
- const result = getAccountIdFromCliConfig(mockWorkingDirectory, accountName);
44
- expect(mockConfigFileExists).toHaveBeenCalledWith(true);
45
- expect(mockLoadConfig).toHaveBeenCalledWith('');
46
- expect(mockGetAccountId).toHaveBeenCalledWith(accountName);
47
- expect(result).toBe(expectedAccountId);
48
- });
49
- it('should pass accountNameOrId parameter to getAccountId when provided as number', () => {
50
- const expectedAccountId = 22222;
51
- const accountId = 22222;
52
- mockConfigFileExists.mockReturnValue(true);
53
- mockGetAccountId.mockReturnValue(expectedAccountId);
54
- const result = getAccountIdFromCliConfig(mockWorkingDirectory, accountId);
55
- expect(mockConfigFileExists).toHaveBeenCalledWith(true);
56
- expect(mockLoadConfig).toHaveBeenCalledWith('');
57
- expect(mockGetAccountId).toHaveBeenCalledWith(accountId);
58
- expect(result).toBe(expectedAccountId);
59
- });
60
- it('should return null when getAccountId returns null', () => {
61
- mockConfigFileExists.mockReturnValue(true);
62
- mockGetAccountId.mockReturnValue(null);
63
- const result = getAccountIdFromCliConfig(mockWorkingDirectory);
64
- expect(mockConfigFileExists).toHaveBeenCalledWith(true);
65
- expect(mockLoadConfig).toHaveBeenCalledWith('');
66
- expect(mockGetAccountId).toHaveBeenCalledWith(undefined);
67
- expect(result).toBeNull();
68
- });
69
- it('should handle findConfig returning null by passing null to loadConfig', () => {
70
- const expectedAccountId = 33333;
71
- mockConfigFileExists.mockReturnValue(false);
72
- mockFindConfig.mockReturnValue(null);
73
- mockGetAccountId.mockReturnValue(expectedAccountId);
74
- const result = getAccountIdFromCliConfig(mockWorkingDirectory);
75
- expect(mockConfigFileExists).toHaveBeenCalledWith(true);
76
- expect(mockFindConfig).toHaveBeenCalledWith(mockWorkingDirectory);
77
- expect(mockLoadConfig).toHaveBeenCalledWith(null);
78
- expect(mockGetAccountId).toHaveBeenCalledWith(undefined);
79
- expect(result).toBe(expectedAccountId);
80
- });
81
- it('should work with local config when provided with account name parameter', () => {
82
- const expectedAccountId = 44444;
83
- const accountName = 'local-test-account';
84
- const localConfigPath = '/path/to/local/config';
85
- mockConfigFileExists.mockReturnValue(false);
86
- mockFindConfig.mockReturnValue(localConfigPath);
87
- mockGetAccountId.mockReturnValue(expectedAccountId);
88
- const result = getAccountIdFromCliConfig(mockWorkingDirectory, accountName);
89
- expect(mockConfigFileExists).toHaveBeenCalledWith(true);
90
- expect(mockFindConfig).toHaveBeenCalledWith(mockWorkingDirectory);
91
- expect(mockLoadConfig).toHaveBeenCalledWith(localConfigPath);
92
- expect(mockGetAccountId).toHaveBeenCalledWith(accountName);
93
- expect(result).toBe(expectedAccountId);
94
- });
95
- it('should work with local config when provided with account ID parameter', () => {
96
- const expectedAccountId = 55555;
97
- const accountId = 55555;
98
- const localConfigPath = '/path/to/local/config';
99
- mockConfigFileExists.mockReturnValue(false);
100
- mockFindConfig.mockReturnValue(localConfigPath);
101
- mockGetAccountId.mockReturnValue(expectedAccountId);
102
- const result = getAccountIdFromCliConfig(mockWorkingDirectory, accountId);
103
- expect(mockConfigFileExists).toHaveBeenCalledWith(true);
104
- expect(mockFindConfig).toHaveBeenCalledWith(mockWorkingDirectory);
105
- expect(mockLoadConfig).toHaveBeenCalledWith(localConfigPath);
106
- expect(mockGetAccountId).toHaveBeenCalledWith(accountId);
107
- expect(result).toBe(expectedAccountId);
108
- });
109
- });
110
- });
@@ -1 +0,0 @@
1
- export declare function getAccountIdFromCliConfig(absolutePathToWorkingDirectory: string, accountNameOrId?: string | number): number | null;
@@ -1,12 +0,0 @@
1
- import { configFileExists, findConfig, getAccountId, loadConfig, } from '@hubspot/local-dev-lib/config';
2
- export function getAccountIdFromCliConfig(absolutePathToWorkingDirectory, accountNameOrId) {
3
- const globalConfigExists = configFileExists(true);
4
- if (globalConfigExists) {
5
- loadConfig('');
6
- }
7
- else {
8
- const configPath = findConfig(absolutePathToWorkingDirectory);
9
- loadConfig(configPath);
10
- }
11
- return getAccountId(accountNameOrId);
12
- }