@hubspot/local-dev-lib 2.1.1 → 2.1.2-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/LICENSE +12 -0
- package/README.md +17 -0
- package/config/CLIConfiguration.d.ts +4 -3
- package/config/CLIConfiguration.js +41 -16
- package/config/getAccountIdentifier.d.ts +2 -0
- package/config/getAccountIdentifier.js +15 -0
- package/config/index.d.ts +9 -7
- package/config/index.js +35 -11
- package/constants/config.d.ts +1 -1
- package/constants/config.js +1 -1
- package/lang/en.json +374 -374
- package/lib/oauth.js +1 -1
- package/lib/personalAccessKey.js +6 -3
- package/models/OAuth2Manager.js +1 -1
- package/package.json +8 -11
- package/utils/{getAccountIdentifier.d.ts → accounts.d.ts} +1 -2
- package/utils/{getAccountIdentifier.js → accounts.js} +1 -13
- package/lang/lang/en.json +0 -389
package/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright 2019 HubSpot, Inc.
|
|
2
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
you may not use this file except in compliance with the License.
|
|
4
|
+
You may obtain a copy of the License at
|
|
5
|
+
|
|
6
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
|
|
8
|
+
Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
See the License for the specific language governing permissions and
|
|
12
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# hubspot/local-dev-lib
|
|
2
|
+
|
|
3
|
+
Provides library functionality for HubSpot local development tooling, including the [HubSpot CLI](https://github.com/HubSpot/hubspot-cli).
|
|
4
|
+
|
|
5
|
+
**NOTE:** This library is intended to replace the deprecated [@hubspot/cli-lib](https://github.com/HubSpot/cli-lib) library.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This library contains utils that facilitate interactions with HubSpot. It is consumed by the [HubSpot CLI](https://github.com/HubSpot/hubspot-cli) as well as other HubSpot development tooling. Major exports include:
|
|
10
|
+
|
|
11
|
+
- Config utils for managing HubSpot account configuration and access keys ([docs](./config/README.md))
|
|
12
|
+
- API utils to interact with HubSpot assets such as Design Manager and Developer Projects ([docs](./api/README.md))
|
|
13
|
+
- Utils to navigate the local filesystem, parse common HubSpot files, interact with common HubSpot objects, and connect with GitHub ([docs](./lib/README.md))
|
|
14
|
+
|
|
15
|
+
## Contributing
|
|
16
|
+
|
|
17
|
+
For more information on developing, see the [Contributing Guide](CONTRIBUTING.md).
|
|
@@ -20,16 +20,17 @@ declare class _CLIConfiguration {
|
|
|
20
20
|
getAccountId(nameOrId?: string | number): number | null;
|
|
21
21
|
getDefaultAccount(): string | number | null;
|
|
22
22
|
getResolvedDefaultAccountForCWD(nameOrId: string | number): CLIAccount_NEW | null;
|
|
23
|
-
|
|
23
|
+
getAccountIndex(accountId: number): number;
|
|
24
24
|
getConfigForAccount(accountId?: number): CLIAccount_NEW | null;
|
|
25
|
+
getConfigAccounts(): Array<CLIAccount_NEW> | null;
|
|
25
26
|
isAccountInConfig(nameOrId: string | number): boolean;
|
|
26
27
|
getAndLoadConfigIfNeeded(options?: CLIOptions): CLIConfig_NEW;
|
|
27
28
|
getEnv(nameOrId?: string | number): Environment;
|
|
28
|
-
getAccountType(accountType?: AccountType, sandboxAccountType?: string | null): AccountType;
|
|
29
|
+
getAccountType(accountType?: AccountType | null, sandboxAccountType?: string | null): AccountType;
|
|
29
30
|
/**
|
|
30
31
|
* @throws {Error}
|
|
31
32
|
*/
|
|
32
|
-
|
|
33
|
+
addOrUpdateAccount(updatedAccountFields: Partial<FlatAccountFields_NEW>, writeUpdate?: boolean): FlatAccountFields_NEW | null;
|
|
33
34
|
/**
|
|
34
35
|
* @throws {Error}
|
|
35
36
|
*/
|
|
@@ -116,7 +116,7 @@ class _CLIConfiguration {
|
|
|
116
116
|
return false;
|
|
117
117
|
}
|
|
118
118
|
if (accountConfig.name) {
|
|
119
|
-
if (accountNamesMap[accountConfig.name]) {
|
|
119
|
+
if (accountNamesMap[accountConfig.name.toLowerCase()]) {
|
|
120
120
|
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.validate.duplicateAccountNames`, {
|
|
121
121
|
accountName: accountConfig.name,
|
|
122
122
|
}));
|
|
@@ -131,7 +131,7 @@ class _CLIConfiguration {
|
|
|
131
131
|
accountNamesMap[accountConfig.name] = true;
|
|
132
132
|
}
|
|
133
133
|
if (!accountConfig.accountType) {
|
|
134
|
-
this.
|
|
134
|
+
this.addOrUpdateAccount({
|
|
135
135
|
...accountConfig,
|
|
136
136
|
accountId: accountConfig.accountId,
|
|
137
137
|
accountType: this.getAccountType(undefined, accountConfig.sandboxAccountType),
|
|
@@ -194,19 +194,30 @@ class _CLIConfiguration {
|
|
|
194
194
|
getResolvedDefaultAccountForCWD(nameOrId) {
|
|
195
195
|
return this.getAccount(nameOrId);
|
|
196
196
|
}
|
|
197
|
-
|
|
197
|
+
getAccountIndex(accountId) {
|
|
198
198
|
return this.config
|
|
199
199
|
? this.config.accounts.findIndex(account => account.accountId === accountId)
|
|
200
200
|
: -1;
|
|
201
201
|
}
|
|
202
202
|
getConfigForAccount(accountId) {
|
|
203
203
|
if (this.config) {
|
|
204
|
-
this.config.accounts.find(account => account.accountId === accountId) ||
|
|
205
|
-
null;
|
|
204
|
+
return (this.config.accounts.find(account => account.accountId === accountId) ||
|
|
205
|
+
null);
|
|
206
|
+
}
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
getConfigAccounts() {
|
|
210
|
+
if (this.config) {
|
|
211
|
+
return this.config.accounts || null;
|
|
206
212
|
}
|
|
207
213
|
return null;
|
|
208
214
|
}
|
|
209
215
|
isAccountInConfig(nameOrId) {
|
|
216
|
+
if (typeof nameOrId === 'string') {
|
|
217
|
+
return (!!this.config &&
|
|
218
|
+
this.config.accounts &&
|
|
219
|
+
!!this.getAccountId(nameOrId.toLowerCase()));
|
|
220
|
+
}
|
|
210
221
|
return (!!this.config && this.config.accounts && !!this.getAccountId(nameOrId));
|
|
211
222
|
}
|
|
212
223
|
getAndLoadConfigIfNeeded(options) {
|
|
@@ -246,7 +257,7 @@ class _CLIConfiguration {
|
|
|
246
257
|
/**
|
|
247
258
|
* @throws {Error}
|
|
248
259
|
*/
|
|
249
|
-
|
|
260
|
+
addOrUpdateAccount(updatedAccountFields, writeUpdate = true) {
|
|
250
261
|
const { accountId, accountType, apiKey, authType, clientId, clientSecret, defaultMode, env, name, parentAccountId, personalAccessKey, sandboxAccountType, scopes, tokenInfo, } = updatedAccountFields;
|
|
251
262
|
if (!accountId) {
|
|
252
263
|
throw new Error((0, lang_1.i18n)(`${i18nKey}.updateAccount.errors.accountIdRequired`));
|
|
@@ -255,8 +266,11 @@ class _CLIConfiguration {
|
|
|
255
266
|
logger_1.logger.debug((0, lang_1.i18n)(`${i18nKey}.updateAccount.noConfigToUpdate`));
|
|
256
267
|
return null;
|
|
257
268
|
}
|
|
269
|
+
// Check whether the account is already listed in the config.yml file.
|
|
258
270
|
const currentAccountConfig = this.getAccount(accountId);
|
|
271
|
+
// For accounts that are already in the config.yml file, sets the auth property.
|
|
259
272
|
let auth = (currentAccountConfig && currentAccountConfig.auth) || {};
|
|
273
|
+
// For accounts not already in the config.yml file, sets the auth property.
|
|
260
274
|
if (clientId || clientSecret || scopes || tokenInfo) {
|
|
261
275
|
auth = {
|
|
262
276
|
...(currentAccountConfig ? currentAccountConfig.auth : {}),
|
|
@@ -279,6 +293,7 @@ class _CLIConfiguration {
|
|
|
279
293
|
}
|
|
280
294
|
const updatedEnv = (0, environment_2.getValidEnv)(env || (currentAccountConfig && currentAccountConfig.env));
|
|
281
295
|
const updatedDefaultMode = defaultMode && defaultMode.toLowerCase();
|
|
296
|
+
const updatedAccountType = accountType || (currentAccountConfig && currentAccountConfig.accountType);
|
|
282
297
|
safelyApplyUpdates('name', name);
|
|
283
298
|
safelyApplyUpdates('env', updatedEnv);
|
|
284
299
|
safelyApplyUpdates('accountId', accountId);
|
|
@@ -294,24 +309,29 @@ class _CLIConfiguration {
|
|
|
294
309
|
safelyApplyUpdates('personalAccessKey', personalAccessKey);
|
|
295
310
|
// Deprecating sandboxAccountType in favor of the more generic accountType
|
|
296
311
|
safelyApplyUpdates('sandboxAccountType', sandboxAccountType);
|
|
297
|
-
safelyApplyUpdates('accountType', this.getAccountType(
|
|
312
|
+
safelyApplyUpdates('accountType', this.getAccountType(updatedAccountType, sandboxAccountType));
|
|
298
313
|
safelyApplyUpdates('parentAccountId', parentAccountId);
|
|
299
314
|
const completedAccountConfig = nextAccountConfig;
|
|
315
|
+
if (!Object.hasOwn(this.config, 'accounts')) {
|
|
316
|
+
this.config.accounts = [];
|
|
317
|
+
}
|
|
300
318
|
if (currentAccountConfig) {
|
|
301
319
|
logger_1.logger.debug((0, lang_1.i18n)(`${i18nKey}.updateAccount.updating`, {
|
|
302
320
|
accountId,
|
|
303
321
|
}));
|
|
304
|
-
const index = this.
|
|
305
|
-
|
|
306
|
-
logger_1.logger.debug((0, lang_1.i18n)(`${i18nKey}.updateAccount.addingConfigEntry`, {
|
|
307
|
-
accountId,
|
|
308
|
-
}));
|
|
309
|
-
if (this.config.accounts) {
|
|
322
|
+
const index = this.getAccountIndex(accountId);
|
|
323
|
+
if (index < 0) {
|
|
310
324
|
this.config.accounts.push(completedAccountConfig);
|
|
311
325
|
}
|
|
312
326
|
else {
|
|
313
|
-
this.config.accounts =
|
|
327
|
+
this.config.accounts[index] = completedAccountConfig;
|
|
314
328
|
}
|
|
329
|
+
logger_1.logger.debug((0, lang_1.i18n)(`${i18nKey}.updateAccount.addingConfigEntry`, {
|
|
330
|
+
accountId,
|
|
331
|
+
}));
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
this.config.accounts.push(completedAccountConfig);
|
|
315
335
|
}
|
|
316
336
|
if (writeUpdate) {
|
|
317
337
|
this.write();
|
|
@@ -350,7 +370,12 @@ class _CLIConfiguration {
|
|
|
350
370
|
}));
|
|
351
371
|
}
|
|
352
372
|
if (accountId) {
|
|
353
|
-
this.
|
|
373
|
+
this.addOrUpdateAccount({
|
|
374
|
+
accountId,
|
|
375
|
+
name: newName,
|
|
376
|
+
env: this.getEnv(),
|
|
377
|
+
accountType: accountConfigToRename.accountType,
|
|
378
|
+
});
|
|
354
379
|
}
|
|
355
380
|
if (accountConfigToRename.name === this.getDefaultAccount()) {
|
|
356
381
|
this.updateDefaultAccount(newName);
|
|
@@ -374,7 +399,7 @@ class _CLIConfiguration {
|
|
|
374
399
|
const accountConfig = this.getAccount(accountId);
|
|
375
400
|
if (accountConfig) {
|
|
376
401
|
logger_1.logger.debug((0, lang_1.i18n)(`${i18nKey}.removeAccountFromConfig.deleting`, { accountId }));
|
|
377
|
-
const index = this.
|
|
402
|
+
const index = this.getAccountIndex(accountId);
|
|
378
403
|
this.config.accounts.splice(index, 1);
|
|
379
404
|
if (this.getDefaultAccount() === accountConfig.name) {
|
|
380
405
|
removedAccountIsDefault = true;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAccountIdentifier = void 0;
|
|
4
|
+
function getAccountIdentifier(account) {
|
|
5
|
+
if (!account) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
else if (Object.hasOwn(account, 'portalId')) {
|
|
9
|
+
return account.portalId;
|
|
10
|
+
}
|
|
11
|
+
else if (Object.hasOwn(account, 'accountId')) {
|
|
12
|
+
return account.accountId;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.getAccountIdentifier = getAccountIdentifier;
|
package/config/index.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import * as config_DEPRECATED from './config_DEPRECATED';
|
|
2
|
-
import { CLIConfig } from '../types/Config';
|
|
2
|
+
import { CLIConfig_NEW, CLIConfig } from '../types/Config';
|
|
3
3
|
import { CLIOptions, WriteConfigOptions } from '../types/CLIOptions';
|
|
4
|
-
import { AccountType, CLIAccount, FlatAccountFields } from '../types/Accounts';
|
|
4
|
+
import { AccountType, CLIAccount, CLIAccount_NEW, CLIAccount_DEPRECATED, FlatAccountFields } from '../types/Accounts';
|
|
5
|
+
import { Mode } from '../types/Files';
|
|
5
6
|
export declare function loadConfig(path: string, options?: CLIOptions): CLIConfig | null;
|
|
6
7
|
export declare function getAndLoadConfigIfNeeded(options?: CLIOptions): Partial<CLIConfig> | null;
|
|
7
8
|
export declare function validateConfig(): boolean;
|
|
8
9
|
export declare function loadConfigFromEnvironment(): boolean;
|
|
9
10
|
export declare function createEmptyConfigFile(options?: {
|
|
10
11
|
path?: string;
|
|
11
|
-
},
|
|
12
|
+
}, useHiddenConfig?: boolean): void;
|
|
12
13
|
export declare function deleteEmptyConfigFile(): void;
|
|
13
14
|
export declare function getConfig(): CLIConfig | null;
|
|
14
15
|
export declare function writeConfig(options?: WriteConfigOptions): void;
|
|
15
|
-
export declare function getConfigPath(path?: string): string | null;
|
|
16
|
+
export declare function getConfigPath(path?: string, useHiddenConfig?: boolean): string | null;
|
|
17
|
+
export declare function configFileExists(useHiddenConfig?: boolean): boolean;
|
|
16
18
|
export declare function getAccountConfig(accountId?: number): CLIAccount | null;
|
|
17
19
|
export declare function accountNameExistsInConfig(name: string): boolean;
|
|
18
20
|
export declare function updateAccountConfig(configOptions: Partial<FlatAccountFields>): FlatAccountFields | null;
|
|
@@ -28,12 +30,12 @@ export declare function isConfigFlagEnabled(flag: keyof CLIConfig): boolean;
|
|
|
28
30
|
export declare function isTrackingAllowed(): boolean;
|
|
29
31
|
export declare function getEnv(nameOrId?: string | number): import("../types/Config").Environment;
|
|
30
32
|
export declare function getAccountType(accountType?: AccountType, sandboxAccountType?: string | null): AccountType;
|
|
31
|
-
export declare
|
|
32
|
-
export declare
|
|
33
|
+
export declare function getConfigDefaultAccount(): string | number | null | undefined;
|
|
34
|
+
export declare function getConfigAccounts(): Array<CLIAccount_NEW> | Array<CLIAccount_DEPRECATED> | null | undefined;
|
|
35
|
+
export declare function updateDefaultMode(mode: Mode): void | CLIConfig_NEW | null;
|
|
33
36
|
export declare const getConfigAccountId: typeof config_DEPRECATED.getConfigAccountId;
|
|
34
37
|
export declare const getOrderedAccount: typeof config_DEPRECATED.getOrderedAccount;
|
|
35
38
|
export declare const getOrderedConfig: typeof config_DEPRECATED.getOrderedConfig;
|
|
36
39
|
export declare const setConfig: typeof config_DEPRECATED.setConfig;
|
|
37
40
|
export declare const setConfigPath: typeof config_DEPRECATED.setConfigPath;
|
|
38
41
|
export declare const findConfig: typeof config_DEPRECATED.findConfig;
|
|
39
|
-
export declare const updateDefaultMode: typeof config_DEPRECATED.updateDefaultMode;
|
package/config/index.js
CHANGED
|
@@ -23,11 +23,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.findConfig = exports.setConfigPath = exports.setConfig = exports.getOrderedConfig = exports.getOrderedAccount = exports.getConfigAccountId = exports.updateDefaultMode = exports.getConfigAccounts = exports.getConfigDefaultAccount = exports.getAccountType = exports.getEnv = exports.isTrackingAllowed = exports.isConfigFlagEnabled = exports.deleteConfigFile = exports.updateAllowUsageTracking = exports.updateHttpTimeout = exports.deleteAccount = exports.removeSandboxAccountFromConfig = exports.getAccountId = exports.renameAccount = exports.updateDefaultAccount = exports.updateAccountConfig = exports.accountNameExistsInConfig = exports.getAccountConfig = exports.configFileExists = exports.getConfigPath = exports.writeConfig = exports.getConfig = exports.deleteEmptyConfigFile = exports.createEmptyConfigFile = exports.loadConfigFromEnvironment = exports.validateConfig = exports.getAndLoadConfigIfNeeded = exports.loadConfig = void 0;
|
|
27
27
|
const config_DEPRECATED = __importStar(require("./config_DEPRECATED"));
|
|
28
28
|
const CLIConfiguration_1 = require("./CLIConfiguration");
|
|
29
29
|
const configFile_1 = require("./configFile");
|
|
30
|
-
const getAccountIdentifier_1 = require("
|
|
30
|
+
const getAccountIdentifier_1 = require("./getAccountIdentifier");
|
|
31
31
|
// Use new config if it exists
|
|
32
32
|
function loadConfig(path, options = {}) {
|
|
33
33
|
// Attempt to load the root config
|
|
@@ -58,8 +58,8 @@ function loadConfigFromEnvironment() {
|
|
|
58
58
|
return Boolean(config_DEPRECATED.loadConfigFromEnvironment());
|
|
59
59
|
}
|
|
60
60
|
exports.loadConfigFromEnvironment = loadConfigFromEnvironment;
|
|
61
|
-
function createEmptyConfigFile(options = {},
|
|
62
|
-
if (
|
|
61
|
+
function createEmptyConfigFile(options = {}, useHiddenConfig = false) {
|
|
62
|
+
if (useHiddenConfig) {
|
|
63
63
|
CLIConfiguration_1.CLIConfiguration.write({ accounts: [] });
|
|
64
64
|
}
|
|
65
65
|
else {
|
|
@@ -93,13 +93,19 @@ function writeConfig(options = {}) {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
exports.writeConfig = writeConfig;
|
|
96
|
-
function getConfigPath(path) {
|
|
97
|
-
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
96
|
+
function getConfigPath(path, useHiddenConfig = false) {
|
|
97
|
+
if (useHiddenConfig || CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
98
98
|
return (0, configFile_1.getConfigFilePath)();
|
|
99
99
|
}
|
|
100
100
|
return config_DEPRECATED.getConfigPath(path);
|
|
101
101
|
}
|
|
102
102
|
exports.getConfigPath = getConfigPath;
|
|
103
|
+
function configFileExists(useHiddenConfig) {
|
|
104
|
+
return useHiddenConfig
|
|
105
|
+
? (0, configFile_1.configFileExists)()
|
|
106
|
+
: Boolean(config_DEPRECATED.getConfigPath());
|
|
107
|
+
}
|
|
108
|
+
exports.configFileExists = configFileExists;
|
|
103
109
|
function getAccountConfig(accountId) {
|
|
104
110
|
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
105
111
|
return CLIConfiguration_1.CLIConfiguration.getConfigForAccount(accountId);
|
|
@@ -117,7 +123,7 @@ exports.accountNameExistsInConfig = accountNameExistsInConfig;
|
|
|
117
123
|
function updateAccountConfig(configOptions) {
|
|
118
124
|
const accountIdentifier = (0, getAccountIdentifier_1.getAccountIdentifier)(configOptions);
|
|
119
125
|
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
120
|
-
return CLIConfiguration_1.CLIConfiguration.
|
|
126
|
+
return CLIConfiguration_1.CLIConfiguration.addOrUpdateAccount({
|
|
121
127
|
...configOptions,
|
|
122
128
|
accountId: accountIdentifier,
|
|
123
129
|
});
|
|
@@ -224,13 +230,31 @@ function getAccountType(accountType, sandboxAccountType) {
|
|
|
224
230
|
return config_DEPRECATED.getAccountType(accountType, sandboxAccountType);
|
|
225
231
|
}
|
|
226
232
|
exports.getAccountType = getAccountType;
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
233
|
+
function getConfigDefaultAccount() {
|
|
234
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
235
|
+
return CLIConfiguration_1.CLIConfiguration.getDefaultAccount();
|
|
236
|
+
}
|
|
237
|
+
return config_DEPRECATED.getConfigDefaultAccount();
|
|
238
|
+
}
|
|
239
|
+
exports.getConfigDefaultAccount = getConfigDefaultAccount;
|
|
240
|
+
function getConfigAccounts() {
|
|
241
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
242
|
+
return CLIConfiguration_1.CLIConfiguration.getConfigAccounts();
|
|
243
|
+
}
|
|
244
|
+
return config_DEPRECATED.getConfigAccounts();
|
|
245
|
+
}
|
|
246
|
+
exports.getConfigAccounts = getConfigAccounts;
|
|
247
|
+
function updateDefaultMode(mode) {
|
|
248
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
249
|
+
return CLIConfiguration_1.CLIConfiguration.updateDefaultMode(mode);
|
|
250
|
+
}
|
|
251
|
+
return config_DEPRECATED.updateDefaultMode(mode);
|
|
252
|
+
}
|
|
253
|
+
exports.updateDefaultMode = updateDefaultMode;
|
|
254
|
+
// These functions are not supported with the new config setup
|
|
230
255
|
exports.getConfigAccountId = config_DEPRECATED.getConfigAccountId;
|
|
231
256
|
exports.getOrderedAccount = config_DEPRECATED.getOrderedAccount;
|
|
232
257
|
exports.getOrderedConfig = config_DEPRECATED.getOrderedConfig;
|
|
233
258
|
exports.setConfig = config_DEPRECATED.setConfig;
|
|
234
259
|
exports.setConfigPath = config_DEPRECATED.setConfigPath;
|
|
235
260
|
exports.findConfig = config_DEPRECATED.findConfig;
|
|
236
|
-
exports.updateDefaultMode = config_DEPRECATED.updateDefaultMode;
|
package/constants/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = "hubspot.config.yml";
|
|
2
|
-
export declare const HUBSPOT_CONFIGURATION_FOLDER = ".hubspot";
|
|
2
|
+
export declare const HUBSPOT_CONFIGURATION_FOLDER = ".hubspot-cli";
|
|
3
3
|
export declare const HUBSPOT_CONFIGURATION_FILE = "config.yml";
|
|
4
4
|
export declare const MIN_HTTP_TIMEOUT = 3000;
|
|
5
5
|
export declare const HUBSPOT_ACCOUNT_TYPES: {
|
package/constants/config.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.HUBSPOT_ACCOUNT_TYPE_STRINGS = exports.HUBSPOT_ACCOUNT_TYPES = exports.MIN_HTTP_TIMEOUT = exports.HUBSPOT_CONFIGURATION_FILE = exports.HUBSPOT_CONFIGURATION_FOLDER = exports.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = void 0;
|
|
4
4
|
const lang_1 = require("../utils/lang");
|
|
5
5
|
exports.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = 'hubspot.config.yml';
|
|
6
|
-
exports.HUBSPOT_CONFIGURATION_FOLDER = '.hubspot';
|
|
6
|
+
exports.HUBSPOT_CONFIGURATION_FOLDER = '.hubspot-cli';
|
|
7
7
|
exports.HUBSPOT_CONFIGURATION_FILE = 'config.yml';
|
|
8
8
|
exports.MIN_HTTP_TIMEOUT = 3000;
|
|
9
9
|
exports.HUBSPOT_ACCOUNT_TYPES = {
|