Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// This mitigates a minor race condition where the client can send the
// first database request before authenticating.
app.database().goOffline();
app.database().goOnline();
}
if (projectId) {
app.firestore().settings({
host: FIRESTORE_ADDRESS,
ssl: false
});
}
/**
Mute warnings for the previously-created database and whatever other
objects were just created.
*/
setLogLevel(LogLevel.ERROR);
return app;
}
const { projectId, apiKey, appId } = app.options;
if (!projectId) {
throw ERROR_FACTORY.create(ErrorCode.REGISTRATION_PROJECT_ID);
}
if (!apiKey) {
throw ERROR_FACTORY.create(ErrorCode.REGISTRATION_API_KEY);
}
if (!appId) {
throw ERROR_FACTORY.create(ErrorCode.REGISTRATION_APP_ID);
}
namespace = namespace || 'firebase';
const storage = new Storage(appId, app.name, namespace);
const storageCache = new StorageCache(storage);
const logger = new Logger(packageName);
// Sets ERROR as the default log level.
// See RemoteConfig#setLogLevel for corresponding normalization to ERROR log level.
logger.logLevel = FirebaseLogLevel.ERROR;
const 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
);
const retryingClient = new RetryingClient(restClient, storage);
const cachingClient = new CachingClient(
}
// Normalizes optional inputs.
var _a = app.options, projectId = _a.projectId, apiKey = _a.apiKey, appId = _a.appId;
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 = new Logger(name);
// Sets ERROR as the default log level.
// See RemoteConfig#setLogLevel for corresponding normalization to ERROR log level.
logger.logLevel = 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);
var remoteConfigInstance = new RemoteConfig(app, cachingClient, storageCache, storage, logger);
// Starts warming cache.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
remoteConfigInstance.ensureInitialized();
return remoteConfigInstance;
}
}
}
// Normalizes optional inputs.
var _a = app.options, projectId = _a.projectId, apiKey = _a.apiKey, appId = _a.appId;
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;
}
}
if (!apiKey) {
throw ERROR_FACTORY.create(ErrorCode.REGISTRATION_API_KEY);
}
if (!appId) {
throw ERROR_FACTORY.create(ErrorCode.REGISTRATION_APP_ID);
}
namespace = namespace || 'firebase';
const storage = new Storage(appId, app.name, namespace);
const storageCache = new StorageCache(storage);
const logger = new Logger(packageName);
// Sets ERROR as the default log level.
// See RemoteConfig#setLogLevel for corresponding normalization to ERROR log level.
logger.logLevel = FirebaseLogLevel.ERROR;
const 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
);
const retryingClient = new RetryingClient(restClient, storage);
const cachingClient = new CachingClient(
retryingClient,
storage,
storageCache,
logger
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;
}
}
* @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 logger = new logger$1.Logger('@firebase/app');
/**
* @license
* Copyright 2017 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.
* @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.
*/
const logger = new Logger('@firebase/app');
/**
* @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.
function getLogger() {
if (logger) {
return logger;
}
var ccLogger = ccHandler(serializer);
logger = new Logger('@firebase/performance/cc');
logger.logHandler = ccLogger;
return logger;
}
function logTrace(trace) {
* @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 logger = new Logger('@firebase/app');
/**
* @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.