Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!projectId) {
throw ERROR_FACTORY.create("registration-project-id" /* REGISTRATION_PROJECT_ID */);
}
if (!apiKey) {
throw ERROR_FACTORY.create("registration-api-key" /* REGISTRATION_API_KEY */);
}
if (!appId) {
throw ERROR_FACTORY.create("registration-app-id" /* REGISTRATION_APP_ID */);
}
namespace = namespace || 'firebase';
var storage = new Storage(appId, app.name, namespace);
var storageCache = new StorageCache(storage);
var logger$1 = new logger.Logger(name);
// Sets ERROR as the default log level.
// See RemoteConfig#setLogLevel for corresponding normalization to ERROR log level.
logger$1.logLevel = logger.LogLevel.ERROR;
var restClient = new RestClient(installations,
// Uses the JS SDK version, by which the RC package version can be deduced, if necessary.
firebaseInstance.SDK_VERSION, namespace, projectId, apiKey, appId);
var retryingClient = new RetryingClient(restClient, storage);
var cachingClient = new CachingClient(retryingClient, storage, storageCache, logger$1);
var remoteConfigInstance = new RemoteConfig(app, cachingClient, storageCache, storage, logger$1);
// Starts warming cache.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
remoteConfigInstance.ensureInitialized();
return remoteConfigInstance;
}
}
RemoteConfig.prototype.setLogLevel = function (logLevel) {
switch (logLevel) {
case 'debug':
this._logger.logLevel = logger.LogLevel.DEBUG;
break;
case 'silent':
this._logger.logLevel = logger.LogLevel.SILENT;
break;
default:
this._logger.logLevel = logger.LogLevel.ERROR;
}
};
Object.defineProperty(RemoteConfig.prototype, "fetchTimeMillis", {
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var consoleLogger = new logger$1.Logger(SERVICE_NAME);
consoleLogger.logLevel = logger$1.LogLevel.INFO;
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var consoleLogger = new logger$1.Logger(SERVICE_NAME);
consoleLogger.logLevel = logger$1.LogLevel.INFO;
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.