@hubspot/local-dev-lib 0.5.0-experimental.13 → 0.5.0-experimental.14
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 +3 -3
- package/config/utils.js +6 -1
- package/lang/en.json +1 -1
- package/package.json +1 -1
package/config/index.js
CHANGED
|
@@ -104,12 +104,12 @@ function validateConfig() {
|
|
|
104
104
|
}
|
|
105
105
|
if (account.name) {
|
|
106
106
|
if (accountNamesMap[account.name.toLowerCase()]) {
|
|
107
|
-
|
|
107
|
+
validationErrors.push((0, lang_1.i18n)('config.validateConfig.duplicateAccountNames', {
|
|
108
108
|
accountName: account.name,
|
|
109
109
|
}));
|
|
110
110
|
}
|
|
111
111
|
if (/\s+/.test(account.name)) {
|
|
112
|
-
|
|
112
|
+
validationErrors.push((0, lang_1.i18n)('config.validateConfig.invalidAccountName', {
|
|
113
113
|
accountName: account.name,
|
|
114
114
|
}));
|
|
115
115
|
}
|
|
@@ -259,7 +259,7 @@ function setConfigAccountAsDefault(identifier) {
|
|
|
259
259
|
const account = (0, utils_1.getConfigAccountByInferredIdentifier)(config.accounts, identifier);
|
|
260
260
|
if (!account) {
|
|
261
261
|
throw new HubSpotConfigError_1.HubSpotConfigError((0, lang_1.i18n)('config.setConfigAccountAsDefault.accountNotFound', {
|
|
262
|
-
|
|
262
|
+
identifier,
|
|
263
263
|
}), config_2.HUBSPOT_CONFIG_ERROR_TYPES.ACCOUNT_NOT_FOUND, config_1.HUBSPOT_CONFIG_OPERATIONS.WRITE);
|
|
264
264
|
}
|
|
265
265
|
config.defaultAccount = account.accountId;
|
package/config/utils.js
CHANGED
|
@@ -270,7 +270,12 @@ function getConfigAccountByIdentifier(accounts, identifierFieldName, identifier)
|
|
|
270
270
|
exports.getConfigAccountByIdentifier = getConfigAccountByIdentifier;
|
|
271
271
|
function getConfigAccountByInferredIdentifier(accounts, accountIdentifier) {
|
|
272
272
|
const { identifier, identifierType } = getAccountIdentifierAndType(accountIdentifier);
|
|
273
|
-
|
|
273
|
+
const account = getConfigAccountByIdentifier(accounts, identifierType, identifier);
|
|
274
|
+
if (account) {
|
|
275
|
+
return account;
|
|
276
|
+
}
|
|
277
|
+
// Fallback to handle accounts with numbers as names
|
|
278
|
+
return getConfigAccountByIdentifier(accounts, config_1.ACCOUNT_IDENTIFIERS.NAME, String(accountIdentifier));
|
|
274
279
|
}
|
|
275
280
|
exports.getConfigAccountByInferredIdentifier = getConfigAccountByInferredIdentifier;
|
|
276
281
|
function getConfigAccountIndexById(accounts, id) {
|
package/lang/en.json
CHANGED
|
@@ -276,7 +276,7 @@
|
|
|
276
276
|
"accountNotFound": "Attempting to update account with id {{ id }}, but that account was not found in config"
|
|
277
277
|
},
|
|
278
278
|
"setConfigAccountAsDefault": {
|
|
279
|
-
"accountNotFound": "Attempted to set account with
|
|
279
|
+
"accountNotFound": "Attempted to set account with identifier {{ identifier }} as default, but that account was not found in config"
|
|
280
280
|
},
|
|
281
281
|
"renameConfigAccount": {
|
|
282
282
|
"accountNotFound": "Attempted to rename account with name {{ currentName }}, but that account was not found in config",
|
package/package.json
CHANGED