@hubspot/cli 8.2.0-experimental.2 → 8.2.1-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.
- package/commands/account/clean.js +1 -1
- package/commands/account/list.js +1 -1
- package/commands/account/remove.js +1 -1
- package/commands/account/rename.js +1 -1
- package/commands/account/use.js +1 -1
- package/commands/api.d.ts +4 -1
- package/commands/api.js +11 -14
- package/commands/config/set.js +24 -5
- package/commands/customObject/createSchema.js +2 -3
- package/commands/customObject/updateSchema.js +2 -3
- package/commands/getStarted.js +1 -0
- package/commands/hubdb/list.d.ts +1 -1
- package/commands/hubdb/list.js +7 -8
- package/commands/mcp/setup.d.ts +2 -0
- package/commands/mcp/setup.js +29 -1
- package/commands/project/appInstallStatus.d.ts +2 -1
- package/commands/project/appInstallStatus.js +21 -19
- package/commands/project/create.js +0 -1
- package/commands/project/deploy.d.ts +2 -1
- package/commands/project/deploy.js +31 -14
- package/commands/project/dev/index.js +18 -64
- package/commands/project/dev/unifiedFlow.js +3 -1
- package/commands/project/info.d.ts +2 -1
- package/commands/project/info.js +8 -6
- package/commands/project/installApp.d.ts +2 -1
- package/commands/project/installApp.js +26 -27
- package/commands/project/list.js +1 -1
- package/commands/project/listBuilds.d.ts +1 -1
- package/commands/project/listBuilds.js +8 -6
- package/commands/project/logs.js +2 -4
- package/commands/project/profile/add.d.ts +2 -1
- package/commands/project/profile/add.js +22 -1
- package/commands/project/profile/delete.d.ts +1 -1
- package/commands/project/release/create.d.ts +2 -1
- package/commands/project/release/create.js +68 -69
- package/commands/project/release/info.d.ts +2 -1
- package/commands/project/release/info.js +7 -6
- package/commands/project/release/list.d.ts +2 -1
- package/commands/project/release/list.js +15 -7
- package/commands/project/upload.d.ts +4 -1
- package/commands/project/upload.js +48 -21
- package/commands/project/validate.d.ts +1 -1
- package/commands/project/watch.js +3 -2
- package/commands/project.js +2 -2
- package/commands/sandbox/delete.js +2 -3
- package/commands/testAccount/create.d.ts +2 -1
- package/commands/testAccount/create.js +7 -7
- package/commands/testAccount/importData.d.ts +1 -1
- package/lang/en.d.ts +61 -33
- package/lang/en.js +77 -48
- package/lib/app/urls.js +2 -3
- package/lib/commonOpts.js +6 -1
- package/lib/configOptions.d.ts +10 -10
- package/lib/configOptions.js +10 -11
- package/lib/constants.d.ts +2 -0
- package/lib/constants.js +2 -0
- package/lib/dependencyManagement.js +7 -7
- package/lib/getStartedV2Actions.js +2 -1
- package/lib/importData.js +3 -4
- package/lib/jsonOutput.d.ts +109 -0
- package/lib/jsonOutput.js +94 -0
- package/lib/links.js +6 -5
- package/lib/mcp/clients.d.ts +1 -1
- package/lib/mcp/clients.js +8 -1
- package/lib/mcp/setup.d.ts +9 -4
- package/lib/mcp/setup.js +115 -35
- package/lib/npm/npmCli.d.ts +1 -0
- package/lib/npm/npmCli.js +13 -0
- package/lib/projects/builds.d.ts +2 -0
- package/lib/projects/builds.js +22 -0
- package/lib/projects/create/v2.js +1 -0
- package/lib/projects/installApp.d.ts +1 -1
- package/lib/projects/installApp.js +8 -3
- package/lib/projects/localDev/DevSessionManager.d.ts +2 -2
- package/lib/projects/localDev/DevSessionManager.js +4 -30
- package/lib/projects/localDev/LocalDevProcess.js +7 -5
- package/lib/projects/localDev/helpers/account.d.ts +0 -7
- package/lib/projects/localDev/helpers/account.js +1 -80
- package/lib/projects/localDev/helpers/project.js +3 -2
- package/lib/projects/release.d.ts +4 -0
- package/lib/projects/release.js +90 -0
- package/lib/projects/ui.d.ts +1 -0
- package/lib/projects/ui.js +14 -0
- package/lib/projects/upload.d.ts +10 -2
- package/lib/projects/upload.js +14 -7
- package/lib/projects/urls.d.ts +0 -1
- package/lib/projects/urls.js +6 -13
- package/lib/yargs/makeWrappedYargsHandler.d.ts +5 -1
- package/lib/yargs/makeWrappedYargsHandler.js +123 -65
- package/mcp-server/Tool.d.ts +8 -3
- package/mcp-server/Tool.js +58 -32
- package/mcp-server/server.js +10 -6
- package/mcp-server/tools/cms/HsCreateFunctionTool.d.ts +2 -2
- package/mcp-server/tools/cms/HsCreateFunctionTool.js +10 -17
- package/mcp-server/tools/cms/HsCreateModuleTool.d.ts +2 -2
- package/mcp-server/tools/cms/HsCreateModuleTool.js +12 -18
- package/mcp-server/tools/cms/HsCreateTemplateTool.d.ts +2 -2
- package/mcp-server/tools/cms/HsCreateTemplateTool.js +8 -10
- package/mcp-server/tools/cms/HsFunctionLogsTool.d.ts +2 -2
- package/mcp-server/tools/cms/HsFunctionLogsTool.js +9 -9
- package/mcp-server/tools/cms/HsListFunctionsTool.d.ts +2 -2
- package/mcp-server/tools/cms/HsListFunctionsTool.js +7 -7
- package/mcp-server/tools/cms/HsListTool.d.ts +2 -2
- package/mcp-server/tools/cms/HsListTool.js +6 -10
- package/mcp-server/tools/index.js +2 -0
- package/mcp-server/tools/project/AddFeatureToProjectTool.d.ts +3 -2
- package/mcp-server/tools/project/AddFeatureToProjectTool.js +8 -9
- package/mcp-server/tools/project/AuthAccountTool.d.ts +18 -0
- package/mcp-server/tools/project/AuthAccountTool.js +78 -0
- package/mcp-server/tools/project/CreateProjectTool.d.ts +3 -2
- package/mcp-server/tools/project/CreateProjectTool.js +13 -12
- package/mcp-server/tools/project/CreateTestAccountTool.d.ts +2 -2
- package/mcp-server/tools/project/CreateTestAccountTool.js +14 -15
- package/mcp-server/tools/project/DeployProjectTool.d.ts +2 -2
- package/mcp-server/tools/project/DeployProjectTool.js +10 -10
- package/mcp-server/tools/project/DocFetchTool.js +1 -1
- package/mcp-server/tools/project/DocsSearchTool.js +8 -7
- package/mcp-server/tools/project/FindProjectsTool.js +1 -1
- package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.d.ts +2 -1
- package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.js +9 -8
- package/mcp-server/tools/project/GetApplicationInfoTool.d.ts +2 -1
- package/mcp-server/tools/project/GetApplicationInfoTool.js +12 -9
- package/mcp-server/tools/project/GetBuildLogsTool.js +11 -7
- package/mcp-server/tools/project/GetBuildStatusTool.js +11 -7
- package/mcp-server/tools/project/GetConfigValuesTool.d.ts +2 -1
- package/mcp-server/tools/project/GetConfigValuesTool.js +9 -7
- package/mcp-server/tools/project/GuidedWalkthroughTool.js +1 -1
- package/mcp-server/tools/project/UploadProjectTools.d.ts +2 -2
- package/mcp-server/tools/project/UploadProjectTools.js +9 -8
- package/mcp-server/tools/project/ValidateProjectTool.d.ts +2 -2
- package/mcp-server/tools/project/ValidateProjectTool.js +5 -4
- package/mcp-server/tools/project/constants.d.ts +1 -0
- package/mcp-server/tools/project/constants.js +2 -1
- package/mcp-server/utils/command.d.ts +25 -2
- package/mcp-server/utils/command.js +67 -17
- package/mcp-server/utils/config.js +5 -0
- package/mcp-server/utils/logger.d.ts +3 -0
- package/mcp-server/utils/logger.js +30 -0
- package/mcp-server/utils/toolUsageTracking.js +18 -3
- package/package.json +11 -9
- package/types/Yargs.d.ts +3 -1
- package/commands/project/dev/deprecatedFlow.d.ts +0 -11
- package/commands/project/dev/deprecatedFlow.js +0 -180
- package/lib/projects/localDev/DevServerManager_DEPRECATED.d.ts +0 -43
- package/lib/projects/localDev/DevServerManager_DEPRECATED.js +0 -128
- package/lib/projects/localDev/LocalDevManager_DEPRECATED.d.ts +0 -64
- package/lib/projects/localDev/LocalDevManager_DEPRECATED.js +0 -394
package/lib/configOptions.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { updateAllowUsageTracking, updateAllowAutoUpdates, updateDefaultCmsPublishMode, updateHttpTimeout, updateAutoOpenBrowser, } from '@hubspot/local-dev-lib/config';
|
|
2
2
|
import { CMS_PUBLISH_MODE } from '@hubspot/local-dev-lib/constants/files';
|
|
3
3
|
import { commaSeparatedValues } from '@hubspot/local-dev-lib/text';
|
|
4
|
-
import { trackCommandUsage } from './usageTracking.js';
|
|
5
4
|
import { promptUser, listPrompt } from './prompts/promptUtils.js';
|
|
6
5
|
import { lib } from '../lang/en.js';
|
|
7
6
|
import { uiLogger } from './ui/logger.js';
|
|
@@ -23,8 +22,7 @@ async function enableOrDisableBooleanFieldPrompt(fieldName) {
|
|
|
23
22
|
});
|
|
24
23
|
return isEnabled;
|
|
25
24
|
}
|
|
26
|
-
export async function setAllowUsageTracking({
|
|
27
|
-
trackCommandUsage('config-set-allow-usage-tracking', undefined, accountId);
|
|
25
|
+
export async function setAllowUsageTracking({ allowUsageTracking, }) {
|
|
28
26
|
let isEnabled;
|
|
29
27
|
if (typeof allowUsageTracking === 'boolean') {
|
|
30
28
|
isEnabled = allowUsageTracking;
|
|
@@ -34,9 +32,9 @@ export async function setAllowUsageTracking({ accountId, allowUsageTracking, })
|
|
|
34
32
|
}
|
|
35
33
|
updateAllowUsageTracking(isEnabled);
|
|
36
34
|
uiLogger.success(lib.configOptions.setAllowUsageTracking.success(isEnabled.toString()));
|
|
35
|
+
return isEnabled;
|
|
37
36
|
}
|
|
38
|
-
export async function setAllowAutoUpdates({
|
|
39
|
-
trackCommandUsage('config-set-allow-auto-updates', undefined, accountId);
|
|
37
|
+
export async function setAllowAutoUpdates({ allowAutoUpdates, }) {
|
|
40
38
|
let isEnabled;
|
|
41
39
|
if (typeof allowAutoUpdates === 'boolean') {
|
|
42
40
|
isEnabled = allowAutoUpdates;
|
|
@@ -46,6 +44,7 @@ export async function setAllowAutoUpdates({ accountId, allowAutoUpdates, }) {
|
|
|
46
44
|
}
|
|
47
45
|
updateAllowAutoUpdates(isEnabled);
|
|
48
46
|
uiLogger.success(lib.configOptions.setAllowAutoUpdates.success(isEnabled.toString()));
|
|
47
|
+
return isEnabled;
|
|
49
48
|
}
|
|
50
49
|
const ALL_CMS_PUBLISH_MODES = Object.values(CMS_PUBLISH_MODE);
|
|
51
50
|
async function selectCmsPublishMode() {
|
|
@@ -55,8 +54,7 @@ async function selectCmsPublishMode() {
|
|
|
55
54
|
});
|
|
56
55
|
return cmsPublishMode;
|
|
57
56
|
}
|
|
58
|
-
export async function setDefaultCmsPublishMode({
|
|
59
|
-
trackCommandUsage('config-set-default-mode', undefined, accountId);
|
|
57
|
+
export async function setDefaultCmsPublishMode({ defaultCmsPublishMode, }) {
|
|
60
58
|
let newDefault;
|
|
61
59
|
if (!defaultCmsPublishMode) {
|
|
62
60
|
newDefault = await selectCmsPublishMode();
|
|
@@ -71,6 +69,7 @@ export async function setDefaultCmsPublishMode({ accountId, defaultCmsPublishMod
|
|
|
71
69
|
}
|
|
72
70
|
updateDefaultCmsPublishMode(newDefault);
|
|
73
71
|
uiLogger.success(lib.configOptions.setDefaultCmsPublishMode.success(newDefault));
|
|
72
|
+
return newDefault;
|
|
74
73
|
}
|
|
75
74
|
async function enterTimeout() {
|
|
76
75
|
const { timeout } = await promptUser([
|
|
@@ -90,8 +89,7 @@ async function enterTimeout() {
|
|
|
90
89
|
]);
|
|
91
90
|
return timeout;
|
|
92
91
|
}
|
|
93
|
-
export async function setHttpTimeout({
|
|
94
|
-
trackCommandUsage('config-set-http-timeout', undefined, accountId);
|
|
92
|
+
export async function setHttpTimeout({ httpTimeout, }) {
|
|
95
93
|
let newHttpTimeout;
|
|
96
94
|
if (!httpTimeout) {
|
|
97
95
|
newHttpTimeout = await enterTimeout();
|
|
@@ -101,11 +99,12 @@ export async function setHttpTimeout({ accountId, httpTimeout, }) {
|
|
|
101
99
|
}
|
|
102
100
|
updateHttpTimeout(newHttpTimeout);
|
|
103
101
|
uiLogger.success(lib.configOptions.setHttpTimeout.success(newHttpTimeout));
|
|
102
|
+
return newHttpTimeout;
|
|
104
103
|
}
|
|
105
|
-
export async function setAutoOpenBrowser({
|
|
106
|
-
trackCommandUsage('config-set-auto-open-browser', undefined, accountId);
|
|
104
|
+
export async function setAutoOpenBrowser({ autoOpenBrowser, }) {
|
|
107
105
|
updateAutoOpenBrowser(autoOpenBrowser);
|
|
108
106
|
uiLogger.success(autoOpenBrowser
|
|
109
107
|
? lib.configOptions.setAutoOpenBrowser.enabled
|
|
110
108
|
: lib.configOptions.setAutoOpenBrowser.disabled);
|
|
109
|
+
return autoOpenBrowser;
|
|
111
110
|
}
|
package/lib/constants.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH: "HubSpot/hubspot-project-components";
|
|
2
|
+
export declare const MAX_LOG_FILES = 10;
|
|
2
3
|
export declare const DEFAULT_PROJECT_TEMPLATE_BRANCH: "main";
|
|
3
4
|
export declare const FEEDBACK_INTERVAL: 10;
|
|
4
5
|
export declare const HUBSPOT_FOLDER: "@hubspot";
|
|
@@ -81,6 +82,7 @@ export declare const FEATURES: {
|
|
|
81
82
|
readonly APP_EVENTS: "Developers:UnifiedApps:AppEventsAccess";
|
|
82
83
|
readonly THEME_MIGRATION_2025_2: "Developers:ProjectThemeMigrations:2025.2";
|
|
83
84
|
readonly AGENT_TOOLS: "ThirdPartyAgentTools";
|
|
85
|
+
readonly APP_ACTIONS: "Developers:AppActions";
|
|
84
86
|
};
|
|
85
87
|
export declare const LOCAL_DEV_UI_MESSAGE_SEND_TYPES: {
|
|
86
88
|
UPLOAD_SUCCESS: string;
|
package/lib/constants.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH = 'HubSpot/hubspot-project-components';
|
|
2
|
+
export const MAX_LOG_FILES = 10;
|
|
2
3
|
export const DEFAULT_PROJECT_TEMPLATE_BRANCH = 'main';
|
|
3
4
|
export const FEEDBACK_INTERVAL = 10;
|
|
4
5
|
export const HUBSPOT_FOLDER = '@hubspot';
|
|
@@ -73,6 +74,7 @@ export const FEATURES = {
|
|
|
73
74
|
APP_EVENTS: 'Developers:UnifiedApps:AppEventsAccess',
|
|
74
75
|
THEME_MIGRATION_2025_2: 'Developers:ProjectThemeMigrations:2025.2',
|
|
75
76
|
AGENT_TOOLS: 'ThirdPartyAgentTools',
|
|
77
|
+
APP_ACTIONS: 'Developers:AppActions',
|
|
76
78
|
};
|
|
77
79
|
export const LOCAL_DEV_UI_MESSAGE_SEND_TYPES = {
|
|
78
80
|
UPLOAD_SUCCESS: 'server:uploadSuccess',
|
|
@@ -5,7 +5,7 @@ import { exec as execAsync } from 'node:child_process';
|
|
|
5
5
|
import { getProjectConfig } from './projects/config.js';
|
|
6
6
|
import { commands } from '../lang/en.js';
|
|
7
7
|
import SpinniesManager from './ui/SpinniesManager.js';
|
|
8
|
-
import { isGloballyInstalled, executeInstall, executeUpdate, DEFAULT_PACKAGE_MANAGER, } from './npm/npmCli.js';
|
|
8
|
+
import { isGloballyInstalled, executeInstall, executeUpdate, getNpmExecErrorOutput, DEFAULT_PACKAGE_MANAGER, } from './npm/npmCli.js';
|
|
9
9
|
import { findAllPackageJsonFilesInProjectCached, safeGetPackageJsonCached, } from './npm/packageJson.js';
|
|
10
10
|
import { getNpmWorkspaceDirectoryForPackageAtLocationCached } from './npm/workspaces.js';
|
|
11
11
|
class NoPackageJsonFilesError extends Error {
|
|
@@ -106,9 +106,9 @@ async function installPackagesInDirectory({ directory, packages, dev = false, np
|
|
|
106
106
|
SpinniesManager.fail(spinner, {
|
|
107
107
|
text: commands.project.installDeps.installingDependenciesFailed(relativeDir),
|
|
108
108
|
});
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
const npmErrorOutput = getNpmExecErrorOutput(e);
|
|
110
|
+
throw new Error(npmErrorOutput ||
|
|
111
|
+
commands.project.installDeps.installingDependenciesFailed(relativeDir), npmErrorOutput ? undefined : { cause: e });
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
export async function updatePackages({ packages, installLocations, }) {
|
|
@@ -176,9 +176,9 @@ async function updatePackagesInDirectory({ directory, packages, npmWorkspaceDire
|
|
|
176
176
|
SpinniesManager.fail(spinner, {
|
|
177
177
|
text: commands.project.updateDeps.updatingDependenciesFailed(relativeDir),
|
|
178
178
|
});
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
const npmErrorOutput = getNpmExecErrorOutput(e);
|
|
180
|
+
throw new Error(npmErrorOutput ||
|
|
181
|
+
commands.project.updateDeps.updatingDependenciesFailed(relativeDir), npmErrorOutput ? undefined : { cause: e });
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
export async function getProjectPackageJsonLocations(dir, isUpdate = false) {
|
|
@@ -73,7 +73,7 @@ async function fetchAppAfterDeploy(accountId, env) {
|
|
|
73
73
|
async function buildProjectMetadata(projectDir, projectConfig, accountId) {
|
|
74
74
|
const srcDir = path.join(projectDir, projectConfig.srcDir);
|
|
75
75
|
const projectMetadata = await getProjectMetadata(srcDir);
|
|
76
|
-
const intermediateRepresentation = await translate({
|
|
76
|
+
const { intermediateRepresentation } = await translate({
|
|
77
77
|
projectSourceDir: srcDir,
|
|
78
78
|
platformVersion: projectConfig.platformVersion,
|
|
79
79
|
accountId,
|
|
@@ -111,6 +111,7 @@ export async function uploadAndDeployAction({ accountId, projectDest, }) {
|
|
|
111
111
|
isUploadCommand: false,
|
|
112
112
|
sendIR: !isLegacyProject(projectConfig.platformVersion),
|
|
113
113
|
skipValidation: false,
|
|
114
|
+
force: true,
|
|
114
115
|
});
|
|
115
116
|
if (uploadError) {
|
|
116
117
|
throw new ProjectUploadError(commands.getStarted.errors.uploadActionFailed, uploadError);
|
package/lib/importData.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { getConfigAccountById,
|
|
1
|
+
import { getConfigAccountById, getConfigAccountIfExists, } from '@hubspot/local-dev-lib/config';
|
|
2
2
|
import { createImport } from '@hubspot/local-dev-lib/api/crm';
|
|
3
|
-
import {
|
|
3
|
+
import { getHubSpotWebsiteOriginByAccountId } from '@hubspot/local-dev-lib/urls';
|
|
4
4
|
import { importDataTestAccountSelectPrompt } from './prompts/importDataTestAccountSelectPrompt.js';
|
|
5
5
|
import { lib } from '../lang/en.js';
|
|
6
6
|
import { isAppDeveloperAccount, isDeveloperTestAccount, isStandardAccount, } from './accountTypes.js';
|
|
7
7
|
import { uiLogger } from './ui/logger.js';
|
|
8
8
|
export async function handleImportData(targetAccountId, dataFileNames, importRequest) {
|
|
9
9
|
try {
|
|
10
|
-
const baseUrl = getHubSpotWebsiteOrigin(getConfigAccountEnvironment(targetAccountId));
|
|
11
10
|
const response = await createImport(targetAccountId, importRequest, dataFileNames);
|
|
12
11
|
const importId = response.data.id;
|
|
13
|
-
uiLogger.info(lib.importData.viewImportLink(
|
|
12
|
+
uiLogger.info(lib.importData.viewImportLink(getHubSpotWebsiteOriginByAccountId(targetAccountId), targetAccountId, importId));
|
|
14
13
|
}
|
|
15
14
|
catch (error) {
|
|
16
15
|
uiLogger.error(lib.importData.errors.failedToImportData);
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Release } from '../api/releases.js';
|
|
3
|
+
declare const ReleaseComponentSchema: z.ZodObject<{
|
|
4
|
+
buildType: z.ZodString;
|
|
5
|
+
buildName: z.ZodOptional<z.ZodString>;
|
|
6
|
+
rootPath: z.ZodOptional<z.ZodString>;
|
|
7
|
+
id: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const ReleaseSchema: z.ZodObject<{
|
|
10
|
+
releaseTag: z.ZodString;
|
|
11
|
+
buildId: z.ZodNumber;
|
|
12
|
+
createdAt: z.ZodString;
|
|
13
|
+
components: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
14
|
+
buildType: z.ZodString;
|
|
15
|
+
buildName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
rootPath: z.ZodOptional<z.ZodString>;
|
|
17
|
+
id: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export declare const ReleaseListSchema: z.ZodObject<{
|
|
21
|
+
results: z.ZodArray<z.ZodObject<{
|
|
22
|
+
releaseTag: z.ZodString;
|
|
23
|
+
buildId: z.ZodNumber;
|
|
24
|
+
createdAt: z.ZodString;
|
|
25
|
+
components: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
26
|
+
buildType: z.ZodString;
|
|
27
|
+
buildName: z.ZodOptional<z.ZodString>;
|
|
28
|
+
rootPath: z.ZodOptional<z.ZodString>;
|
|
29
|
+
id: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>>>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
paging: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
next: z.ZodObject<{
|
|
34
|
+
after: z.ZodString;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export declare const ProjectInfoSchema: z.ZodObject<{
|
|
39
|
+
projectName: z.ZodString;
|
|
40
|
+
platformVersion: z.ZodString;
|
|
41
|
+
projectId: z.ZodNumber;
|
|
42
|
+
deployedBuildId: z.ZodNumber;
|
|
43
|
+
autoDeployEnabled: z.ZodBoolean;
|
|
44
|
+
projectUrl: z.ZodOptional<z.ZodString>;
|
|
45
|
+
app: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
id: z.ZodNumber;
|
|
48
|
+
uid: z.ZodString;
|
|
49
|
+
authType: z.ZodOptional<z.ZodString>;
|
|
50
|
+
distributionType: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
components: z.ZodArray<z.ZodObject<{
|
|
53
|
+
uid: z.ZodString;
|
|
54
|
+
type: z.ZodString;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
declare const PreviewSchema: z.ZodObject<{
|
|
58
|
+
releaseTag: z.ZodOptional<z.ZodString>;
|
|
59
|
+
succeeded: z.ZodBoolean;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
export declare const UploadSchema: z.ZodObject<{
|
|
62
|
+
buildId: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
deployId: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
preview: z.ZodOptional<z.ZodObject<{
|
|
65
|
+
releaseTag: z.ZodOptional<z.ZodString>;
|
|
66
|
+
succeeded: z.ZodBoolean;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export declare const DeploySchema: z.ZodObject<{
|
|
70
|
+
deployId: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export declare const InstallStatusSchema: z.ZodObject<{
|
|
73
|
+
appId: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
appUid: z.ZodString;
|
|
75
|
+
accountId: z.ZodNumber;
|
|
76
|
+
projectId: z.ZodNumber;
|
|
77
|
+
isInstalled: z.ZodBoolean;
|
|
78
|
+
isInstalledWithCurrentScopes: z.ZodBoolean;
|
|
79
|
+
previouslyAuthorizedScopeGroups: z.ZodArray<z.ZodObject<{
|
|
80
|
+
id: z.ZodNumber;
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
}, z.core.$strip>>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
export declare const InstallAppSchema: z.ZodObject<{
|
|
85
|
+
appId: z.ZodNumber;
|
|
86
|
+
appUid: z.ZodString;
|
|
87
|
+
accountId: z.ZodNumber;
|
|
88
|
+
projectId: z.ZodNumber;
|
|
89
|
+
installationState: z.ZodString;
|
|
90
|
+
installed: z.ZodBoolean;
|
|
91
|
+
reinstalled: z.ZodBoolean;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export declare const CreateTestAccountSchema: z.ZodObject<{
|
|
94
|
+
accountName: z.ZodOptional<z.ZodString>;
|
|
95
|
+
accountId: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
personalAccessKey: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
export type ReleaseComponentJsonOutput = z.infer<typeof ReleaseComponentSchema>;
|
|
99
|
+
export type ReleaseJsonOutput = z.infer<typeof ReleaseSchema>;
|
|
100
|
+
export type ReleaseListJsonOutput = z.infer<typeof ReleaseListSchema>;
|
|
101
|
+
export type ProjectInfoJsonOutput = z.infer<typeof ProjectInfoSchema>;
|
|
102
|
+
export type PreviewJsonOutput = z.infer<typeof PreviewSchema>;
|
|
103
|
+
export type UploadJsonOutput = z.infer<typeof UploadSchema>;
|
|
104
|
+
export type DeployJsonOutput = z.infer<typeof DeploySchema>;
|
|
105
|
+
export type InstallStatusJsonOutput = z.infer<typeof InstallStatusSchema>;
|
|
106
|
+
export type InstallAppJsonOutput = z.infer<typeof InstallAppSchema>;
|
|
107
|
+
export type CreateTestAccountJsonOutput = z.infer<typeof CreateTestAccountSchema>;
|
|
108
|
+
export declare function mapReleaseToJsonOutput(release: Release): ReleaseJsonOutput;
|
|
109
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const ReleaseComponentSchema = z.object({
|
|
3
|
+
buildType: z.string(),
|
|
4
|
+
buildName: z.string().optional(),
|
|
5
|
+
rootPath: z.string().optional(),
|
|
6
|
+
id: z.string().optional(),
|
|
7
|
+
});
|
|
8
|
+
export const ReleaseSchema = z.object({
|
|
9
|
+
releaseTag: z.string(),
|
|
10
|
+
buildId: z.number(),
|
|
11
|
+
createdAt: z.string(),
|
|
12
|
+
components: z.array(ReleaseComponentSchema).optional(),
|
|
13
|
+
});
|
|
14
|
+
export const ReleaseListSchema = z.object({
|
|
15
|
+
results: z.array(ReleaseSchema),
|
|
16
|
+
paging: z
|
|
17
|
+
.object({
|
|
18
|
+
next: z.object({
|
|
19
|
+
after: z.string(),
|
|
20
|
+
}),
|
|
21
|
+
})
|
|
22
|
+
.optional(),
|
|
23
|
+
});
|
|
24
|
+
export const ProjectInfoSchema = z.object({
|
|
25
|
+
projectName: z.string(),
|
|
26
|
+
platformVersion: z.string(),
|
|
27
|
+
projectId: z.number(),
|
|
28
|
+
deployedBuildId: z.number(),
|
|
29
|
+
autoDeployEnabled: z.boolean(),
|
|
30
|
+
projectUrl: z.string().optional(),
|
|
31
|
+
app: z
|
|
32
|
+
.object({
|
|
33
|
+
name: z.string(),
|
|
34
|
+
id: z.number(),
|
|
35
|
+
uid: z.string(),
|
|
36
|
+
authType: z.string().optional(),
|
|
37
|
+
distributionType: z.string().optional(),
|
|
38
|
+
})
|
|
39
|
+
.optional(),
|
|
40
|
+
components: z.array(z.object({ uid: z.string(), type: z.string() })),
|
|
41
|
+
});
|
|
42
|
+
const PreviewSchema = z.object({
|
|
43
|
+
releaseTag: z.string().optional(),
|
|
44
|
+
succeeded: z.boolean(),
|
|
45
|
+
});
|
|
46
|
+
export const UploadSchema = z.object({
|
|
47
|
+
buildId: z.number().optional(),
|
|
48
|
+
deployId: z.number().optional(),
|
|
49
|
+
preview: PreviewSchema.optional(),
|
|
50
|
+
});
|
|
51
|
+
export const DeploySchema = z.object({
|
|
52
|
+
deployId: z.number().optional(),
|
|
53
|
+
});
|
|
54
|
+
const ScopeGroupSchema = z.object({
|
|
55
|
+
id: z.number(),
|
|
56
|
+
name: z.string(),
|
|
57
|
+
});
|
|
58
|
+
export const InstallStatusSchema = z.object({
|
|
59
|
+
appId: z.number().optional(),
|
|
60
|
+
appUid: z.string(),
|
|
61
|
+
accountId: z.number(),
|
|
62
|
+
projectId: z.number(),
|
|
63
|
+
isInstalled: z.boolean(),
|
|
64
|
+
isInstalledWithCurrentScopes: z.boolean(),
|
|
65
|
+
previouslyAuthorizedScopeGroups: z.array(ScopeGroupSchema),
|
|
66
|
+
});
|
|
67
|
+
export const InstallAppSchema = z.object({
|
|
68
|
+
appId: z.number(),
|
|
69
|
+
appUid: z.string(),
|
|
70
|
+
accountId: z.number(),
|
|
71
|
+
projectId: z.number(),
|
|
72
|
+
installationState: z.string(),
|
|
73
|
+
installed: z.boolean(),
|
|
74
|
+
reinstalled: z.boolean(),
|
|
75
|
+
});
|
|
76
|
+
export const CreateTestAccountSchema = z.object({
|
|
77
|
+
accountName: z.string().optional(),
|
|
78
|
+
accountId: z.number().optional(),
|
|
79
|
+
personalAccessKey: z.string().optional(),
|
|
80
|
+
});
|
|
81
|
+
export function mapReleaseToJsonOutput(release) {
|
|
82
|
+
const { releaseTag, buildId, createdAt, components } = release;
|
|
83
|
+
return {
|
|
84
|
+
releaseTag,
|
|
85
|
+
buildId,
|
|
86
|
+
createdAt,
|
|
87
|
+
components: components?.map(({ buildType, buildName, rootPath, id }) => ({
|
|
88
|
+
buildType,
|
|
89
|
+
buildName,
|
|
90
|
+
rootPath,
|
|
91
|
+
id,
|
|
92
|
+
})),
|
|
93
|
+
};
|
|
94
|
+
}
|
package/lib/links.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import open from 'open';
|
|
2
|
-
import {
|
|
3
|
-
import { getHubSpotWebsiteOrigin } from '@hubspot/local-dev-lib/urls';
|
|
2
|
+
import { getHubSpotWebsiteOrigin, getHubSpotWebsiteOriginByAccountId, } from '@hubspot/local-dev-lib/urls';
|
|
4
3
|
import { ENVIRONMENTS } from '@hubspot/local-dev-lib/constants/environments';
|
|
5
4
|
import { uiLogger } from './ui/logger.js';
|
|
6
5
|
import { renderTable } from '../ui/render.js';
|
|
@@ -75,7 +74,7 @@ const COMMON_SITE_LINKS = {
|
|
|
75
74
|
},
|
|
76
75
|
};
|
|
77
76
|
export function getSiteLinksAsArray(accountId) {
|
|
78
|
-
const baseUrl =
|
|
77
|
+
const baseUrl = getHubSpotWebsiteOriginByAccountId(accountId);
|
|
79
78
|
return Object.values(COMMON_SITE_LINKS)
|
|
80
79
|
.sort((a, b) => (a.shortcut < b.shortcut ? -1 : 1))
|
|
81
80
|
.map(l => ({ ...l, url: l.getUrl(accountId, baseUrl) }));
|
|
@@ -94,12 +93,14 @@ export function openLink(accountId, shortcut) {
|
|
|
94
93
|
uiLogger.error(`We couldn't find a shortcut matching ${shortcut}. Type 'hs open list' to see a list of available shortcuts`);
|
|
95
94
|
return;
|
|
96
95
|
}
|
|
97
|
-
const baseUrl =
|
|
96
|
+
const baseUrl = getHubSpotWebsiteOriginByAccountId(accountId);
|
|
98
97
|
open(match.getUrl(accountId, baseUrl), { url: true });
|
|
99
98
|
uiLogger.success(`We opened ${match.getUrl(accountId, baseUrl)} in your browser`);
|
|
100
99
|
}
|
|
101
100
|
export function getProductUpdatesUrl(rolloutId, accountId) {
|
|
102
|
-
const baseUrl =
|
|
101
|
+
const baseUrl = accountId
|
|
102
|
+
? getHubSpotWebsiteOriginByAccountId(accountId)
|
|
103
|
+
: getHubSpotWebsiteOrigin(ENVIRONMENTS.PROD);
|
|
103
104
|
if (accountId) {
|
|
104
105
|
return `${baseUrl}/product-updates/${accountId}/in-beta?rollout=${rolloutId}`;
|
|
105
106
|
}
|
package/lib/mcp/clients.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const MCP_SERVER_NAME = "HubSpotDev";
|
|
2
|
-
export type McpClientId = 'codex' | 'claude' | 'cursor' | 'gemini' | '
|
|
2
|
+
export type McpClientId = 'codex' | 'claude' | 'cursor' | 'devin' | 'gemini' | 'opencode' | 'vscode';
|
|
3
3
|
type McpClientDetection = {
|
|
4
4
|
type: 'json' | 'text';
|
|
5
5
|
pathSegments: string[];
|
package/lib/mcp/clients.js
CHANGED
|
@@ -39,12 +39,19 @@ export const MCP_CLIENTS = [
|
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
id: '
|
|
42
|
+
id: 'devin',
|
|
43
43
|
detection: {
|
|
44
44
|
type: 'json',
|
|
45
45
|
pathSegments: ['.codeium', 'windsurf', 'mcp_config.json'],
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
id: 'opencode',
|
|
50
|
+
detection: {
|
|
51
|
+
type: 'json',
|
|
52
|
+
pathSegments: ['.config', 'opencode', 'config.json'],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
48
55
|
];
|
|
49
56
|
export function getMcpClientPathSegments(id) {
|
|
50
57
|
const client = MCP_CLIENTS.find(c => c.id === id);
|
package/lib/mcp/setup.d.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { McpClientId } from './clients.js';
|
|
2
1
|
export declare const supportedTools: {
|
|
3
2
|
name: string;
|
|
4
|
-
value:
|
|
3
|
+
value: string;
|
|
5
4
|
}[];
|
|
6
5
|
interface McpCommand {
|
|
7
6
|
command: string;
|
|
8
7
|
args: string[];
|
|
9
8
|
env?: Record<string, string>;
|
|
10
9
|
}
|
|
11
|
-
|
|
10
|
+
interface ConfigureMcpServerOptions {
|
|
11
|
+
targets?: string[];
|
|
12
|
+
standalone?: boolean;
|
|
13
|
+
cliVersion?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function configureMcpServer(options: ConfigureMcpServerOptions): Promise<string[]>;
|
|
12
16
|
export declare function setupVsCode(mcpCommand?: McpCommand): Promise<boolean>;
|
|
13
17
|
export declare function setupClaudeCode(mcpCommand?: McpCommand): Promise<boolean>;
|
|
14
18
|
export declare function setupCursor(mcpCommand?: McpCommand): boolean;
|
|
15
|
-
export declare function
|
|
19
|
+
export declare function setupDevin(mcpCommand?: McpCommand): boolean;
|
|
16
20
|
export declare function setupCodex(mcpCommand?: McpCommand): Promise<boolean>;
|
|
17
21
|
export declare function setupGemini(mcpCommand?: McpCommand): Promise<boolean>;
|
|
22
|
+
export declare function setupOpenCode(mcpCommand?: McpCommand): Promise<boolean>;
|
|
18
23
|
export {};
|