@hubspot/local-dev-lib 0.4.2-experimental.0 → 0.5.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.
- package/config/defaultAccountOverride.d.ts +2 -0
- package/config/defaultAccountOverride.js +57 -0
- package/config/index.d.ts +26 -43
- package/config/index.js +275 -276
- package/config/migrate.d.ts +11 -16
- package/config/migrate.js +79 -159
- package/config/state.d.ts +3 -0
- package/config/state.js +88 -0
- package/config/utils.d.ts +74 -0
- package/config/utils.js +326 -0
- package/constants/config.d.ts +28 -0
- package/constants/config.js +29 -1
- package/constants/environments.d.ts +0 -11
- package/constants/environments.js +1 -12
- package/http/getAxiosConfig.js +7 -1
- package/http/index.js +23 -19
- package/lang/en.json +87 -62
- package/lib/cms/themes.js +3 -1
- package/lib/environment.d.ts +1 -1
- package/lib/gitignore.js +1 -1
- package/lib/oauth.d.ts +2 -2
- package/lib/oauth.js +8 -16
- package/lib/personalAccessKey.d.ts +2 -2
- package/lib/personalAccessKey.js +39 -30
- package/lib/portManager.d.ts +1 -0
- package/lib/portManager.js +6 -1
- package/lib/trackUsage.js +6 -3
- package/models/OAuth2Manager.d.ts +3 -4
- package/models/OAuth2Manager.js +20 -29
- package/package.json +4 -3
- package/types/Accounts.d.ts +20 -109
- package/types/Build.d.ts +1 -0
- package/types/Config.d.ts +14 -26
- package/config/CLIConfiguration.d.ts +0 -72
- package/config/CLIConfiguration.js +0 -548
- package/config/configFile.d.ts +0 -21
- package/config/configFile.js +0 -100
- package/config/configUtils.d.ts +0 -5
- package/config/configUtils.js +0 -87
- package/config/config_DEPRECATED.d.ts +0 -87
- package/config/config_DEPRECATED.js +0 -738
- package/config/environment.d.ts +0 -2
- package/config/environment.js +0 -60
- package/config/getAccountIdentifier.d.ts +0 -2
- package/config/getAccountIdentifier.js +0 -15
- package/utils/accounts.d.ts +0 -4
- package/utils/accounts.js +0 -28
package/config/migrate.js
CHANGED
|
@@ -1,184 +1,104 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
30
|
-
const
|
|
31
|
-
const CLIConfiguration_1 = require("./CLIConfiguration");
|
|
6
|
+
exports.mergeConfigAccounts = exports.mergeConfigProperties = exports.migrateConfigAtPath = exports.getConfigAtPath = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
32
8
|
const index_1 = require("./index");
|
|
33
|
-
const configFile_1 = require("./configFile");
|
|
34
9
|
const config_1 = require("../constants/config");
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
function getDeprecatedConfig(configPath) {
|
|
40
|
-
return config_DEPRECATED.loadConfig(configPath);
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
|
+
function getConfigAtPath(path) {
|
|
12
|
+
const configFileSource = (0, utils_1.readConfigFile)(path);
|
|
13
|
+
return (0, utils_1.parseConfig)(configFileSource);
|
|
41
14
|
}
|
|
42
|
-
exports.
|
|
43
|
-
function
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
exports.getGlobalConfig = getGlobalConfig;
|
|
50
|
-
function configFileExists(useHiddenConfig = false, configPath) {
|
|
51
|
-
return useHiddenConfig
|
|
52
|
-
? (0, configFile_1.configFileExists)()
|
|
53
|
-
: Boolean(config_DEPRECATED.getConfigPath(configPath));
|
|
54
|
-
}
|
|
55
|
-
exports.configFileExists = configFileExists;
|
|
56
|
-
function getConfigPath(configPath, useHiddenConfig = false) {
|
|
57
|
-
if (useHiddenConfig) {
|
|
58
|
-
return (0, configFile_1.getConfigFilePath)();
|
|
59
|
-
}
|
|
60
|
-
return config_DEPRECATED.getConfigPath(configPath);
|
|
15
|
+
exports.getConfigAtPath = getConfigAtPath;
|
|
16
|
+
function migrateConfigAtPath(path) {
|
|
17
|
+
(0, index_1.createEmptyConfigFile)(true);
|
|
18
|
+
const configToMigrate = getConfigAtPath(path);
|
|
19
|
+
(0, utils_1.writeConfigFile)(configToMigrate, (0, utils_1.getGlobalConfigFilePath)());
|
|
20
|
+
fs_1.default.unlinkSync(path);
|
|
61
21
|
}
|
|
62
|
-
exports.
|
|
63
|
-
function
|
|
64
|
-
const updatedConfigJson = JSON.stringify(updatedConfig);
|
|
65
|
-
if (isMigrating) {
|
|
66
|
-
(0, index_1.createEmptyConfigFile)({}, true);
|
|
67
|
-
}
|
|
68
|
-
(0, index_1.loadConfig)('');
|
|
69
|
-
try {
|
|
70
|
-
(0, index_1.writeConfig)({ source: updatedConfigJson });
|
|
71
|
-
const oldConfigPath = config_DEPRECATED.getConfigPath();
|
|
72
|
-
if (oldConfigPath) {
|
|
73
|
-
const dir = path_1.default.dirname(oldConfigPath);
|
|
74
|
-
const newConfigPath = path_1.default.join(dir, config_1.ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME);
|
|
75
|
-
fs_1.default.renameSync(oldConfigPath, newConfigPath);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
catch (error) {
|
|
79
|
-
(0, index_1.deleteEmptyConfigFile)();
|
|
80
|
-
throw new Error((0, lang_1.i18n)(`${i18nKey}.errors.writeConfig`, { configPath: config_1.GLOBAL_CONFIG_PATH }), { cause: error });
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function migrateConfig(deprecatedConfig) {
|
|
84
|
-
if (!deprecatedConfig) {
|
|
85
|
-
throw new Error((0, lang_1.i18n)(`${i18nKey}.errors.noDeprecatedConfig`));
|
|
86
|
-
}
|
|
87
|
-
const { defaultPortal, portals, ...rest } = deprecatedConfig;
|
|
88
|
-
const updatedConfig = {
|
|
89
|
-
...rest,
|
|
90
|
-
defaultAccount: defaultPortal,
|
|
91
|
-
accounts: portals
|
|
92
|
-
.filter(({ portalId }) => portalId !== undefined)
|
|
93
|
-
.map(({ portalId, ...rest }) => ({
|
|
94
|
-
...rest,
|
|
95
|
-
accountId: portalId,
|
|
96
|
-
})),
|
|
97
|
-
};
|
|
98
|
-
writeGlobalConfigFile(updatedConfig, true);
|
|
99
|
-
}
|
|
100
|
-
exports.migrateConfig = migrateConfig;
|
|
101
|
-
function mergeConfigProperties(globalConfig, deprecatedConfig, force) {
|
|
102
|
-
const propertiesToCheck = [
|
|
103
|
-
config_1.DEFAULT_CMS_PUBLISH_MODE,
|
|
104
|
-
config_1.HTTP_TIMEOUT,
|
|
105
|
-
config_1.ENV,
|
|
106
|
-
config_1.HTTP_USE_LOCALHOST,
|
|
107
|
-
config_1.ALLOW_USAGE_TRACKING,
|
|
108
|
-
];
|
|
22
|
+
exports.migrateConfigAtPath = migrateConfigAtPath;
|
|
23
|
+
function mergeConfigProperties(toConfig, fromConfig, force) {
|
|
109
24
|
const conflicts = [];
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
25
|
+
if (force) {
|
|
26
|
+
toConfig.defaultCmsPublishMode = fromConfig.defaultCmsPublishMode;
|
|
27
|
+
toConfig.httpTimeout = fromConfig.httpTimeout;
|
|
28
|
+
toConfig.env = fromConfig.env;
|
|
29
|
+
toConfig.httpUseLocalhost = fromConfig.httpUseLocalhost;
|
|
30
|
+
toConfig.allowUsageTracking = fromConfig.allowUsageTracking;
|
|
31
|
+
toConfig.autoOpenBrowser = fromConfig.autoOpenBrowser;
|
|
32
|
+
toConfig.allowAutoUpdates = fromConfig.allowAutoUpdates;
|
|
33
|
+
toConfig.defaultAccount = fromConfig.defaultAccount;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
toConfig.defaultCmsPublishMode ||= fromConfig.defaultCmsPublishMode;
|
|
37
|
+
toConfig.httpTimeout ||= fromConfig.httpTimeout;
|
|
38
|
+
toConfig.env ||= fromConfig.env;
|
|
39
|
+
toConfig.httpUseLocalhost =
|
|
40
|
+
toConfig.httpUseLocalhost === undefined
|
|
41
|
+
? fromConfig.httpUseLocalhost
|
|
42
|
+
: toConfig.httpUseLocalhost;
|
|
43
|
+
toConfig.allowUsageTracking =
|
|
44
|
+
toConfig.allowUsageTracking === undefined
|
|
45
|
+
? fromConfig.allowUsageTracking
|
|
46
|
+
: toConfig.allowUsageTracking;
|
|
47
|
+
toConfig.autoOpenBrowser =
|
|
48
|
+
toConfig.autoOpenBrowser === undefined
|
|
49
|
+
? fromConfig.autoOpenBrowser
|
|
50
|
+
: toConfig.autoOpenBrowser;
|
|
51
|
+
toConfig.allowAutoUpdates =
|
|
52
|
+
toConfig.allowAutoUpdates === undefined
|
|
53
|
+
? fromConfig.allowAutoUpdates
|
|
54
|
+
: toConfig.allowAutoUpdates;
|
|
55
|
+
toConfig.defaultAccount ||= fromConfig.defaultAccount;
|
|
56
|
+
const propertiesToCheck = [
|
|
57
|
+
config_1.DEFAULT_CMS_PUBLISH_MODE,
|
|
58
|
+
config_1.HTTP_TIMEOUT,
|
|
59
|
+
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
|
+
config_1.DEFAULT_ACCOUNT,
|
|
65
|
+
];
|
|
66
|
+
propertiesToCheck.forEach(prop => {
|
|
67
|
+
if (toConfig[prop] !== undefined && toConfig[prop] !== fromConfig[prop]) {
|
|
119
68
|
conflicts.push({
|
|
120
69
|
property: prop,
|
|
121
|
-
oldValue:
|
|
122
|
-
newValue:
|
|
70
|
+
oldValue: fromConfig[prop],
|
|
71
|
+
newValue: toConfig[prop],
|
|
123
72
|
});
|
|
124
73
|
}
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
if (globalConfig.flags || deprecatedConfig.flags) {
|
|
128
|
-
globalConfig.flags = Array.from(new Set([
|
|
129
|
-
...(globalConfig.flags || []),
|
|
130
|
-
...(deprecatedConfig.flags || []),
|
|
131
|
-
]));
|
|
132
|
-
}
|
|
133
|
-
if (config_1.DEFAULT_ACCOUNT in globalConfig &&
|
|
134
|
-
config_1.DEFAULT_PORTAL in deprecatedConfig &&
|
|
135
|
-
globalConfig.defaultAccount !== deprecatedConfig.defaultPortal) {
|
|
136
|
-
if (force) {
|
|
137
|
-
globalConfig.defaultAccount = deprecatedConfig.defaultPortal;
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
conflicts.push({
|
|
141
|
-
property: config_1.DEFAULT_ACCOUNT,
|
|
142
|
-
oldValue: deprecatedConfig.defaultPortal,
|
|
143
|
-
newValue: globalConfig.defaultAccount,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
74
|
+
});
|
|
146
75
|
}
|
|
147
|
-
|
|
148
|
-
|
|
76
|
+
// Merge flags
|
|
77
|
+
if (toConfig.flags || fromConfig.flags) {
|
|
78
|
+
toConfig.flags = Array.from(new Set([...(toConfig.flags || []), ...(fromConfig.flags || [])]));
|
|
149
79
|
}
|
|
150
|
-
return {
|
|
80
|
+
return { configWithMergedProperties: toConfig, conflicts };
|
|
151
81
|
}
|
|
152
82
|
exports.mergeConfigProperties = mergeConfigProperties;
|
|
153
|
-
function
|
|
154
|
-
|
|
83
|
+
function buildConfigWithMergedAccounts(toConfig, fromConfig) {
|
|
84
|
+
const existingAccountIds = toConfig.accounts.map(({ accountId }) => accountId);
|
|
155
85
|
const skippedAccountIds = [];
|
|
156
|
-
|
|
157
|
-
existingAccountIds
|
|
158
|
-
|
|
159
|
-
.filter(portal => {
|
|
160
|
-
const isExisting = existingAccountIds.includes(portal.portalId);
|
|
161
|
-
if (isExisting) {
|
|
162
|
-
skippedAccountIds.push(portal.portalId);
|
|
163
|
-
}
|
|
164
|
-
return !isExisting;
|
|
165
|
-
})
|
|
166
|
-
.map(({ portalId, ...rest }) => ({
|
|
167
|
-
...rest,
|
|
168
|
-
accountId: portalId,
|
|
169
|
-
}));
|
|
170
|
-
if (newAccounts.length > 0) {
|
|
171
|
-
globalConfig.accounts.push(...newAccounts);
|
|
86
|
+
fromConfig.accounts.forEach(account => {
|
|
87
|
+
if (existingAccountIds.includes(account.accountId)) {
|
|
88
|
+
skippedAccountIds.push(account.accountId);
|
|
172
89
|
}
|
|
173
|
-
|
|
90
|
+
else {
|
|
91
|
+
toConfig.accounts.push(account);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
174
94
|
return {
|
|
175
|
-
|
|
95
|
+
configWithMergedAccounts: toConfig,
|
|
176
96
|
skippedAccountIds,
|
|
177
97
|
};
|
|
178
98
|
}
|
|
179
|
-
function
|
|
180
|
-
const {
|
|
181
|
-
|
|
182
|
-
return {
|
|
99
|
+
function mergeConfigAccounts(toConfig, fromConfig) {
|
|
100
|
+
const { configWithMergedAccounts, skippedAccountIds } = buildConfigWithMergedAccounts(toConfig, fromConfig);
|
|
101
|
+
(0, utils_1.writeConfigFile)(configWithMergedAccounts, (0, utils_1.getGlobalConfigFilePath)());
|
|
102
|
+
return { configWithMergedAccounts, skippedAccountIds };
|
|
183
103
|
}
|
|
184
|
-
exports.
|
|
104
|
+
exports.mergeConfigAccounts = mergeConfigAccounts;
|
package/config/state.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.setStateValue = exports.getStateValue = void 0;
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const lang_1 = require("../utils/lang");
|
|
30
|
+
const config_1 = require("../constants/config");
|
|
31
|
+
const logger_1 = require("../lib/logger");
|
|
32
|
+
const i18nKey = 'config.state';
|
|
33
|
+
const DEFAULT_STATE = {
|
|
34
|
+
mcpTotalToolCalls: 0,
|
|
35
|
+
};
|
|
36
|
+
function ensureCLIDirectory() {
|
|
37
|
+
try {
|
|
38
|
+
const dir = path.dirname(config_1.STATE_FILE_PATH);
|
|
39
|
+
if (!fs.existsSync(dir)) {
|
|
40
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
throw new Error((0, lang_1.i18n)(`${i18nKey}.ensureCLIDirectory.errors.cannotCreateDirectory`, {
|
|
45
|
+
error: error instanceof Error ? error.message : String(error),
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function getCurrentState() {
|
|
50
|
+
try {
|
|
51
|
+
if (fs.existsSync(config_1.STATE_FILE_PATH)) {
|
|
52
|
+
const data = fs.readFileSync(config_1.STATE_FILE_PATH, 'utf-8');
|
|
53
|
+
return JSON.parse(data);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
throw new Error((0, lang_1.i18n)(`${i18nKey}.getCurrentState.errors.errorReading`, {
|
|
58
|
+
error: error instanceof Error ? error.message : String(error),
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
return DEFAULT_STATE;
|
|
62
|
+
}
|
|
63
|
+
function getStateValue(key) {
|
|
64
|
+
ensureCLIDirectory();
|
|
65
|
+
const state = getCurrentState();
|
|
66
|
+
return state[key];
|
|
67
|
+
}
|
|
68
|
+
exports.getStateValue = getStateValue;
|
|
69
|
+
function setStateValue(key, value) {
|
|
70
|
+
ensureCLIDirectory();
|
|
71
|
+
let currentState = DEFAULT_STATE;
|
|
72
|
+
try {
|
|
73
|
+
currentState = getCurrentState();
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
logger_1.logger.debug(error);
|
|
77
|
+
}
|
|
78
|
+
const newState = { ...currentState, [key]: value };
|
|
79
|
+
try {
|
|
80
|
+
fs.writeFileSync(config_1.STATE_FILE_PATH, JSON.stringify(newState, null, 2), 'utf-8');
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
throw new Error((0, lang_1.i18n)(`${i18nKey}.setStateValue.errors.failedToWrite`, {
|
|
84
|
+
error: error instanceof Error ? error.message : String(error),
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.setStateValue = setStateValue;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ACCOUNT_IDENTIFIERS } from '../constants/config';
|
|
2
|
+
import { HubSpotConfig, DeprecatedHubSpotConfigFields } from '../types/Config';
|
|
3
|
+
import { HubSpotConfigAccount, AccountType, TokenInfo } from '../types/Accounts';
|
|
4
|
+
import { ValueOf } from '../types/Utils';
|
|
5
|
+
export declare function getGlobalConfigFilePath(): string;
|
|
6
|
+
export declare function getLocalConfigFilePath(): string | null;
|
|
7
|
+
export declare function getLocalConfigDefaultFilePath(): string;
|
|
8
|
+
export declare function getConfigPathEnvironmentVariables(): {
|
|
9
|
+
useEnvironmentConfig: boolean;
|
|
10
|
+
configFilePathFromEnvironment: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare function readConfigFile(configPath: string): string;
|
|
13
|
+
export declare function removeUndefinedFieldsFromConfigAccount<T extends HubSpotConfigAccount | Partial<HubSpotConfigAccount> = HubSpotConfigAccount>(account: T): T;
|
|
14
|
+
export declare function formatConfigForWrite(config: HubSpotConfig): {
|
|
15
|
+
accounts: ({
|
|
16
|
+
personalAccessKey: string;
|
|
17
|
+
auth: {
|
|
18
|
+
tokenInfo: TokenInfo;
|
|
19
|
+
};
|
|
20
|
+
accountType?: AccountType | undefined;
|
|
21
|
+
defaultCmsPublishMode?: import("../types/Files").CmsPublishMode | undefined;
|
|
22
|
+
parentAccountId?: number | undefined;
|
|
23
|
+
name: string;
|
|
24
|
+
accountId: number;
|
|
25
|
+
env: import("../types/Config").Environment;
|
|
26
|
+
authType: "apikey" | "oauth2" | "personalaccesskey";
|
|
27
|
+
} | {
|
|
28
|
+
auth: {
|
|
29
|
+
clientId: string;
|
|
30
|
+
clientSecret: string;
|
|
31
|
+
scopes: string[];
|
|
32
|
+
tokenInfo: TokenInfo;
|
|
33
|
+
};
|
|
34
|
+
accountType?: AccountType | undefined;
|
|
35
|
+
defaultCmsPublishMode?: import("../types/Files").CmsPublishMode | undefined;
|
|
36
|
+
parentAccountId?: number | undefined;
|
|
37
|
+
name: string;
|
|
38
|
+
accountId: number;
|
|
39
|
+
env: import("../types/Config").Environment;
|
|
40
|
+
authType: "apikey" | "oauth2" | "personalaccesskey";
|
|
41
|
+
} | {
|
|
42
|
+
apiKey: string;
|
|
43
|
+
accountType?: AccountType | undefined;
|
|
44
|
+
defaultCmsPublishMode?: import("../types/Files").CmsPublishMode | undefined;
|
|
45
|
+
parentAccountId?: number | undefined;
|
|
46
|
+
name: string;
|
|
47
|
+
accountId: number;
|
|
48
|
+
env: import("../types/Config").Environment;
|
|
49
|
+
authType: "apikey" | "oauth2" | "personalaccesskey";
|
|
50
|
+
})[];
|
|
51
|
+
allowAutoUpdates?: boolean | undefined;
|
|
52
|
+
defaultMode?: import("../types/Files").CmsPublishMode | undefined;
|
|
53
|
+
env?: import("../types/Config").Environment | undefined;
|
|
54
|
+
httpUseLocalhost?: boolean | undefined;
|
|
55
|
+
autoOpenBrowser?: boolean | undefined;
|
|
56
|
+
useCustomObjectHubfile?: boolean | undefined;
|
|
57
|
+
flags?: string[] | undefined;
|
|
58
|
+
defaultCmsPublishMode: import("../types/Files").CmsPublishMode | undefined;
|
|
59
|
+
httpTimeout: number | undefined;
|
|
60
|
+
allowUsageTracking: boolean | undefined;
|
|
61
|
+
defaultAccount?: number | undefined;
|
|
62
|
+
};
|
|
63
|
+
export declare function writeConfigFile(config: HubSpotConfig, configPath: string): void;
|
|
64
|
+
export declare function normalizeParsedConfig(parsedConfig: HubSpotConfig & DeprecatedHubSpotConfigFields): HubSpotConfig;
|
|
65
|
+
export declare function parseConfig(configSource: string): HubSpotConfig;
|
|
66
|
+
export declare function buildConfigFromEnvironment(): HubSpotConfig;
|
|
67
|
+
export declare function getAccountIdentifierAndType(accountIdentifier: string | number): {
|
|
68
|
+
identifier: string | number;
|
|
69
|
+
identifierType: ValueOf<typeof ACCOUNT_IDENTIFIERS>;
|
|
70
|
+
};
|
|
71
|
+
export declare function getConfigAccountByIdentifier(accounts: Array<HubSpotConfigAccount>, identifierFieldName: ValueOf<typeof ACCOUNT_IDENTIFIERS>, identifier: string | number): HubSpotConfigAccount | undefined;
|
|
72
|
+
export declare function getConfigAccountByInferredIdentifier(accounts: Array<HubSpotConfigAccount>, accountIdentifier: string | number): HubSpotConfigAccount | undefined;
|
|
73
|
+
export declare function getConfigAccountIndexById(accounts: Array<HubSpotConfigAccount>, id: number): number;
|
|
74
|
+
export declare function isConfigAccountValid(account: Partial<HubSpotConfigAccount>): boolean;
|