@hubspot/local-dev-lib 3.15.0 → 3.16.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.
|
@@ -81,7 +81,7 @@ export declare function loadConfigFromEnvironment({ useEnv, }?: {
|
|
|
81
81
|
}): {
|
|
82
82
|
portals: Array<CLIAccount_DEPRECATED>;
|
|
83
83
|
} | undefined;
|
|
84
|
-
export declare function isConfigFlagEnabled(flag: keyof CLIConfig_DEPRECATED): boolean;
|
|
84
|
+
export declare function isConfigFlagEnabled(flag: keyof CLIConfig_DEPRECATED, defaultValue?: boolean): boolean;
|
|
85
85
|
export declare function hasLocalStateFlag(flag: string): boolean;
|
|
86
86
|
export declare function addLocalStateFlag(flag: string): void;
|
|
87
87
|
export declare function removeLocalStateFlag(flag: string): void;
|
|
@@ -698,12 +698,12 @@ function loadEnvironmentVariableConfig(options) {
|
|
|
698
698
|
logger_1.logger.debug(`Loaded config from environment variables for account ${portalId}`);
|
|
699
699
|
return setConfig(handleLegacyCmsPublishMode(envConfig));
|
|
700
700
|
}
|
|
701
|
-
function isConfigFlagEnabled(flag) {
|
|
701
|
+
function isConfigFlagEnabled(flag, defaultValue = false) {
|
|
702
702
|
if (!configFileExists() || configFileIsBlank()) {
|
|
703
|
-
return
|
|
703
|
+
return defaultValue;
|
|
704
704
|
}
|
|
705
705
|
const config = getAndLoadConfigIfNeeded();
|
|
706
|
-
return Boolean(config[flag] ||
|
|
706
|
+
return Boolean(config[flag] || defaultValue);
|
|
707
707
|
}
|
|
708
708
|
exports.isConfigFlagEnabled = isConfigFlagEnabled;
|
|
709
709
|
function handleLegacyCmsPublishMode(config) {
|
package/config/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare function updateAllowAutoUpdates(enabled: boolean): void;
|
|
|
28
28
|
export declare function updateAllowUsageTracking(isEnabled: boolean): void;
|
|
29
29
|
export declare function updateAutoOpenBrowser(isEnabled: boolean): void;
|
|
30
30
|
export declare function deleteConfigFile(): void;
|
|
31
|
-
export declare function isConfigFlagEnabled(flag: keyof CLIConfig): boolean;
|
|
31
|
+
export declare function isConfigFlagEnabled(flag: keyof CLIConfig, defaultValue?: boolean): boolean;
|
|
32
32
|
export declare function isTrackingAllowed(): boolean;
|
|
33
33
|
export declare function getEnv(nameOrId?: string | number): import("../types/Config").Environment;
|
|
34
34
|
export declare function getAccountType(accountType?: AccountType, sandboxAccountType?: string | null): AccountType;
|
package/config/index.js
CHANGED
|
@@ -220,11 +220,11 @@ function deleteConfigFile() {
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
exports.deleteConfigFile = deleteConfigFile;
|
|
223
|
-
function isConfigFlagEnabled(flag) {
|
|
223
|
+
function isConfigFlagEnabled(flag, defaultValue = false) {
|
|
224
224
|
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
225
|
-
return CLIConfiguration_1.CLIConfiguration.isConfigFlagEnabled(flag);
|
|
225
|
+
return CLIConfiguration_1.CLIConfiguration.isConfigFlagEnabled(flag, defaultValue);
|
|
226
226
|
}
|
|
227
|
-
return config_DEPRECATED.isConfigFlagEnabled(flag);
|
|
227
|
+
return config_DEPRECATED.isConfigFlagEnabled(flag, defaultValue);
|
|
228
228
|
}
|
|
229
229
|
exports.isConfigFlagEnabled = isConfigFlagEnabled;
|
|
230
230
|
function isTrackingAllowed() {
|