@hubspot/local-dev-lib 4.0.3 → 4.0.4-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.
- package/config/index.js +24 -21
- package/config/migrate.js +6 -6
- package/config/state.js +1 -1
- package/constants/config.d.ts +30 -1
- package/constants/config.js +31 -2
- package/package.json +1 -1
package/config/index.js
CHANGED
|
@@ -14,7 +14,6 @@ const lang_1 = require("../utils/lang");
|
|
|
14
14
|
const defaultAccountOverride_1 = require("./defaultAccountOverride");
|
|
15
15
|
const environment_1 = require("../lib/environment");
|
|
16
16
|
const HubSpotConfigError_1 = require("../models/HubSpotConfigError");
|
|
17
|
-
const config_2 = require("../constants/config");
|
|
18
17
|
const isDeepEqual_1 = require("../lib/isDeepEqual");
|
|
19
18
|
const path_1 = require("../lib/path");
|
|
20
19
|
const EMPTY_CONFIG = { accounts: [] };
|
|
@@ -53,7 +52,7 @@ function getConfigDefaultFilePath() {
|
|
|
53
52
|
}
|
|
54
53
|
const localConfigFilePath = getLocalConfigFilePathIfExists();
|
|
55
54
|
if (!localConfigFilePath) {
|
|
56
|
-
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.getDefaultConfigFilePath.error'),
|
|
55
|
+
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.getDefaultConfigFilePath.error'), config_1.HUBSPOT_CONFIG_ERROR_TYPES.CONFIG_NOT_FOUND, config_1.HUBSPOT_CONFIG_OPERATIONS.READ);
|
|
57
56
|
}
|
|
58
57
|
return localConfigFilePath;
|
|
59
58
|
}
|
|
@@ -77,7 +76,7 @@ function getConfig() {
|
|
|
77
76
|
catch (err) {
|
|
78
77
|
throw new HubSpotConfigError_1.HubSpotConfigError(pathToRead
|
|
79
78
|
? (0, lang_1.i18n)('config.getConfig.errorWithPath', { path: pathToRead })
|
|
80
|
-
: (0, lang_1.i18n)('config.getConfig.error'),
|
|
79
|
+
: (0, lang_1.i18n)('config.getConfig.error'), config_1.HUBSPOT_CONFIG_ERROR_TYPES.CONFIG_NOT_FOUND, config_1.HUBSPOT_CONFIG_OPERATIONS.READ, { cause: err });
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
exports.getConfig = getConfig;
|
|
@@ -149,7 +148,7 @@ function getConfigAccountById(accountId) {
|
|
|
149
148
|
const { accounts } = getConfig();
|
|
150
149
|
const account = (0, utils_1.getConfigAccountByIdentifier)(accounts, config_1.ACCOUNT_IDENTIFIERS.ACCOUNT_ID, accountId);
|
|
151
150
|
if (!account) {
|
|
152
|
-
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.getConfigAccountById.error', { accountId }),
|
|
151
|
+
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.getConfigAccountById.error', { accountId }), config_1.HUBSPOT_CONFIG_ERROR_TYPES.ACCOUNT_NOT_FOUND, config_1.HUBSPOT_CONFIG_OPERATIONS.READ);
|
|
153
152
|
}
|
|
154
153
|
return account;
|
|
155
154
|
}
|
|
@@ -158,7 +157,7 @@ function getConfigAccountByName(accountName) {
|
|
|
158
157
|
const { accounts } = getConfig();
|
|
159
158
|
const account = (0, utils_1.getConfigAccountByIdentifier)(accounts, config_1.ACCOUNT_IDENTIFIERS.NAME, accountName);
|
|
160
159
|
if (!account) {
|
|
161
|
-
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.getConfigAccountByName.error', { accountName }),
|
|
160
|
+
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.getConfigAccountByName.error', { accountName }), config_1.HUBSPOT_CONFIG_ERROR_TYPES.ACCOUNT_NOT_FOUND, config_1.HUBSPOT_CONFIG_OPERATIONS.READ);
|
|
162
161
|
}
|
|
163
162
|
return account;
|
|
164
163
|
}
|
|
@@ -178,13 +177,13 @@ function getConfigDefaultAccount() {
|
|
|
178
177
|
defaultAccountToUse = defaultAccountOverrideAccountId || defaultAccount;
|
|
179
178
|
}
|
|
180
179
|
if (!defaultAccountToUse) {
|
|
181
|
-
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.getConfigDefaultAccount.fieldMissingError'),
|
|
180
|
+
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.getConfigDefaultAccount.fieldMissingError'), config_1.HUBSPOT_CONFIG_ERROR_TYPES.NO_DEFAULT_ACCOUNT, config_1.HUBSPOT_CONFIG_OPERATIONS.READ);
|
|
182
181
|
}
|
|
183
182
|
const account = (0, utils_1.getConfigAccountByInferredIdentifier)(accounts, defaultAccountToUse);
|
|
184
183
|
if (!account) {
|
|
185
184
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.getConfigDefaultAccount.accountMissingError', {
|
|
186
185
|
defaultAccountToUse,
|
|
187
|
-
}),
|
|
186
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.ACCOUNT_NOT_FOUND, config_1.HUBSPOT_CONFIG_OPERATIONS.READ);
|
|
188
187
|
}
|
|
189
188
|
return account;
|
|
190
189
|
}
|
|
@@ -217,38 +216,42 @@ function getConfigAccountEnvironment(identifier) {
|
|
|
217
216
|
if (!account) {
|
|
218
217
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.getConfigAccountEnvironment.accountNotFound', {
|
|
219
218
|
identifier,
|
|
220
|
-
}),
|
|
219
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.ACCOUNT_NOT_FOUND, config_1.HUBSPOT_CONFIG_OPERATIONS.READ);
|
|
221
220
|
}
|
|
222
221
|
return (0, environment_1.getValidEnv)(account.env);
|
|
223
222
|
}
|
|
224
223
|
exports.getConfigAccountEnvironment = getConfigAccountEnvironment;
|
|
225
224
|
function addConfigAccount(accountToAdd) {
|
|
226
225
|
if (!(0, utils_1.validateConfigAccount)(accountToAdd)) {
|
|
227
|
-
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.addConfigAccount.invalidAccount'),
|
|
226
|
+
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.addConfigAccount.invalidAccount'), config_1.HUBSPOT_CONFIG_ERROR_TYPES.INVALID_ACCOUNT, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
228
227
|
}
|
|
229
228
|
const config = getConfig();
|
|
230
229
|
const accountInConfig = (0, utils_1.getConfigAccountByIdentifier)(config.accounts, config_1.ACCOUNT_IDENTIFIERS.ACCOUNT_ID, accountToAdd.accountId);
|
|
231
230
|
if (accountInConfig) {
|
|
232
231
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.addConfigAccount.duplicateAccount', {
|
|
233
232
|
accountId: accountToAdd.accountId,
|
|
234
|
-
}),
|
|
233
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.INVALID_ACCOUNT, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
235
234
|
}
|
|
236
235
|
config.accounts.push(accountToAdd);
|
|
237
236
|
(0, utils_1.writeConfigFile)(config, getConfigFilePath());
|
|
238
237
|
}
|
|
239
238
|
exports.addConfigAccount = addConfigAccount;
|
|
240
239
|
function updateConfigAccount(updatedAccount) {
|
|
240
|
+
// Skip updating the config file if we're using environment variables
|
|
241
|
+
if (process.env[config_1.ENVIRONMENT_VARIABLES.USE_ENVIRONMENT_HUBSPOT_CONFIG]) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
241
244
|
if (!(0, utils_1.validateConfigAccount)(updatedAccount)) {
|
|
242
245
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.updateConfigAccount.invalidAccount', {
|
|
243
246
|
name: updatedAccount.name,
|
|
244
|
-
}),
|
|
247
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.INVALID_ACCOUNT, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
245
248
|
}
|
|
246
249
|
const config = getConfig();
|
|
247
250
|
const accountIndex = (0, utils_1.getConfigAccountIndexById)(config.accounts, updatedAccount.accountId);
|
|
248
251
|
if (accountIndex < 0) {
|
|
249
252
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.updateConfigAccount.accountNotFound', {
|
|
250
253
|
accountId: updatedAccount.accountId,
|
|
251
|
-
}),
|
|
254
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.ACCOUNT_NOT_FOUND, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
252
255
|
}
|
|
253
256
|
config.accounts[accountIndex] = updatedAccount;
|
|
254
257
|
(0, utils_1.writeConfigFile)(config, getConfigFilePath());
|
|
@@ -260,7 +263,7 @@ function setConfigAccountAsDefault(identifier) {
|
|
|
260
263
|
if (!account) {
|
|
261
264
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.setConfigAccountAsDefault.accountNotFound', {
|
|
262
265
|
identifier,
|
|
263
|
-
}),
|
|
266
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.ACCOUNT_NOT_FOUND, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
264
267
|
}
|
|
265
268
|
config.defaultAccount = account.accountId;
|
|
266
269
|
(0, utils_1.writeConfigFile)(config, getConfigFilePath());
|
|
@@ -272,14 +275,14 @@ function renameConfigAccount(currentName, newName) {
|
|
|
272
275
|
if (!account) {
|
|
273
276
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.renameConfigAccount.accountNotFound', {
|
|
274
277
|
currentName,
|
|
275
|
-
}),
|
|
278
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.ACCOUNT_NOT_FOUND, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
276
279
|
}
|
|
277
280
|
const duplicateAccount = (0, utils_1.getConfigAccountByIdentifier)(config.accounts, config_1.ACCOUNT_IDENTIFIERS.NAME, newName);
|
|
278
281
|
if (duplicateAccount) {
|
|
279
282
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.renameConfigAccount.duplicateAccount', {
|
|
280
283
|
currentName,
|
|
281
284
|
newName,
|
|
282
|
-
}),
|
|
285
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.INVALID_ACCOUNT, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
283
286
|
}
|
|
284
287
|
account.name = newName;
|
|
285
288
|
(0, utils_1.writeConfigFile)(config, getConfigFilePath());
|
|
@@ -291,7 +294,7 @@ function removeAccountFromConfig(accountId) {
|
|
|
291
294
|
if (index < 0) {
|
|
292
295
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.removeAccountFromConfig.accountNotFound', {
|
|
293
296
|
accountId,
|
|
294
|
-
}),
|
|
297
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.ACCOUNT_NOT_FOUND, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
295
298
|
}
|
|
296
299
|
config.accounts.splice(index, 1);
|
|
297
300
|
if (config.defaultAccount === accountId) {
|
|
@@ -306,7 +309,7 @@ function updateHttpTimeout(timeout) {
|
|
|
306
309
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.updateHttpTimeout.invalidTimeout', {
|
|
307
310
|
minTimeout: config_1.MIN_HTTP_TIMEOUT,
|
|
308
311
|
timeout: parsedTimeout,
|
|
309
|
-
}),
|
|
312
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.INVALID_FIELD, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
310
313
|
}
|
|
311
314
|
const config = getConfig();
|
|
312
315
|
config.httpTimeout = parsedTimeout;
|
|
@@ -317,7 +320,7 @@ function updateAllowUsageTracking(isAllowed) {
|
|
|
317
320
|
if (typeof isAllowed !== 'boolean') {
|
|
318
321
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.updateAllowUsageTracking.invalidInput', {
|
|
319
322
|
isAllowed: `${isAllowed}`,
|
|
320
|
-
}),
|
|
323
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.INVALID_FIELD, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
321
324
|
}
|
|
322
325
|
const config = getConfig();
|
|
323
326
|
config.allowUsageTracking = isAllowed;
|
|
@@ -328,7 +331,7 @@ function updateAllowAutoUpdates(isEnabled) {
|
|
|
328
331
|
if (typeof isEnabled !== 'boolean') {
|
|
329
332
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.updateAllowAutoUpdates.invalidInput', {
|
|
330
333
|
isEnabled: `${isEnabled}`,
|
|
331
|
-
}),
|
|
334
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.INVALID_FIELD, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
332
335
|
}
|
|
333
336
|
const config = getConfig();
|
|
334
337
|
config.allowAutoUpdates = isEnabled;
|
|
@@ -339,7 +342,7 @@ function updateAutoOpenBrowser(isEnabled) {
|
|
|
339
342
|
if (typeof isEnabled !== 'boolean') {
|
|
340
343
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.updateAutoOpenBrowser.invalidInput', {
|
|
341
344
|
isEnabled: `${isEnabled}`,
|
|
342
|
-
}),
|
|
345
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.INVALID_FIELD, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
343
346
|
}
|
|
344
347
|
const config = getConfig();
|
|
345
348
|
config.autoOpenBrowser = isEnabled;
|
|
@@ -351,7 +354,7 @@ function updateDefaultCmsPublishMode(cmsPublishMode) {
|
|
|
351
354
|
!Object.values(files_1.CMS_PUBLISH_MODE).includes(cmsPublishMode)) {
|
|
352
355
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.updateDefaultCmsPublishMode.invalidCmsPublishMode', {
|
|
353
356
|
cmsPublishMode,
|
|
354
|
-
}),
|
|
357
|
+
}), config_1.HUBSPOT_CONFIG_ERROR_TYPES.INVALID_FIELD, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
355
358
|
}
|
|
356
359
|
const config = getConfig();
|
|
357
360
|
config.defaultCmsPublishMode = cmsPublishMode;
|
package/config/migrate.js
CHANGED
|
@@ -54,13 +54,13 @@ function mergeConfigProperties(toConfig, fromConfig, force) {
|
|
|
54
54
|
: toConfig.allowAutoUpdates;
|
|
55
55
|
toConfig.defaultAccount ||= fromConfig.defaultAccount;
|
|
56
56
|
const propertiesToCheck = [
|
|
57
|
-
config_1.DEFAULT_CMS_PUBLISH_MODE,
|
|
58
|
-
config_1.HTTP_TIMEOUT,
|
|
57
|
+
config_1.CONFIG_FLAGS.DEFAULT_CMS_PUBLISH_MODE,
|
|
58
|
+
config_1.CONFIG_FLAGS.HTTP_TIMEOUT,
|
|
59
|
+
config_1.CONFIG_FLAGS.HTTP_USE_LOCALHOST,
|
|
60
|
+
config_1.CONFIG_FLAGS.ALLOW_USAGE_TRACKING,
|
|
61
|
+
config_1.CONFIG_FLAGS.AUTO_OPEN_BROWSER,
|
|
62
|
+
config_1.CONFIG_FLAGS.ALLOW_AUTO_UPDATES,
|
|
59
63
|
config_1.ENV,
|
|
60
|
-
config_1.HTTP_USE_LOCALHOST,
|
|
61
|
-
config_1.ALLOW_USAGE_TRACKING,
|
|
62
|
-
config_1.AUTO_OPEN_BROWSER,
|
|
63
|
-
config_1.ALLOW_AUTO_UPDATES,
|
|
64
64
|
config_1.DEFAULT_ACCOUNT,
|
|
65
65
|
];
|
|
66
66
|
propertiesToCheck.forEach(prop => {
|
package/config/state.js
CHANGED
|
@@ -32,7 +32,7 @@ const logger_1 = require("../lib/logger");
|
|
|
32
32
|
const config_2 = require("../constants/config");
|
|
33
33
|
const i18nKey = 'config.state';
|
|
34
34
|
const DEFAULT_STATE = {
|
|
35
|
-
[config_2.
|
|
35
|
+
[config_2.STATE_FLAGS.MCP_TOTAL_TOOL_CALLS]: 0,
|
|
36
36
|
};
|
|
37
37
|
function ensureCLIDirectory() {
|
|
38
38
|
try {
|
package/constants/config.d.ts
CHANGED
|
@@ -8,16 +8,37 @@ export declare const STATE_FILE_PATH: string;
|
|
|
8
8
|
export declare const DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME = ".hsaccount";
|
|
9
9
|
export declare const DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID = "DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID";
|
|
10
10
|
export declare const DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND = "DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND";
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use CONFIG_FLAGS.DEFAULT_CMS_PUBLISH_MODE instead
|
|
13
|
+
*/
|
|
11
14
|
export declare const DEFAULT_CMS_PUBLISH_MODE = "defaultCmsPublishMode";
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use CONFIG_FLAGS.HTTP_TIMEOUT instead
|
|
17
|
+
*/
|
|
12
18
|
export declare const HTTP_TIMEOUT = "httpTimeout";
|
|
13
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use CONFIG_FLAGS.HTTP_USE_LOCALHOST instead
|
|
21
|
+
*/
|
|
14
22
|
export declare const HTTP_USE_LOCALHOST = "httpUseLocalhost";
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Use CONFIG_FLAGS.ALLOW_USAGE_TRACKING instead
|
|
25
|
+
*/
|
|
15
26
|
export declare const ALLOW_USAGE_TRACKING = "allowUsageTracking";
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Use CONFIG_FLAGS.AUTO_OPEN_BROWSER instead
|
|
29
|
+
*/
|
|
16
30
|
export declare const AUTO_OPEN_BROWSER = "autoOpenBrowser";
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use CONFIG_FLAGS.ALLOW_AUTO_UPDATES instead
|
|
33
|
+
*/
|
|
17
34
|
export declare const ALLOW_AUTO_UPDATES = "allowAutoUpdates";
|
|
35
|
+
export declare const ENV = "env";
|
|
18
36
|
export declare const DEFAULT_ACCOUNT = "defaultAccount";
|
|
19
37
|
export declare const DEFAULT_PORTAL = "defaultPortal";
|
|
20
38
|
export declare const MIN_HTTP_TIMEOUT = 3000;
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated Use STATE_FLAGS.MCP_TOTAL_TOOL_CALLS instead
|
|
41
|
+
*/
|
|
21
42
|
export declare const MCP_TOTAL_TOOL_CALLS_STATE = "mcpTotalToolCalls";
|
|
22
43
|
export declare const HUBSPOT_ACCOUNT_TYPES: {
|
|
23
44
|
readonly DEVELOPMENT_SANDBOX: "DEVELOPMENT_SANDBOX";
|
|
@@ -33,9 +54,17 @@ export declare const HUBSPOT_ACCOUNT_TYPE_STRINGS: {
|
|
|
33
54
|
readonly APP_DEVELOPER: string;
|
|
34
55
|
readonly STANDARD: string;
|
|
35
56
|
};
|
|
57
|
+
export declare const STATE_FLAGS: {
|
|
58
|
+
readonly MCP_TOTAL_TOOL_CALLS: "mcpTotalToolCalls";
|
|
59
|
+
};
|
|
36
60
|
export declare const CONFIG_FLAGS: {
|
|
61
|
+
readonly DEFAULT_CMS_PUBLISH_MODE: "defaultCmsPublishMode";
|
|
37
62
|
readonly USE_CUSTOM_OBJECT_HUBFILE: "useCustomObjectHubfile";
|
|
38
63
|
readonly HTTP_USE_LOCALHOST: "httpUseLocalhost";
|
|
64
|
+
readonly HTTP_TIMEOUT: "httpTimeout";
|
|
65
|
+
readonly ALLOW_AUTO_UPDATES: "allowAutoUpdates";
|
|
66
|
+
readonly ALLOW_USAGE_TRACKING: "allowUsageTracking";
|
|
67
|
+
readonly AUTO_OPEN_BROWSER: "autoOpenBrowser";
|
|
39
68
|
};
|
|
40
69
|
export declare const ENVIRONMENT_VARIABLES: {
|
|
41
70
|
readonly HUBSPOT_API_KEY: "HUBSPOT_API_KEY";
|
package/constants/config.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HUBSPOT_CONFIG_OPERATIONS = exports.HUBSPOT_CONFIG_ERROR_TYPES = exports.ACCOUNT_IDENTIFIERS = exports.ENVIRONMENT_VARIABLES = exports.CONFIG_FLAGS = exports.HUBSPOT_ACCOUNT_TYPE_STRINGS = exports.HUBSPOT_ACCOUNT_TYPES = exports.MCP_TOTAL_TOOL_CALLS_STATE = exports.MIN_HTTP_TIMEOUT = exports.DEFAULT_PORTAL = exports.DEFAULT_ACCOUNT = exports.
|
|
6
|
+
exports.HUBSPOT_CONFIG_OPERATIONS = exports.HUBSPOT_CONFIG_ERROR_TYPES = exports.ACCOUNT_IDENTIFIERS = exports.ENVIRONMENT_VARIABLES = exports.CONFIG_FLAGS = exports.STATE_FLAGS = exports.HUBSPOT_ACCOUNT_TYPE_STRINGS = exports.HUBSPOT_ACCOUNT_TYPES = exports.MCP_TOTAL_TOOL_CALLS_STATE = exports.MIN_HTTP_TIMEOUT = exports.DEFAULT_PORTAL = exports.DEFAULT_ACCOUNT = exports.ENV = exports.ALLOW_AUTO_UPDATES = exports.AUTO_OPEN_BROWSER = exports.ALLOW_USAGE_TRACKING = exports.HTTP_USE_LOCALHOST = exports.HTTP_TIMEOUT = exports.DEFAULT_CMS_PUBLISH_MODE = exports.DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND = exports.DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID = exports.DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME = exports.STATE_FILE_PATH = exports.GLOBAL_CONFIG_PATH = exports.HUBSPOT_STATE_FILE = exports.HUBSPOT_CONFIGURATION_FILE = exports.HUBSPOT_CONFIGURATION_FOLDER = exports.ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME = exports.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = void 0;
|
|
7
7
|
const lang_1 = require("../utils/lang");
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const os_1 = __importDefault(require("os"));
|
|
@@ -17,16 +17,37 @@ exports.STATE_FILE_PATH = path_1.default.join(os_1.default.homedir(), exports.HU
|
|
|
17
17
|
exports.DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME = '.hsaccount';
|
|
18
18
|
exports.DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID = 'DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID';
|
|
19
19
|
exports.DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND = 'DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND';
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use CONFIG_FLAGS.DEFAULT_CMS_PUBLISH_MODE instead
|
|
22
|
+
*/
|
|
20
23
|
exports.DEFAULT_CMS_PUBLISH_MODE = 'defaultCmsPublishMode';
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use CONFIG_FLAGS.HTTP_TIMEOUT instead
|
|
26
|
+
*/
|
|
21
27
|
exports.HTTP_TIMEOUT = 'httpTimeout';
|
|
22
|
-
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use CONFIG_FLAGS.HTTP_USE_LOCALHOST instead
|
|
30
|
+
*/
|
|
23
31
|
exports.HTTP_USE_LOCALHOST = 'httpUseLocalhost';
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use CONFIG_FLAGS.ALLOW_USAGE_TRACKING instead
|
|
34
|
+
*/
|
|
24
35
|
exports.ALLOW_USAGE_TRACKING = 'allowUsageTracking';
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Use CONFIG_FLAGS.AUTO_OPEN_BROWSER instead
|
|
38
|
+
*/
|
|
25
39
|
exports.AUTO_OPEN_BROWSER = 'autoOpenBrowser';
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated Use CONFIG_FLAGS.ALLOW_AUTO_UPDATES instead
|
|
42
|
+
*/
|
|
26
43
|
exports.ALLOW_AUTO_UPDATES = 'allowAutoUpdates';
|
|
44
|
+
exports.ENV = 'env';
|
|
27
45
|
exports.DEFAULT_ACCOUNT = 'defaultAccount';
|
|
28
46
|
exports.DEFAULT_PORTAL = 'defaultPortal';
|
|
29
47
|
exports.MIN_HTTP_TIMEOUT = 3000;
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated Use STATE_FLAGS.MCP_TOTAL_TOOL_CALLS instead
|
|
50
|
+
*/
|
|
30
51
|
exports.MCP_TOTAL_TOOL_CALLS_STATE = 'mcpTotalToolCalls';
|
|
31
52
|
exports.HUBSPOT_ACCOUNT_TYPES = {
|
|
32
53
|
DEVELOPMENT_SANDBOX: 'DEVELOPMENT_SANDBOX',
|
|
@@ -42,9 +63,17 @@ exports.HUBSPOT_ACCOUNT_TYPE_STRINGS = {
|
|
|
42
63
|
APP_DEVELOPER: (0, lang_1.i18n)('lib.accountTypes.appDeveloper'),
|
|
43
64
|
STANDARD: (0, lang_1.i18n)('lib.accountTypes.standard'),
|
|
44
65
|
};
|
|
66
|
+
exports.STATE_FLAGS = {
|
|
67
|
+
MCP_TOTAL_TOOL_CALLS: 'mcpTotalToolCalls',
|
|
68
|
+
};
|
|
45
69
|
exports.CONFIG_FLAGS = {
|
|
70
|
+
DEFAULT_CMS_PUBLISH_MODE: 'defaultCmsPublishMode',
|
|
46
71
|
USE_CUSTOM_OBJECT_HUBFILE: 'useCustomObjectHubfile',
|
|
47
72
|
HTTP_USE_LOCALHOST: 'httpUseLocalhost',
|
|
73
|
+
HTTP_TIMEOUT: 'httpTimeout',
|
|
74
|
+
ALLOW_AUTO_UPDATES: 'allowAutoUpdates',
|
|
75
|
+
ALLOW_USAGE_TRACKING: 'allowUsageTracking',
|
|
76
|
+
AUTO_OPEN_BROWSER: 'autoOpenBrowser',
|
|
48
77
|
};
|
|
49
78
|
exports.ENVIRONMENT_VARIABLES = {
|
|
50
79
|
HUBSPOT_API_KEY: 'HUBSPOT_API_KEY',
|
package/package.json
CHANGED