@hubspot/cli 7.7.19-experimental.0 → 7.7.19-experimental.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/mcp/setup.js +0 -1
- package/commands/mcp/start.d.ts +1 -4
- package/commands/mcp/start.js +3 -10
- package/commands/open.js +14 -12
- package/commands/project/dev/unifiedFlow.js +1 -1
- package/commands/testAccount/create.js +11 -24
- package/lang/en.d.ts +43 -5
- package/lang/en.js +43 -5
- package/lib/app/migrate.js +2 -6
- package/lib/buildAccount.d.ts +7 -1
- package/lib/buildAccount.js +54 -4
- package/lib/mcp/setup.js +3 -8
- package/lib/projects/create/v3.d.ts +3 -2
- package/lib/projects/create/v3.js +2 -2
- package/lib/projects/localDev/helpers.d.ts +1 -1
- package/lib/projects/localDev/helpers.js +2 -2
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +9 -10
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +86 -47
- package/lib/prompts/createModulePrompt.js +1 -2
- package/lib/prompts/projectAddPrompt.d.ts +2 -1
- package/lib/prompts/projectAddPrompt.js +2 -1
- package/lib/prompts/promptUtils.d.ts +2 -2
- package/lib/prompts/promptUtils.js +161 -35
- package/lib/prompts/selectProjectTemplatePrompt.d.ts +2 -1
- package/lib/prompts/selectProjectTemplatePrompt.js +2 -1
- package/lib/usageTracking.d.ts +5 -5
- package/lib/usageTracking.js +79 -74
- package/mcp-server/tools/project/CreateProjectTool.d.ts +2 -2
- package/mcp-server/tools/project/UploadProjectTools.js +1 -1
- package/mcp-server/utils/project.js +0 -3
- package/package.json +3 -3
- package/types/Prompts.d.ts +4 -2
package/lib/usageTracking.js
CHANGED
|
@@ -33,7 +33,7 @@ function getPlatform() {
|
|
|
33
33
|
return process.platform;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
function trackCommandUsage(command, meta = {}, accountId) {
|
|
36
|
+
async function trackCommandUsage(command, meta = {}, accountId) {
|
|
37
37
|
if (!(0, config_1.isTrackingAllowed)()) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
@@ -46,47 +46,88 @@ function trackCommandUsage(command, meta = {}, accountId) {
|
|
|
46
46
|
? accountConfig.authType
|
|
47
47
|
: auth_1.API_KEY_AUTH_METHOD.value;
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
setImmediate(async () => {
|
|
50
|
+
const usageTrackingEvent = {
|
|
51
|
+
action: 'cli-command',
|
|
52
|
+
os: getPlatform(),
|
|
53
|
+
...getNodeVersionData(),
|
|
54
|
+
version: package_json_1.version,
|
|
55
|
+
command,
|
|
56
|
+
authType,
|
|
57
|
+
...meta,
|
|
58
|
+
};
|
|
59
|
+
try {
|
|
60
|
+
await (0, trackUsage_1.trackUsage)('cli-interaction', EventClass.INTERACTION, usageTrackingEvent, accountId);
|
|
61
|
+
logger_1.logger.debug('Sent usage tracking command event: %o', usageTrackingEvent);
|
|
62
|
+
}
|
|
63
|
+
catch (e) {
|
|
64
|
+
(0, errorHandlers_1.debugError)(e);
|
|
65
|
+
}
|
|
55
66
|
});
|
|
56
67
|
}
|
|
57
|
-
function trackHelpUsage(command) {
|
|
68
|
+
async function trackHelpUsage(command) {
|
|
58
69
|
if (!(0, config_1.isTrackingAllowed)()) {
|
|
59
70
|
return;
|
|
60
71
|
}
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
try {
|
|
73
|
+
if (command) {
|
|
74
|
+
logger_1.logger.debug('Tracking help usage of "%s" sub-command', command);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
logger_1.logger.debug('Tracking help usage of main command');
|
|
78
|
+
}
|
|
79
|
+
await (0, trackUsage_1.trackUsage)('cli-interaction', EventClass.INTERACTION, {
|
|
80
|
+
action: 'cli-help',
|
|
81
|
+
os: getPlatform(),
|
|
82
|
+
...getNodeVersionData(),
|
|
83
|
+
version: package_json_1.version,
|
|
84
|
+
command,
|
|
85
|
+
});
|
|
63
86
|
}
|
|
64
|
-
|
|
65
|
-
|
|
87
|
+
catch (e) {
|
|
88
|
+
(0, errorHandlers_1.debugError)(e);
|
|
66
89
|
}
|
|
67
|
-
trackCliInteraction({
|
|
68
|
-
action: 'cli-help',
|
|
69
|
-
command,
|
|
70
|
-
});
|
|
71
90
|
}
|
|
72
|
-
function trackConvertFieldsUsage(command) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
91
|
+
async function trackConvertFieldsUsage(command) {
|
|
92
|
+
if (!(0, config_1.isTrackingAllowed)()) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
logger_1.logger.debug('Attempting to track usage of "%s" command', command);
|
|
97
|
+
await (0, trackUsage_1.trackUsage)('cli-interaction', EventClass.INTERACTION, {
|
|
98
|
+
action: 'cli-process-fields',
|
|
99
|
+
os: getPlatform(),
|
|
100
|
+
...getNodeVersionData(),
|
|
101
|
+
version: package_json_1.version,
|
|
102
|
+
command,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
catch (e) {
|
|
106
|
+
(0, errorHandlers_1.debugError)(e);
|
|
107
|
+
}
|
|
77
108
|
}
|
|
78
|
-
function trackAuthAction(command, authType, step, accountId) {
|
|
79
|
-
|
|
109
|
+
async function trackAuthAction(command, authType, step, accountId) {
|
|
110
|
+
if (!(0, config_1.isTrackingAllowed)()) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const usageTrackingEvent = {
|
|
80
114
|
action: 'cli-auth',
|
|
115
|
+
os: getPlatform(),
|
|
116
|
+
...getNodeVersionData(),
|
|
117
|
+
version: package_json_1.version,
|
|
81
118
|
command,
|
|
82
119
|
authType,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
120
|
+
step,
|
|
121
|
+
};
|
|
122
|
+
try {
|
|
123
|
+
await (0, trackUsage_1.trackUsage)('cli-interaction', EventClass.INTERACTION, usageTrackingEvent, accountId);
|
|
124
|
+
logger_1.logger.debug('Sent usage tracking command event: %o', usageTrackingEvent);
|
|
125
|
+
}
|
|
126
|
+
catch (e) {
|
|
127
|
+
(0, errorHandlers_1.debugError)(e);
|
|
128
|
+
}
|
|
88
129
|
}
|
|
89
|
-
function trackCommandMetadataUsage(command, meta = {}, accountId) {
|
|
130
|
+
async function trackCommandMetadataUsage(command, meta = {}, accountId) {
|
|
90
131
|
if (!(0, config_1.isTrackingAllowed)()) {
|
|
91
132
|
return;
|
|
92
133
|
}
|
|
@@ -99,21 +140,9 @@ function trackCommandMetadataUsage(command, meta = {}, accountId) {
|
|
|
99
140
|
? accountConfig.authType
|
|
100
141
|
: auth_1.API_KEY_AUTH_METHOD.value;
|
|
101
142
|
}
|
|
102
|
-
|
|
103
|
-
action: 'cli-command-metadata',
|
|
104
|
-
command,
|
|
105
|
-
authType,
|
|
106
|
-
accountId,
|
|
107
|
-
meta,
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
function trackCliInteraction({ action, accountId, command, authType, meta = {}, }) {
|
|
111
|
-
try {
|
|
112
|
-
if (!(0, config_1.isTrackingAllowed)()) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
143
|
+
setImmediate(async () => {
|
|
115
144
|
const usageTrackingEvent = {
|
|
116
|
-
action,
|
|
145
|
+
action: 'cli-command-metadata',
|
|
117
146
|
os: getPlatform(),
|
|
118
147
|
...getNodeVersionData(),
|
|
119
148
|
version: package_json_1.version,
|
|
@@ -121,36 +150,12 @@ function trackCliInteraction({ action, accountId, command, authType, meta = {},
|
|
|
121
150
|
authType,
|
|
122
151
|
...meta,
|
|
123
152
|
};
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
await (0, trackUsage_1.trackUsage)('cli-interaction', EventClass.INTERACTION, {
|
|
128
|
-
...usageTrackingEvent,
|
|
129
|
-
action: 'cli-mcp-server',
|
|
130
|
-
type: process.env.HUBSPOT_MCP_AI_AGENT,
|
|
131
|
-
}, accountId);
|
|
132
|
-
logger_1.logger.debug('Sent AI usage tracking command event: %o', {
|
|
133
|
-
...usageTrackingEvent,
|
|
134
|
-
action: 'cli-mcp-server',
|
|
135
|
-
type: process.env.HUBSPOT_MCP_AI_AGENT,
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
catch (error) {
|
|
139
|
-
(0, errorHandlers_1.debugError)(error);
|
|
140
|
-
}
|
|
141
|
-
});
|
|
153
|
+
try {
|
|
154
|
+
await (0, trackUsage_1.trackUsage)('cli-interaction', EventClass.INTERACTION, usageTrackingEvent, accountId);
|
|
155
|
+
logger_1.logger.debug('Sent usage tracking command event: %o', usageTrackingEvent);
|
|
142
156
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
catch (error) {
|
|
148
|
-
(0, errorHandlers_1.debugError)(error);
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
logger_1.logger.debug('Sent usage tracking command event: %o', usageTrackingEvent);
|
|
152
|
-
}
|
|
153
|
-
catch (e) {
|
|
154
|
-
(0, errorHandlers_1.debugError)(e);
|
|
155
|
-
}
|
|
157
|
+
catch (e) {
|
|
158
|
+
(0, errorHandlers_1.debugError)(e);
|
|
159
|
+
}
|
|
160
|
+
});
|
|
156
161
|
}
|
|
@@ -14,17 +14,17 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
14
14
|
absoluteCurrentWorkingDirectory: string;
|
|
15
15
|
destination: string;
|
|
16
16
|
auth?: "oauth" | "static" | undefined;
|
|
17
|
+
name?: string | undefined;
|
|
17
18
|
distribution?: "marketplace" | "private" | undefined;
|
|
18
19
|
features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
|
|
19
|
-
name?: string | undefined;
|
|
20
20
|
}, {
|
|
21
21
|
projectBase: "app" | "empty";
|
|
22
22
|
absoluteCurrentWorkingDirectory: string;
|
|
23
23
|
destination: string;
|
|
24
24
|
auth?: "oauth" | "static" | undefined;
|
|
25
|
+
name?: string | undefined;
|
|
25
26
|
distribution?: "marketplace" | "private" | undefined;
|
|
26
27
|
features?: ("card" | "settings" | "app-function" | "webhooks")[] | undefined;
|
|
27
|
-
name?: string | undefined;
|
|
28
28
|
}>;
|
|
29
29
|
export type CreateProjectInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
30
30
|
export declare class CreateProjectTool extends Tool<CreateProjectInputSchema> {
|
|
@@ -21,7 +21,7 @@ class UploadProjectTools extends types_1.Tool {
|
|
|
21
21
|
super(mcpServer);
|
|
22
22
|
}
|
|
23
23
|
async handler({ absoluteProjectPath, }) {
|
|
24
|
-
const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, `hs project upload --force-create
|
|
24
|
+
const { stdout, stderr } = await (0, project_1.runCommandInDir)(absoluteProjectPath, `hs project upload --force-create`);
|
|
25
25
|
return (0, content_1.formatTextContents)(stdout, stderr);
|
|
26
26
|
}
|
|
27
27
|
register() {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "7.7.19-experimental.
|
|
3
|
+
"version": "7.7.19-experimental.1",
|
|
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
|
"dependencies": {
|
|
8
|
-
"@hubspot/local-dev-lib": "3.
|
|
8
|
+
"@hubspot/local-dev-lib": "3.13.1",
|
|
9
9
|
"@hubspot/project-parsing-lib": "0.5.1",
|
|
10
10
|
"@hubspot/serverless-dev-runtime": "7.0.6",
|
|
11
11
|
"@hubspot/theme-preview-dev-server": "0.0.10",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"express": "4.21.2",
|
|
20
20
|
"findup-sync": "4.0.0",
|
|
21
21
|
"fs-extra": "8.1.0",
|
|
22
|
-
"inquirer": "
|
|
22
|
+
"inquirer": "12.7.0",
|
|
23
23
|
"js-yaml": "4.1.0",
|
|
24
24
|
"moment": "2.30.1",
|
|
25
25
|
"open": "7.4.2",
|
package/types/Prompts.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Separator } from '@inquirer/prompts';
|
|
1
2
|
export type GenericPromptResponse = {
|
|
2
3
|
[key: string]: any;
|
|
3
4
|
};
|
|
@@ -6,9 +7,10 @@ export type PromptChoices<T = any> = Array<string | {
|
|
|
6
7
|
name: string;
|
|
7
8
|
value?: T;
|
|
8
9
|
disabled?: string | boolean;
|
|
9
|
-
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
} | Separator>;
|
|
10
12
|
export type PromptWhen = boolean | (() => boolean);
|
|
11
|
-
type PromptOperand = string | number | boolean | string[] | boolean[] | null;
|
|
13
|
+
export type PromptOperand = string | number | boolean | string[] | boolean[] | null;
|
|
12
14
|
export type PromptConfig<T extends GenericPromptResponse> = {
|
|
13
15
|
name: keyof T;
|
|
14
16
|
type?: PromptType;
|