configcat-common
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -56,3 +56,3 @@ import { IConfigCatKernel } from "./index"; | ||
getAllValuesAsync(user?: User): Promise<SettingKeyValue[]>; | ||
private getSettings; | ||
private getSettingsAsync; | ||
} | ||
@@ -59,0 +59,0 @@ export declare class SettingKeyValue { |
@@ -58,2 +58,3 @@ "use strict"; | ||
var FlagOverrides_1 = require("./FlagOverrides"); | ||
var Utils_1 = require("./Utils"); | ||
var ConfigCatClient = /** @class */ (function () { | ||
@@ -104,3 +105,3 @@ function ConfigCatClient(options, configCatKernel) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -151,3 +152,3 @@ settings = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -177,3 +178,3 @@ settings = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -233,3 +234,3 @@ settings = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -287,3 +288,3 @@ settings = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -310,6 +311,6 @@ settings = _a.sent(); | ||
}; | ||
ConfigCatClient.prototype.getSettings = function () { | ||
ConfigCatClient.prototype.getSettingsAsync = function () { | ||
var _this = this; | ||
return new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () { | ||
var localSettings, config_1, remoteSettings, config; | ||
var localSettings, remoteConfig, remoteSettings, config; | ||
var _a, _b, _c, _d; | ||
@@ -329,4 +330,4 @@ return __generator(this, function (_e) { | ||
case 2: | ||
config_1 = _e.sent(); | ||
remoteSettings = (_c = config_1 === null || config_1 === void 0 ? void 0 : config_1.getSettings()) !== null && _c !== void 0 ? _c : {}; | ||
remoteConfig = _e.sent(); | ||
remoteSettings = (0, Utils_1.getSettingsFromConfig)((_c = remoteConfig === null || remoteConfig === void 0 ? void 0 : remoteConfig.ConfigJSON) !== null && _c !== void 0 ? _c : {}); | ||
if (this.options.flagOverrides.behaviour == FlagOverrides_1.OverrideBehaviour.LocalOverRemote) { | ||
@@ -348,3 +349,3 @@ resolve(__assign(__assign({}, remoteSettings), localSettings)); | ||
} | ||
resolve(config.getSettings()); | ||
resolve((0, Utils_1.getSettingsFromConfig)(config.ConfigJSON)); | ||
return [2 /*return*/]; | ||
@@ -351,0 +352,0 @@ } |
@@ -65,2 +65,3 @@ "use strict"; | ||
if (!(forceUpdateCache && lastProjectConfig && lastProjectConfig.ConfigJSON)) return [3 /*break*/, 4]; | ||
lastProjectConfig.Timestamp = new Date().getTime(); | ||
return [4 /*yield*/, this.baseConfig.cache.set(this.baseConfig.getCacheKey(), lastProjectConfig)]; | ||
@@ -88,7 +89,7 @@ case 3: | ||
} | ||
var newConfig = new ProjectConfig_1.ProjectConfig(new Date().getTime(), result.responseBody, result.eTag); | ||
if (!newConfig || !newConfig.ConfigJSON) { | ||
if (!result.responseBody) { | ||
callback(null); | ||
return; | ||
} | ||
var newConfig = new ProjectConfig_1.ProjectConfig(new Date().getTime(), result.responseBody, result.eTag); | ||
var preferences = newConfig.ConfigJSON[ProjectConfig_1.ConfigFile.Preferences]; | ||
@@ -95,0 +96,0 @@ if (!preferences) { |
@@ -15,5 +15,2 @@ export declare class ProjectConfig { | ||
private static ensureStrictEtag; | ||
getSettings(): { | ||
[name: string]: Setting; | ||
}; | ||
} | ||
@@ -20,0 +17,0 @@ export declare class ConfigFile { |
@@ -30,8 +30,2 @@ "use strict"; | ||
}; | ||
ProjectConfig.prototype.getSettings = function () { | ||
return Object.fromEntries(Object.entries(this.ConfigJSON[ConfigFile.FeatureFlags]).map(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
return [key, Setting.fromJson(value)]; | ||
})); | ||
}; | ||
return ProjectConfig; | ||
@@ -38,0 +32,0 @@ }()); |
@@ -0,2 +1,6 @@ | ||
import { Setting } from "./ProjectConfig"; | ||
export declare const isUndefined: (comp: any) => boolean; | ||
export declare function getSettingsFromConfig(json: any): { | ||
[name: string]: Setting; | ||
}; | ||
//# sourceMappingURL=Utils.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isUndefined = void 0; | ||
exports.getSettingsFromConfig = exports.isUndefined = void 0; | ||
var ProjectConfig_1 = require("./ProjectConfig"); | ||
var isUndefined = function (comp) { return comp === undefined; }; | ||
exports.isUndefined = isUndefined; | ||
function getSettingsFromConfig(json) { | ||
return Object.fromEntries(Object.entries(json[ProjectConfig_1.ConfigFile.FeatureFlags]).map(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
return [key, ProjectConfig_1.Setting.fromJson(value)]; | ||
})); | ||
} | ||
exports.getSettingsFromConfig = getSettingsFromConfig; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "5.0.0"; | ||
exports.default = "5.0.1"; |
@@ -56,3 +56,3 @@ import { IConfigCatKernel } from "./index"; | ||
getAllValuesAsync(user?: User): Promise<SettingKeyValue[]>; | ||
private getSettings; | ||
private getSettingsAsync; | ||
} | ||
@@ -59,0 +59,0 @@ export declare class SettingKeyValue { |
@@ -58,2 +58,3 @@ "use strict"; | ||
var FlagOverrides_1 = require("./FlagOverrides"); | ||
var Utils_1 = require("./Utils"); | ||
var ConfigCatClient = /** @class */ (function () { | ||
@@ -104,3 +105,3 @@ function ConfigCatClient(options, configCatKernel) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -151,3 +152,3 @@ settings = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -177,3 +178,3 @@ settings = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -233,3 +234,3 @@ settings = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -287,3 +288,3 @@ settings = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -310,6 +311,6 @@ settings = _a.sent(); | ||
}; | ||
ConfigCatClient.prototype.getSettings = function () { | ||
ConfigCatClient.prototype.getSettingsAsync = function () { | ||
var _this = this; | ||
return new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () { | ||
var localSettings, config_1, remoteSettings, config; | ||
var localSettings, remoteConfig, remoteSettings, config; | ||
var _a, _b, _c, _d; | ||
@@ -329,4 +330,4 @@ return __generator(this, function (_e) { | ||
case 2: | ||
config_1 = _e.sent(); | ||
remoteSettings = (_c = config_1 === null || config_1 === void 0 ? void 0 : config_1.getSettings()) !== null && _c !== void 0 ? _c : {}; | ||
remoteConfig = _e.sent(); | ||
remoteSettings = (0, Utils_1.getSettingsFromConfig)((_c = remoteConfig === null || remoteConfig === void 0 ? void 0 : remoteConfig.ConfigJSON) !== null && _c !== void 0 ? _c : {}); | ||
if (this.options.flagOverrides.behaviour == FlagOverrides_1.OverrideBehaviour.LocalOverRemote) { | ||
@@ -348,3 +349,3 @@ resolve(__assign(__assign({}, remoteSettings), localSettings)); | ||
} | ||
resolve(config.getSettings()); | ||
resolve((0, Utils_1.getSettingsFromConfig)(config.ConfigJSON)); | ||
return [2 /*return*/]; | ||
@@ -351,0 +352,0 @@ } |
@@ -65,2 +65,3 @@ "use strict"; | ||
if (!(forceUpdateCache && lastProjectConfig && lastProjectConfig.ConfigJSON)) return [3 /*break*/, 4]; | ||
lastProjectConfig.Timestamp = new Date().getTime(); | ||
return [4 /*yield*/, this.baseConfig.cache.set(this.baseConfig.getCacheKey(), lastProjectConfig)]; | ||
@@ -88,7 +89,7 @@ case 3: | ||
} | ||
var newConfig = new ProjectConfig_1.ProjectConfig(new Date().getTime(), result.responseBody, result.eTag); | ||
if (!newConfig || !newConfig.ConfigJSON) { | ||
if (!result.responseBody) { | ||
callback(null); | ||
return; | ||
} | ||
var newConfig = new ProjectConfig_1.ProjectConfig(new Date().getTime(), result.responseBody, result.eTag); | ||
var preferences = newConfig.ConfigJSON[ProjectConfig_1.ConfigFile.Preferences]; | ||
@@ -95,0 +96,0 @@ if (!preferences) { |
@@ -56,3 +56,3 @@ import { IConfigCatKernel } from "./index"; | ||
getAllValuesAsync(user?: User): Promise<SettingKeyValue[]>; | ||
private getSettings; | ||
private getSettingsAsync; | ||
} | ||
@@ -59,0 +59,0 @@ export declare class SettingKeyValue { |
@@ -55,2 +55,3 @@ var __assign = (this && this.__assign) || function () { | ||
import { OverrideBehaviour } from "./FlagOverrides"; | ||
import { getSettingsFromConfig } from "./Utils"; | ||
var ConfigCatClient = /** @class */ (function () { | ||
@@ -101,3 +102,3 @@ function ConfigCatClient(options, configCatKernel) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -148,3 +149,3 @@ settings = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -174,3 +175,3 @@ settings = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -230,3 +231,3 @@ settings = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -284,3 +285,3 @@ settings = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getSettings()]; | ||
case 0: return [4 /*yield*/, this.getSettingsAsync()]; | ||
case 1: | ||
@@ -307,6 +308,6 @@ settings = _a.sent(); | ||
}; | ||
ConfigCatClient.prototype.getSettings = function () { | ||
ConfigCatClient.prototype.getSettingsAsync = function () { | ||
var _this = this; | ||
return new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () { | ||
var localSettings, config_1, remoteSettings, config; | ||
var localSettings, remoteConfig, remoteSettings, config; | ||
var _a, _b, _c, _d; | ||
@@ -326,4 +327,4 @@ return __generator(this, function (_e) { | ||
case 2: | ||
config_1 = _e.sent(); | ||
remoteSettings = (_c = config_1 === null || config_1 === void 0 ? void 0 : config_1.getSettings()) !== null && _c !== void 0 ? _c : {}; | ||
remoteConfig = _e.sent(); | ||
remoteSettings = getSettingsFromConfig((_c = remoteConfig === null || remoteConfig === void 0 ? void 0 : remoteConfig.ConfigJSON) !== null && _c !== void 0 ? _c : {}); | ||
if (this.options.flagOverrides.behaviour == OverrideBehaviour.LocalOverRemote) { | ||
@@ -345,3 +346,3 @@ resolve(__assign(__assign({}, remoteSettings), localSettings)); | ||
} | ||
resolve(config.getSettings()); | ||
resolve(getSettingsFromConfig(config.ConfigJSON)); | ||
return [2 /*return*/]; | ||
@@ -348,0 +349,0 @@ } |
@@ -62,2 +62,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
if (!(forceUpdateCache && lastProjectConfig && lastProjectConfig.ConfigJSON)) return [3 /*break*/, 4]; | ||
lastProjectConfig.Timestamp = new Date().getTime(); | ||
return [4 /*yield*/, this.baseConfig.cache.set(this.baseConfig.getCacheKey(), lastProjectConfig)]; | ||
@@ -85,7 +86,7 @@ case 3: | ||
} | ||
var newConfig = new ProjectConfig(new Date().getTime(), result.responseBody, result.eTag); | ||
if (!newConfig || !newConfig.ConfigJSON) { | ||
if (!result.responseBody) { | ||
callback(null); | ||
return; | ||
} | ||
var newConfig = new ProjectConfig(new Date().getTime(), result.responseBody, result.eTag); | ||
var preferences = newConfig.ConfigJSON[ConfigFile.Preferences]; | ||
@@ -92,0 +93,0 @@ if (!preferences) { |
@@ -15,5 +15,2 @@ export declare class ProjectConfig { | ||
private static ensureStrictEtag; | ||
getSettings(): { | ||
[name: string]: Setting; | ||
}; | ||
} | ||
@@ -20,0 +17,0 @@ export declare class ConfigFile { |
@@ -27,8 +27,2 @@ var ProjectConfig = /** @class */ (function () { | ||
}; | ||
ProjectConfig.prototype.getSettings = function () { | ||
return Object.fromEntries(Object.entries(this.ConfigJSON[ConfigFile.FeatureFlags]).map(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
return [key, Setting.fromJson(value)]; | ||
})); | ||
}; | ||
return ProjectConfig; | ||
@@ -35,0 +29,0 @@ }()); |
@@ -0,2 +1,6 @@ | ||
import { Setting } from "./ProjectConfig"; | ||
export declare const isUndefined: (comp: any) => boolean; | ||
export declare function getSettingsFromConfig(json: any): { | ||
[name: string]: Setting; | ||
}; | ||
//# sourceMappingURL=Utils.d.ts.map |
@@ -0,1 +1,8 @@ | ||
import { ConfigFile, Setting } from "./ProjectConfig"; | ||
export var isUndefined = function (comp) { return comp === undefined; }; | ||
export function getSettingsFromConfig(json) { | ||
return Object.fromEntries(Object.entries(json[ConfigFile.FeatureFlags]).map(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
return [key, Setting.fromJson(value)]; | ||
})); | ||
} |
@@ -1,1 +0,1 @@ | ||
export default "5.0.0"; | ||
export default "5.0.1"; |
@@ -15,5 +15,2 @@ export declare class ProjectConfig { | ||
private static ensureStrictEtag; | ||
getSettings(): { | ||
[name: string]: Setting; | ||
}; | ||
} | ||
@@ -20,0 +17,0 @@ export declare class ConfigFile { |
@@ -30,8 +30,2 @@ "use strict"; | ||
}; | ||
ProjectConfig.prototype.getSettings = function () { | ||
return Object.fromEntries(Object.entries(this.ConfigJSON[ConfigFile.FeatureFlags]).map(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
return [key, Setting.fromJson(value)]; | ||
})); | ||
}; | ||
return ProjectConfig; | ||
@@ -38,0 +32,0 @@ }()); |
@@ -0,2 +1,6 @@ | ||
import { Setting } from "./ProjectConfig"; | ||
export declare const isUndefined: (comp: any) => boolean; | ||
export declare function getSettingsFromConfig(json: any): { | ||
[name: string]: Setting; | ||
}; | ||
//# sourceMappingURL=Utils.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isUndefined = void 0; | ||
exports.getSettingsFromConfig = exports.isUndefined = void 0; | ||
var ProjectConfig_1 = require("./ProjectConfig"); | ||
var isUndefined = function (comp) { return comp === undefined; }; | ||
exports.isUndefined = isUndefined; | ||
function getSettingsFromConfig(json) { | ||
return Object.fromEntries(Object.entries(json[ProjectConfig_1.ConfigFile.FeatureFlags]).map(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
return [key, ProjectConfig_1.Setting.fromJson(value)]; | ||
})); | ||
} | ||
exports.getSettingsFromConfig = getSettingsFromConfig; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "5.0.0"; | ||
exports.default = "5.0.1"; |
{ | ||
"name": "configcat-common", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "ConfigCat is a configuration as a service that lets you manage your features and configurations without actually deploying new code.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
416706
8036