diff options
Diffstat (limited to 'frontend-old/node_modules/@firebase/installations')
69 files changed, 0 insertions, 4231 deletions
diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/index.esm.js b/frontend-old/node_modules/@firebase/installations/dist/esm/index.esm.js deleted file mode 100644 index 5f631fd..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/index.esm.js +++ /dev/null @@ -1,1167 +0,0 @@ -import { _getProvider, getApp, _registerComponent, registerVersion } from '@firebase/app'; -import { Component } from '@firebase/component'; -import { ErrorFactory, FirebaseError } from '@firebase/util'; -import { openDB } from 'idb'; - -const name = "@firebase/installations"; -const version = "0.6.19"; - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 PENDING_TIMEOUT_MS = 10000; -const PACKAGE_VERSION = `w:${version}`; -const INTERNAL_AUTH_VERSION = 'FIS_v2'; -const INSTALLATIONS_API_URL = 'https://firebaseinstallations.googleapis.com/v1'; -const TOKEN_EXPIRATION_BUFFER = 60 * 60 * 1000; // One hour -const SERVICE = 'installations'; -const SERVICE_NAME = 'Installations'; - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 ERROR_DESCRIPTION_MAP = { - ["missing-app-config-values" /* ErrorCode.MISSING_APP_CONFIG_VALUES */]: 'Missing App configuration value: "{$valueName}"', - ["not-registered" /* ErrorCode.NOT_REGISTERED */]: 'Firebase Installation is not registered.', - ["installation-not-found" /* ErrorCode.INSTALLATION_NOT_FOUND */]: 'Firebase Installation not found.', - ["request-failed" /* ErrorCode.REQUEST_FAILED */]: '{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"', - ["app-offline" /* ErrorCode.APP_OFFLINE */]: 'Could not process request. Application offline.', - ["delete-pending-registration" /* ErrorCode.DELETE_PENDING_REGISTRATION */]: "Can't delete installation while there is a pending registration request." -}; -const ERROR_FACTORY = new ErrorFactory(SERVICE, SERVICE_NAME, ERROR_DESCRIPTION_MAP); -/** Returns true if error is a FirebaseError that is based on an error from the server. */ -function isServerError(error) { - return (error instanceof FirebaseError && - error.code.includes("request-failed" /* ErrorCode.REQUEST_FAILED */)); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 getInstallationsEndpoint({ projectId }) { - return `${INSTALLATIONS_API_URL}/projects/${projectId}/installations`; -} -function extractAuthTokenInfoFromResponse(response) { - return { - token: response.token, - requestStatus: 2 /* RequestStatus.COMPLETED */, - expiresIn: getExpiresInFromResponseExpiresIn(response.expiresIn), - creationTime: Date.now() - }; -} -async function getErrorFromResponse(requestName, response) { - const responseJson = await response.json(); - const errorData = responseJson.error; - return ERROR_FACTORY.create("request-failed" /* ErrorCode.REQUEST_FAILED */, { - requestName, - serverCode: errorData.code, - serverMessage: errorData.message, - serverStatus: errorData.status - }); -} -function getHeaders({ apiKey }) { - return new Headers({ - 'Content-Type': 'application/json', - Accept: 'application/json', - 'x-goog-api-key': apiKey - }); -} -function getHeadersWithAuth(appConfig, { refreshToken }) { - const headers = getHeaders(appConfig); - headers.append('Authorization', getAuthorizationHeader(refreshToken)); - return headers; -} -/** - * Calls the passed in fetch wrapper and returns the response. - * If the returned response has a status of 5xx, re-runs the function once and - * returns the response. - */ -async function retryIfServerError(fn) { - const result = await fn(); - if (result.status >= 500 && result.status < 600) { - // Internal Server Error. Retry request. - return fn(); - } - return result; -} -function getExpiresInFromResponseExpiresIn(responseExpiresIn) { - // This works because the server will never respond with fractions of a second. - return Number(responseExpiresIn.replace('s', '000')); -} -function getAuthorizationHeader(refreshToken) { - return `${INTERNAL_AUTH_VERSION} ${refreshToken}`; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -async function createInstallationRequest({ appConfig, heartbeatServiceProvider }, { fid }) { - const endpoint = getInstallationsEndpoint(appConfig); - const headers = getHeaders(appConfig); - // If heartbeat service exists, add the heartbeat string to the header. - const heartbeatService = heartbeatServiceProvider.getImmediate({ - optional: true - }); - if (heartbeatService) { - const heartbeatsHeader = await heartbeatService.getHeartbeatsHeader(); - if (heartbeatsHeader) { - headers.append('x-firebase-client', heartbeatsHeader); - } - } - const body = { - fid, - authVersion: INTERNAL_AUTH_VERSION, - appId: appConfig.appId, - sdkVersion: PACKAGE_VERSION - }; - const request = { - method: 'POST', - headers, - body: JSON.stringify(body) - }; - const response = await retryIfServerError(() => fetch(endpoint, request)); - if (response.ok) { - const responseValue = await response.json(); - const registeredInstallationEntry = { - fid: responseValue.fid || fid, - registrationStatus: 2 /* RequestStatus.COMPLETED */, - refreshToken: responseValue.refreshToken, - authToken: extractAuthTokenInfoFromResponse(responseValue.authToken) - }; - return registeredInstallationEntry; - } - else { - throw await getErrorFromResponse('Create Installation', response); - } -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** Returns a promise that resolves after given time passes. */ -function sleep(ms) { - return new Promise(resolve => { - setTimeout(resolve, ms); - }); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 bufferToBase64UrlSafe(array) { - const b64 = btoa(String.fromCharCode(...array)); - return b64.replace(/\+/g, '-').replace(/\//g, '_'); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 VALID_FID_PATTERN = /^[cdef][\w-]{21}$/; -const INVALID_FID = ''; -/** - * Generates a new FID using random values from Web Crypto API. - * Returns an empty string if FID generation fails for any reason. - */ -function generateFid() { - try { - // A valid FID has exactly 22 base64 characters, which is 132 bits, or 16.5 - // bytes. our implementation generates a 17 byte array instead. - const fidByteArray = new Uint8Array(17); - const crypto = self.crypto || self.msCrypto; - crypto.getRandomValues(fidByteArray); - // Replace the first 4 random bits with the constant FID header of 0b0111. - fidByteArray[0] = 0b01110000 + (fidByteArray[0] % 0b00010000); - const fid = encode(fidByteArray); - return VALID_FID_PATTERN.test(fid) ? fid : INVALID_FID; - } - catch { - // FID generation errored - return INVALID_FID; - } -} -/** Converts a FID Uint8Array to a base64 string representation. */ -function encode(fidByteArray) { - const b64String = bufferToBase64UrlSafe(fidByteArray); - // Remove the 23rd character that was added because of the extra 4 bits at the - // end of our 17 byte array, and the '=' padding. - return b64String.substr(0, 22); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** Returns a string key that can be used to identify the app. */ -function getKey(appConfig) { - return `${appConfig.appName}!${appConfig.appId}`; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 fidChangeCallbacks = new Map(); -/** - * Calls the onIdChange callbacks with the new FID value, and broadcasts the - * change to other tabs. - */ -function fidChanged(appConfig, fid) { - const key = getKey(appConfig); - callFidChangeCallbacks(key, fid); - broadcastFidChange(key, fid); -} -function addCallback(appConfig, callback) { - // Open the broadcast channel if it's not already open, - // to be able to listen to change events from other tabs. - getBroadcastChannel(); - const key = getKey(appConfig); - let callbackSet = fidChangeCallbacks.get(key); - if (!callbackSet) { - callbackSet = new Set(); - fidChangeCallbacks.set(key, callbackSet); - } - callbackSet.add(callback); -} -function removeCallback(appConfig, callback) { - const key = getKey(appConfig); - const callbackSet = fidChangeCallbacks.get(key); - if (!callbackSet) { - return; - } - callbackSet.delete(callback); - if (callbackSet.size === 0) { - fidChangeCallbacks.delete(key); - } - // Close broadcast channel if there are no more callbacks. - closeBroadcastChannel(); -} -function callFidChangeCallbacks(key, fid) { - const callbacks = fidChangeCallbacks.get(key); - if (!callbacks) { - return; - } - for (const callback of callbacks) { - callback(fid); - } -} -function broadcastFidChange(key, fid) { - const channel = getBroadcastChannel(); - if (channel) { - channel.postMessage({ key, fid }); - } - closeBroadcastChannel(); -} -let broadcastChannel = null; -/** Opens and returns a BroadcastChannel if it is supported by the browser. */ -function getBroadcastChannel() { - if (!broadcastChannel && 'BroadcastChannel' in self) { - broadcastChannel = new BroadcastChannel('[Firebase] FID Change'); - broadcastChannel.onmessage = e => { - callFidChangeCallbacks(e.data.key, e.data.fid); - }; - } - return broadcastChannel; -} -function closeBroadcastChannel() { - if (fidChangeCallbacks.size === 0 && broadcastChannel) { - broadcastChannel.close(); - broadcastChannel = null; - } -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 DATABASE_NAME = 'firebase-installations-database'; -const DATABASE_VERSION = 1; -const OBJECT_STORE_NAME = 'firebase-installations-store'; -let dbPromise = null; -function getDbPromise() { - if (!dbPromise) { - dbPromise = openDB(DATABASE_NAME, DATABASE_VERSION, { - upgrade: (db, oldVersion) => { - // We don't use 'break' in this switch statement, the fall-through - // behavior is what we want, because if there are multiple versions between - // the old version and the current version, we want ALL the migrations - // that correspond to those versions to run, not only the last one. - // eslint-disable-next-line default-case - switch (oldVersion) { - case 0: - db.createObjectStore(OBJECT_STORE_NAME); - } - } - }); - } - return dbPromise; -} -/** Assigns or overwrites the record for the given key with the given value. */ -async function set(appConfig, value) { - const key = getKey(appConfig); - const db = await getDbPromise(); - const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite'); - const objectStore = tx.objectStore(OBJECT_STORE_NAME); - const oldValue = (await objectStore.get(key)); - await objectStore.put(value, key); - await tx.done; - if (!oldValue || oldValue.fid !== value.fid) { - fidChanged(appConfig, value.fid); - } - return value; -} -/** Removes record(s) from the objectStore that match the given key. */ -async function remove(appConfig) { - const key = getKey(appConfig); - const db = await getDbPromise(); - const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite'); - await tx.objectStore(OBJECT_STORE_NAME).delete(key); - await tx.done; -} -/** - * Atomically updates a record with the result of updateFn, which gets - * called with the current value. If newValue is undefined, the record is - * deleted instead. - * @return Updated value - */ -async function update(appConfig, updateFn) { - const key = getKey(appConfig); - const db = await getDbPromise(); - const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite'); - const store = tx.objectStore(OBJECT_STORE_NAME); - const oldValue = (await store.get(key)); - const newValue = updateFn(oldValue); - if (newValue === undefined) { - await store.delete(key); - } - else { - await store.put(newValue, key); - } - await tx.done; - if (newValue && (!oldValue || oldValue.fid !== newValue.fid)) { - fidChanged(appConfig, newValue.fid); - } - return newValue; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** - * Updates and returns the InstallationEntry from the database. - * Also triggers a registration request if it is necessary and possible. - */ -async function getInstallationEntry(installations) { - let registrationPromise; - const installationEntry = await update(installations.appConfig, oldEntry => { - const installationEntry = updateOrCreateInstallationEntry(oldEntry); - const entryWithPromise = triggerRegistrationIfNecessary(installations, installationEntry); - registrationPromise = entryWithPromise.registrationPromise; - return entryWithPromise.installationEntry; - }); - if (installationEntry.fid === INVALID_FID) { - // FID generation failed. Waiting for the FID from the server. - return { installationEntry: await registrationPromise }; - } - return { - installationEntry, - registrationPromise - }; -} -/** - * Creates a new Installation Entry if one does not exist. - * Also clears timed out pending requests. - */ -function updateOrCreateInstallationEntry(oldEntry) { - const entry = oldEntry || { - fid: generateFid(), - registrationStatus: 0 /* RequestStatus.NOT_STARTED */ - }; - return clearTimedOutRequest(entry); -} -/** - * If the Firebase Installation is not registered yet, this will trigger the - * registration and return an InProgressInstallationEntry. - * - * If registrationPromise does not exist, the installationEntry is guaranteed - * to be registered. - */ -function triggerRegistrationIfNecessary(installations, installationEntry) { - if (installationEntry.registrationStatus === 0 /* RequestStatus.NOT_STARTED */) { - if (!navigator.onLine) { - // Registration required but app is offline. - const registrationPromiseWithError = Promise.reject(ERROR_FACTORY.create("app-offline" /* ErrorCode.APP_OFFLINE */)); - return { - installationEntry, - registrationPromise: registrationPromiseWithError - }; - } - // Try registering. Change status to IN_PROGRESS. - const inProgressEntry = { - fid: installationEntry.fid, - registrationStatus: 1 /* RequestStatus.IN_PROGRESS */, - registrationTime: Date.now() - }; - const registrationPromise = registerInstallation(installations, inProgressEntry); - return { installationEntry: inProgressEntry, registrationPromise }; - } - else if (installationEntry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */) { - return { - installationEntry, - registrationPromise: waitUntilFidRegistration(installations) - }; - } - else { - return { installationEntry }; - } -} -/** This will be executed only once for each new Firebase Installation. */ -async function registerInstallation(installations, installationEntry) { - try { - const registeredInstallationEntry = await createInstallationRequest(installations, installationEntry); - return set(installations.appConfig, registeredInstallationEntry); - } - catch (e) { - if (isServerError(e) && e.customData.serverCode === 409) { - // Server returned a "FID cannot be used" error. - // Generate a new ID next time. - await remove(installations.appConfig); - } - else { - // Registration failed. Set FID as not registered. - await set(installations.appConfig, { - fid: installationEntry.fid, - registrationStatus: 0 /* RequestStatus.NOT_STARTED */ - }); - } - throw e; - } -} -/** Call if FID registration is pending in another request. */ -async function waitUntilFidRegistration(installations) { - // Unfortunately, there is no way of reliably observing when a value in - // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers), - // so we need to poll. - let entry = await updateInstallationRequest(installations.appConfig); - while (entry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */) { - // createInstallation request still in progress. - await sleep(100); - entry = await updateInstallationRequest(installations.appConfig); - } - if (entry.registrationStatus === 0 /* RequestStatus.NOT_STARTED */) { - // The request timed out or failed in a different call. Try again. - const { installationEntry, registrationPromise } = await getInstallationEntry(installations); - if (registrationPromise) { - return registrationPromise; - } - else { - // if there is no registrationPromise, entry is registered. - return installationEntry; - } - } - return entry; -} -/** - * Called only if there is a CreateInstallation request in progress. - * - * Updates the InstallationEntry in the DB based on the status of the - * CreateInstallation request. - * - * Returns the updated InstallationEntry. - */ -function updateInstallationRequest(appConfig) { - return update(appConfig, oldEntry => { - if (!oldEntry) { - throw ERROR_FACTORY.create("installation-not-found" /* ErrorCode.INSTALLATION_NOT_FOUND */); - } - return clearTimedOutRequest(oldEntry); - }); -} -function clearTimedOutRequest(entry) { - if (hasInstallationRequestTimedOut(entry)) { - return { - fid: entry.fid, - registrationStatus: 0 /* RequestStatus.NOT_STARTED */ - }; - } - return entry; -} -function hasInstallationRequestTimedOut(installationEntry) { - return (installationEntry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */ && - installationEntry.registrationTime + PENDING_TIMEOUT_MS < Date.now()); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -async function generateAuthTokenRequest({ appConfig, heartbeatServiceProvider }, installationEntry) { - const endpoint = getGenerateAuthTokenEndpoint(appConfig, installationEntry); - const headers = getHeadersWithAuth(appConfig, installationEntry); - // If heartbeat service exists, add the heartbeat string to the header. - const heartbeatService = heartbeatServiceProvider.getImmediate({ - optional: true - }); - if (heartbeatService) { - const heartbeatsHeader = await heartbeatService.getHeartbeatsHeader(); - if (heartbeatsHeader) { - headers.append('x-firebase-client', heartbeatsHeader); - } - } - const body = { - installation: { - sdkVersion: PACKAGE_VERSION, - appId: appConfig.appId - } - }; - const request = { - method: 'POST', - headers, - body: JSON.stringify(body) - }; - const response = await retryIfServerError(() => fetch(endpoint, request)); - if (response.ok) { - const responseValue = await response.json(); - const completedAuthToken = extractAuthTokenInfoFromResponse(responseValue); - return completedAuthToken; - } - else { - throw await getErrorFromResponse('Generate Auth Token', response); - } -} -function getGenerateAuthTokenEndpoint(appConfig, { fid }) { - return `${getInstallationsEndpoint(appConfig)}/${fid}/authTokens:generate`; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** - * Returns a valid authentication token for the installation. Generates a new - * token if one doesn't exist, is expired or about to expire. - * - * Should only be called if the Firebase Installation is registered. - */ -async function refreshAuthToken(installations, forceRefresh = false) { - let tokenPromise; - const entry = await update(installations.appConfig, oldEntry => { - if (!isEntryRegistered(oldEntry)) { - throw ERROR_FACTORY.create("not-registered" /* ErrorCode.NOT_REGISTERED */); - } - const oldAuthToken = oldEntry.authToken; - if (!forceRefresh && isAuthTokenValid(oldAuthToken)) { - // There is a valid token in the DB. - return oldEntry; - } - else if (oldAuthToken.requestStatus === 1 /* RequestStatus.IN_PROGRESS */) { - // There already is a token request in progress. - tokenPromise = waitUntilAuthTokenRequest(installations, forceRefresh); - return oldEntry; - } - else { - // No token or token expired. - if (!navigator.onLine) { - throw ERROR_FACTORY.create("app-offline" /* ErrorCode.APP_OFFLINE */); - } - const inProgressEntry = makeAuthTokenRequestInProgressEntry(oldEntry); - tokenPromise = fetchAuthTokenFromServer(installations, inProgressEntry); - return inProgressEntry; - } - }); - const authToken = tokenPromise - ? await tokenPromise - : entry.authToken; - return authToken; -} -/** - * Call only if FID is registered and Auth Token request is in progress. - * - * Waits until the current pending request finishes. If the request times out, - * tries once in this thread as well. - */ -async function waitUntilAuthTokenRequest(installations, forceRefresh) { - // Unfortunately, there is no way of reliably observing when a value in - // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers), - // so we need to poll. - let entry = await updateAuthTokenRequest(installations.appConfig); - while (entry.authToken.requestStatus === 1 /* RequestStatus.IN_PROGRESS */) { - // generateAuthToken still in progress. - await sleep(100); - entry = await updateAuthTokenRequest(installations.appConfig); - } - const authToken = entry.authToken; - if (authToken.requestStatus === 0 /* RequestStatus.NOT_STARTED */) { - // The request timed out or failed in a different call. Try again. - return refreshAuthToken(installations, forceRefresh); - } - else { - return authToken; - } -} -/** - * Called only if there is a GenerateAuthToken request in progress. - * - * Updates the InstallationEntry in the DB based on the status of the - * GenerateAuthToken request. - * - * Returns the updated InstallationEntry. - */ -function updateAuthTokenRequest(appConfig) { - return update(appConfig, oldEntry => { - if (!isEntryRegistered(oldEntry)) { - throw ERROR_FACTORY.create("not-registered" /* ErrorCode.NOT_REGISTERED */); - } - const oldAuthToken = oldEntry.authToken; - if (hasAuthTokenRequestTimedOut(oldAuthToken)) { - return { - ...oldEntry, - authToken: { requestStatus: 0 /* RequestStatus.NOT_STARTED */ } - }; - } - return oldEntry; - }); -} -async function fetchAuthTokenFromServer(installations, installationEntry) { - try { - const authToken = await generateAuthTokenRequest(installations, installationEntry); - const updatedInstallationEntry = { - ...installationEntry, - authToken - }; - await set(installations.appConfig, updatedInstallationEntry); - return authToken; - } - catch (e) { - if (isServerError(e) && - (e.customData.serverCode === 401 || e.customData.serverCode === 404)) { - // Server returned a "FID not found" or a "Invalid authentication" error. - // Generate a new ID next time. - await remove(installations.appConfig); - } - else { - const updatedInstallationEntry = { - ...installationEntry, - authToken: { requestStatus: 0 /* RequestStatus.NOT_STARTED */ } - }; - await set(installations.appConfig, updatedInstallationEntry); - } - throw e; - } -} -function isEntryRegistered(installationEntry) { - return (installationEntry !== undefined && - installationEntry.registrationStatus === 2 /* RequestStatus.COMPLETED */); -} -function isAuthTokenValid(authToken) { - return (authToken.requestStatus === 2 /* RequestStatus.COMPLETED */ && - !isAuthTokenExpired(authToken)); -} -function isAuthTokenExpired(authToken) { - const now = Date.now(); - return (now < authToken.creationTime || - authToken.creationTime + authToken.expiresIn < now + TOKEN_EXPIRATION_BUFFER); -} -/** Returns an updated InstallationEntry with an InProgressAuthToken. */ -function makeAuthTokenRequestInProgressEntry(oldEntry) { - const inProgressAuthToken = { - requestStatus: 1 /* RequestStatus.IN_PROGRESS */, - requestTime: Date.now() - }; - return { - ...oldEntry, - authToken: inProgressAuthToken - }; -} -function hasAuthTokenRequestTimedOut(authToken) { - return (authToken.requestStatus === 1 /* RequestStatus.IN_PROGRESS */ && - authToken.requestTime + PENDING_TIMEOUT_MS < Date.now()); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** - * Creates a Firebase Installation if there isn't one for the app and - * returns the Installation ID. - * @param installations - The `Installations` instance. - * - * @public - */ -async function getId(installations) { - const installationsImpl = installations; - const { installationEntry, registrationPromise } = await getInstallationEntry(installationsImpl); - if (registrationPromise) { - registrationPromise.catch(console.error); - } - else { - // If the installation is already registered, update the authentication - // token if needed. - refreshAuthToken(installationsImpl).catch(console.error); - } - return installationEntry.fid; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** - * Returns a Firebase Installations auth token, identifying the current - * Firebase Installation. - * @param installations - The `Installations` instance. - * @param forceRefresh - Force refresh regardless of token expiration. - * - * @public - */ -async function getToken(installations, forceRefresh = false) { - const installationsImpl = installations; - await completeInstallationRegistration(installationsImpl); - // At this point we either have a Registered Installation in the DB, or we've - // already thrown an error. - const authToken = await refreshAuthToken(installationsImpl, forceRefresh); - return authToken.token; -} -async function completeInstallationRegistration(installations) { - const { registrationPromise } = await getInstallationEntry(installations); - if (registrationPromise) { - // A createInstallation request is in progress. Wait until it finishes. - await registrationPromise; - } -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -async function deleteInstallationRequest(appConfig, installationEntry) { - const endpoint = getDeleteEndpoint(appConfig, installationEntry); - const headers = getHeadersWithAuth(appConfig, installationEntry); - const request = { - method: 'DELETE', - headers - }; - const response = await retryIfServerError(() => fetch(endpoint, request)); - if (!response.ok) { - throw await getErrorFromResponse('Delete Installation', response); - } -} -function getDeleteEndpoint(appConfig, { fid }) { - return `${getInstallationsEndpoint(appConfig)}/${fid}`; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** - * Deletes the Firebase Installation and all associated data. - * @param installations - The `Installations` instance. - * - * @public - */ -async function deleteInstallations(installations) { - const { appConfig } = installations; - const entry = await update(appConfig, oldEntry => { - if (oldEntry && oldEntry.registrationStatus === 0 /* RequestStatus.NOT_STARTED */) { - // Delete the unregistered entry without sending a deleteInstallation request. - return undefined; - } - return oldEntry; - }); - if (entry) { - if (entry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */) { - // Can't delete while trying to register. - throw ERROR_FACTORY.create("delete-pending-registration" /* ErrorCode.DELETE_PENDING_REGISTRATION */); - } - else if (entry.registrationStatus === 2 /* RequestStatus.COMPLETED */) { - if (!navigator.onLine) { - throw ERROR_FACTORY.create("app-offline" /* ErrorCode.APP_OFFLINE */); - } - else { - await deleteInstallationRequest(appConfig, entry); - await remove(appConfig); - } - } - } -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** - * Sets a new callback that will get called when Installation ID changes. - * Returns an unsubscribe function that will remove the callback when called. - * @param installations - The `Installations` instance. - * @param callback - The callback function that is invoked when FID changes. - * @returns A function that can be called to unsubscribe. - * - * @public - */ -function onIdChange(installations, callback) { - const { appConfig } = installations; - addCallback(appConfig, callback); - return () => { - removeCallback(appConfig, callback); - }; -} - -/** - * @license - * Copyright 2020 Google LLC - * - * 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. - */ -/** - * Returns an instance of {@link Installations} associated with the given - * {@link @firebase/app#FirebaseApp} instance. - * @param app - The {@link @firebase/app#FirebaseApp} instance. - * - * @public - */ -function getInstallations(app = getApp()) { - const installationsImpl = _getProvider(app, 'installations').getImmediate(); - return installationsImpl; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 extractAppConfig(app) { - if (!app || !app.options) { - throw getMissingValueError('App Configuration'); - } - if (!app.name) { - throw getMissingValueError('App Name'); - } - // Required app config keys - const configKeys = [ - 'projectId', - 'apiKey', - 'appId' - ]; - for (const keyName of configKeys) { - if (!app.options[keyName]) { - throw getMissingValueError(keyName); - } - } - return { - appName: app.name, - projectId: app.options.projectId, - apiKey: app.options.apiKey, - appId: app.options.appId - }; -} -function getMissingValueError(valueName) { - return ERROR_FACTORY.create("missing-app-config-values" /* ErrorCode.MISSING_APP_CONFIG_VALUES */, { - valueName - }); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * 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 INSTALLATIONS_NAME = 'installations'; -const INSTALLATIONS_NAME_INTERNAL = 'installations-internal'; -const publicFactory = (container) => { - const app = container.getProvider('app').getImmediate(); - // Throws if app isn't configured properly. - const appConfig = extractAppConfig(app); - const heartbeatServiceProvider = _getProvider(app, 'heartbeat'); - const installationsImpl = { - app, - appConfig, - heartbeatServiceProvider, - _delete: () => Promise.resolve() - }; - return installationsImpl; -}; -const internalFactory = (container) => { - const app = container.getProvider('app').getImmediate(); - // Internal FIS instance relies on public FIS instance. - const installations = _getProvider(app, INSTALLATIONS_NAME).getImmediate(); - const installationsInternal = { - getId: () => getId(installations), - getToken: (forceRefresh) => getToken(installations, forceRefresh) - }; - return installationsInternal; -}; -function registerInstallations() { - _registerComponent(new Component(INSTALLATIONS_NAME, publicFactory, "PUBLIC" /* ComponentType.PUBLIC */)); - _registerComponent(new Component(INSTALLATIONS_NAME_INTERNAL, internalFactory, "PRIVATE" /* ComponentType.PRIVATE */)); -} - -/** - * The Firebase Installations Web SDK. - * This SDK does not work in a Node.js environment. - * - * @packageDocumentation - */ -registerInstallations(); -registerVersion(name, version); -// BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation -registerVersion(name, version, 'esm2020'); - -export { deleteInstallations, getId, getInstallations, getToken, onIdChange }; -//# sourceMappingURL=index.esm.js.map diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/index.esm.js.map b/frontend-old/node_modules/@firebase/installations/dist/esm/index.esm.js.map deleted file mode 100644 index 449d1a6..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/index.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.esm.js","sources":["../../src/util/constants.ts","../../src/util/errors.ts","../../src/functions/common.ts","../../src/functions/create-installation-request.ts","../../src/util/sleep.ts","../../src/helpers/buffer-to-base64-url-safe.ts","../../src/helpers/generate-fid.ts","../../src/util/get-key.ts","../../src/helpers/fid-changed.ts","../../src/helpers/idb-manager.ts","../../src/helpers/get-installation-entry.ts","../../src/functions/generate-auth-token-request.ts","../../src/helpers/refresh-auth-token.ts","../../src/api/get-id.ts","../../src/api/get-token.ts","../../src/functions/delete-installation-request.ts","../../src/api/delete-installations.ts","../../src/api/on-id-change.ts","../../src/api/get-installations.ts","../../src/helpers/extract-app-config.ts","../../src/functions/config.ts","../../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { version } from '../../package.json';\n\nexport const PENDING_TIMEOUT_MS = 10000;\n\nexport const PACKAGE_VERSION = `w:${version}`;\nexport const INTERNAL_AUTH_VERSION = 'FIS_v2';\n\nexport const INSTALLATIONS_API_URL =\n 'https://firebaseinstallations.googleapis.com/v1';\n\nexport const TOKEN_EXPIRATION_BUFFER = 60 * 60 * 1000; // One hour\n\nexport const SERVICE = 'installations';\nexport const SERVICE_NAME = 'Installations';\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, FirebaseError } from '@firebase/util';\nimport { SERVICE, SERVICE_NAME } from './constants';\n\nexport const enum ErrorCode {\n MISSING_APP_CONFIG_VALUES = 'missing-app-config-values',\n NOT_REGISTERED = 'not-registered',\n INSTALLATION_NOT_FOUND = 'installation-not-found',\n REQUEST_FAILED = 'request-failed',\n APP_OFFLINE = 'app-offline',\n DELETE_PENDING_REGISTRATION = 'delete-pending-registration'\n}\n\nconst ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = {\n [ErrorCode.MISSING_APP_CONFIG_VALUES]:\n 'Missing App configuration value: \"{$valueName}\"',\n [ErrorCode.NOT_REGISTERED]: 'Firebase Installation is not registered.',\n [ErrorCode.INSTALLATION_NOT_FOUND]: 'Firebase Installation not found.',\n [ErrorCode.REQUEST_FAILED]:\n '{$requestName} request failed with error \"{$serverCode} {$serverStatus}: {$serverMessage}\"',\n [ErrorCode.APP_OFFLINE]: 'Could not process request. Application offline.',\n [ErrorCode.DELETE_PENDING_REGISTRATION]:\n \"Can't delete installation while there is a pending registration request.\"\n};\n\ninterface ErrorParams {\n [ErrorCode.MISSING_APP_CONFIG_VALUES]: {\n valueName: string;\n };\n [ErrorCode.REQUEST_FAILED]: {\n requestName: string;\n [index: string]: string | number; // to make TypeScript 3.8 happy\n } & ServerErrorData;\n}\n\nexport const ERROR_FACTORY = new ErrorFactory<ErrorCode, ErrorParams>(\n SERVICE,\n SERVICE_NAME,\n ERROR_DESCRIPTION_MAP\n);\n\nexport interface ServerErrorData {\n serverCode: number;\n serverMessage: string;\n serverStatus: string;\n}\n\nexport type ServerError = FirebaseError & { customData: ServerErrorData };\n\n/** Returns true if error is a FirebaseError that is based on an error from the server. */\nexport function isServerError(error: unknown): error is ServerError {\n return (\n error instanceof FirebaseError &&\n error.code.includes(ErrorCode.REQUEST_FAILED)\n );\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseError } from '@firebase/util';\nimport { GenerateAuthTokenResponse } from '../interfaces/api-response';\nimport {\n CompletedAuthToken,\n RegisteredInstallationEntry,\n RequestStatus\n} from '../interfaces/installation-entry';\nimport {\n INSTALLATIONS_API_URL,\n INTERNAL_AUTH_VERSION\n} from '../util/constants';\nimport { ERROR_FACTORY, ErrorCode } from '../util/errors';\nimport { AppConfig } from '../interfaces/installation-impl';\n\nexport function getInstallationsEndpoint({ projectId }: AppConfig): string {\n return `${INSTALLATIONS_API_URL}/projects/${projectId}/installations`;\n}\n\nexport function extractAuthTokenInfoFromResponse(\n response: GenerateAuthTokenResponse\n): CompletedAuthToken {\n return {\n token: response.token,\n requestStatus: RequestStatus.COMPLETED,\n expiresIn: getExpiresInFromResponseExpiresIn(response.expiresIn),\n creationTime: Date.now()\n };\n}\n\nexport async function getErrorFromResponse(\n requestName: string,\n response: Response\n): Promise<FirebaseError> {\n const responseJson: ErrorResponse = await response.json();\n const errorData = responseJson.error;\n return ERROR_FACTORY.create(ErrorCode.REQUEST_FAILED, {\n requestName,\n serverCode: errorData.code,\n serverMessage: errorData.message,\n serverStatus: errorData.status\n });\n}\n\nexport function getHeaders({ apiKey }: AppConfig): Headers {\n return new Headers({\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n 'x-goog-api-key': apiKey\n });\n}\n\nexport function getHeadersWithAuth(\n appConfig: AppConfig,\n { refreshToken }: RegisteredInstallationEntry\n): Headers {\n const headers = getHeaders(appConfig);\n headers.append('Authorization', getAuthorizationHeader(refreshToken));\n return headers;\n}\n\nexport interface ErrorResponse {\n error: {\n code: number;\n message: string;\n status: string;\n };\n}\n\n/**\n * Calls the passed in fetch wrapper and returns the response.\n * If the returned response has a status of 5xx, re-runs the function once and\n * returns the response.\n */\nexport async function retryIfServerError(\n fn: () => Promise<Response>\n): Promise<Response> {\n const result = await fn();\n\n if (result.status >= 500 && result.status < 600) {\n // Internal Server Error. Retry request.\n return fn();\n }\n\n return result;\n}\n\nfunction getExpiresInFromResponseExpiresIn(responseExpiresIn: string): number {\n // This works because the server will never respond with fractions of a second.\n return Number(responseExpiresIn.replace('s', '000'));\n}\n\nfunction getAuthorizationHeader(refreshToken: string): string {\n return `${INTERNAL_AUTH_VERSION} ${refreshToken}`;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CreateInstallationResponse } from '../interfaces/api-response';\nimport {\n InProgressInstallationEntry,\n RegisteredInstallationEntry,\n RequestStatus\n} from '../interfaces/installation-entry';\nimport { INTERNAL_AUTH_VERSION, PACKAGE_VERSION } from '../util/constants';\nimport {\n extractAuthTokenInfoFromResponse,\n getErrorFromResponse,\n getHeaders,\n getInstallationsEndpoint,\n retryIfServerError\n} from './common';\nimport { FirebaseInstallationsImpl } from '../interfaces/installation-impl';\n\nexport async function createInstallationRequest(\n { appConfig, heartbeatServiceProvider }: FirebaseInstallationsImpl,\n { fid }: InProgressInstallationEntry\n): Promise<RegisteredInstallationEntry> {\n const endpoint = getInstallationsEndpoint(appConfig);\n\n const headers = getHeaders(appConfig);\n\n // If heartbeat service exists, add the heartbeat string to the header.\n const heartbeatService = heartbeatServiceProvider.getImmediate({\n optional: true\n });\n if (heartbeatService) {\n const heartbeatsHeader = await heartbeatService.getHeartbeatsHeader();\n if (heartbeatsHeader) {\n headers.append('x-firebase-client', heartbeatsHeader);\n }\n }\n\n const body = {\n fid,\n authVersion: INTERNAL_AUTH_VERSION,\n appId: appConfig.appId,\n sdkVersion: PACKAGE_VERSION\n };\n\n const request: RequestInit = {\n method: 'POST',\n headers,\n body: JSON.stringify(body)\n };\n\n const response = await retryIfServerError(() => fetch(endpoint, request));\n if (response.ok) {\n const responseValue: CreateInstallationResponse = await response.json();\n const registeredInstallationEntry: RegisteredInstallationEntry = {\n fid: responseValue.fid || fid,\n registrationStatus: RequestStatus.COMPLETED,\n refreshToken: responseValue.refreshToken,\n authToken: extractAuthTokenInfoFromResponse(responseValue.authToken)\n };\n return registeredInstallationEntry;\n } else {\n throw await getErrorFromResponse('Create Installation', response);\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Returns a promise that resolves after given time passes. */\nexport function sleep(ms: number): Promise<void> {\n return new Promise<void>(resolve => {\n setTimeout(resolve, ms);\n });\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function bufferToBase64UrlSafe(array: Uint8Array): string {\n const b64 = btoa(String.fromCharCode(...array));\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_');\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bufferToBase64UrlSafe } from './buffer-to-base64-url-safe';\n\nexport const VALID_FID_PATTERN = /^[cdef][\\w-]{21}$/;\nexport const INVALID_FID = '';\n\n/**\n * Generates a new FID using random values from Web Crypto API.\n * Returns an empty string if FID generation fails for any reason.\n */\nexport function generateFid(): string {\n try {\n // A valid FID has exactly 22 base64 characters, which is 132 bits, or 16.5\n // bytes. our implementation generates a 17 byte array instead.\n const fidByteArray = new Uint8Array(17);\n const crypto =\n self.crypto || (self as unknown as { msCrypto: Crypto }).msCrypto;\n crypto.getRandomValues(fidByteArray);\n\n // Replace the first 4 random bits with the constant FID header of 0b0111.\n fidByteArray[0] = 0b01110000 + (fidByteArray[0] % 0b00010000);\n\n const fid = encode(fidByteArray);\n\n return VALID_FID_PATTERN.test(fid) ? fid : INVALID_FID;\n } catch {\n // FID generation errored\n return INVALID_FID;\n }\n}\n\n/** Converts a FID Uint8Array to a base64 string representation. */\nfunction encode(fidByteArray: Uint8Array): string {\n const b64String = bufferToBase64UrlSafe(fidByteArray);\n\n // Remove the 23rd character that was added because of the extra 4 bits at the\n // end of our 17 byte array, and the '=' padding.\n return b64String.substr(0, 22);\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AppConfig } from '../interfaces/installation-impl';\n\n/** Returns a string key that can be used to identify the app. */\nexport function getKey(appConfig: AppConfig): string {\n return `${appConfig.appName}!${appConfig.appId}`;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getKey } from '../util/get-key';\nimport { AppConfig } from '../interfaces/installation-impl';\nimport { IdChangeCallbackFn } from '../api';\n\nconst fidChangeCallbacks: Map<string, Set<IdChangeCallbackFn>> = new Map();\n\n/**\n * Calls the onIdChange callbacks with the new FID value, and broadcasts the\n * change to other tabs.\n */\nexport function fidChanged(appConfig: AppConfig, fid: string): void {\n const key = getKey(appConfig);\n\n callFidChangeCallbacks(key, fid);\n broadcastFidChange(key, fid);\n}\n\nexport function addCallback(\n appConfig: AppConfig,\n callback: IdChangeCallbackFn\n): void {\n // Open the broadcast channel if it's not already open,\n // to be able to listen to change events from other tabs.\n getBroadcastChannel();\n\n const key = getKey(appConfig);\n\n let callbackSet = fidChangeCallbacks.get(key);\n if (!callbackSet) {\n callbackSet = new Set();\n fidChangeCallbacks.set(key, callbackSet);\n }\n callbackSet.add(callback);\n}\n\nexport function removeCallback(\n appConfig: AppConfig,\n callback: IdChangeCallbackFn\n): void {\n const key = getKey(appConfig);\n\n const callbackSet = fidChangeCallbacks.get(key);\n\n if (!callbackSet) {\n return;\n }\n\n callbackSet.delete(callback);\n if (callbackSet.size === 0) {\n fidChangeCallbacks.delete(key);\n }\n\n // Close broadcast channel if there are no more callbacks.\n closeBroadcastChannel();\n}\n\nfunction callFidChangeCallbacks(key: string, fid: string): void {\n const callbacks = fidChangeCallbacks.get(key);\n if (!callbacks) {\n return;\n }\n\n for (const callback of callbacks) {\n callback(fid);\n }\n}\n\nfunction broadcastFidChange(key: string, fid: string): void {\n const channel = getBroadcastChannel();\n if (channel) {\n channel.postMessage({ key, fid });\n }\n closeBroadcastChannel();\n}\n\nlet broadcastChannel: BroadcastChannel | null = null;\n/** Opens and returns a BroadcastChannel if it is supported by the browser. */\nfunction getBroadcastChannel(): BroadcastChannel | null {\n if (!broadcastChannel && 'BroadcastChannel' in self) {\n broadcastChannel = new BroadcastChannel('[Firebase] FID Change');\n broadcastChannel.onmessage = e => {\n callFidChangeCallbacks(e.data.key, e.data.fid);\n };\n }\n return broadcastChannel;\n}\n\nfunction closeBroadcastChannel(): void {\n if (fidChangeCallbacks.size === 0 && broadcastChannel) {\n broadcastChannel.close();\n broadcastChannel = null;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DBSchema, IDBPDatabase, openDB } from 'idb';\nimport { AppConfig } from '../interfaces/installation-impl';\nimport { InstallationEntry } from '../interfaces/installation-entry';\nimport { getKey } from '../util/get-key';\nimport { fidChanged } from './fid-changed';\n\nconst DATABASE_NAME = 'firebase-installations-database';\nconst DATABASE_VERSION = 1;\nconst OBJECT_STORE_NAME = 'firebase-installations-store';\n\ninterface InstallationsDB extends DBSchema {\n 'firebase-installations-store': {\n key: string;\n value: InstallationEntry | undefined;\n };\n}\n\nlet dbPromise: Promise<IDBPDatabase<InstallationsDB>> | null = null;\nfunction getDbPromise(): Promise<IDBPDatabase<InstallationsDB>> {\n if (!dbPromise) {\n dbPromise = openDB(DATABASE_NAME, DATABASE_VERSION, {\n upgrade: (db, oldVersion) => {\n // We don't use 'break' in this switch statement, the fall-through\n // behavior is what we want, because if there are multiple versions between\n // the old version and the current version, we want ALL the migrations\n // that correspond to those versions to run, not only the last one.\n // eslint-disable-next-line default-case\n switch (oldVersion) {\n case 0:\n db.createObjectStore(OBJECT_STORE_NAME);\n }\n }\n });\n }\n return dbPromise;\n}\n\n/** Gets record(s) from the objectStore that match the given key. */\nexport async function get(\n appConfig: AppConfig\n): Promise<InstallationEntry | undefined> {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n return db\n .transaction(OBJECT_STORE_NAME)\n .objectStore(OBJECT_STORE_NAME)\n .get(key) as Promise<InstallationEntry>;\n}\n\n/** Assigns or overwrites the record for the given key with the given value. */\nexport async function set<ValueType extends InstallationEntry>(\n appConfig: AppConfig,\n value: ValueType\n): Promise<ValueType> {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n const objectStore = tx.objectStore(OBJECT_STORE_NAME);\n const oldValue = (await objectStore.get(key)) as InstallationEntry;\n await objectStore.put(value, key);\n await tx.done;\n\n if (!oldValue || oldValue.fid !== value.fid) {\n fidChanged(appConfig, value.fid);\n }\n\n return value;\n}\n\n/** Removes record(s) from the objectStore that match the given key. */\nexport async function remove(appConfig: AppConfig): Promise<void> {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n await tx.objectStore(OBJECT_STORE_NAME).delete(key);\n await tx.done;\n}\n\n/**\n * Atomically updates a record with the result of updateFn, which gets\n * called with the current value. If newValue is undefined, the record is\n * deleted instead.\n * @return Updated value\n */\nexport async function update<ValueType extends InstallationEntry | undefined>(\n appConfig: AppConfig,\n updateFn: (previousValue: InstallationEntry | undefined) => ValueType\n): Promise<ValueType> {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n const store = tx.objectStore(OBJECT_STORE_NAME);\n const oldValue: InstallationEntry | undefined = (await store.get(\n key\n )) as InstallationEntry;\n const newValue = updateFn(oldValue);\n\n if (newValue === undefined) {\n await store.delete(key);\n } else {\n await store.put(newValue, key);\n }\n await tx.done;\n\n if (newValue && (!oldValue || oldValue.fid !== newValue.fid)) {\n fidChanged(appConfig, newValue.fid);\n }\n\n return newValue;\n}\n\nexport async function clear(): Promise<void> {\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n await tx.objectStore(OBJECT_STORE_NAME).clear();\n await tx.done;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createInstallationRequest } from '../functions/create-installation-request';\nimport {\n AppConfig,\n FirebaseInstallationsImpl\n} from '../interfaces/installation-impl';\nimport {\n InProgressInstallationEntry,\n InstallationEntry,\n RegisteredInstallationEntry,\n RequestStatus\n} from '../interfaces/installation-entry';\nimport { PENDING_TIMEOUT_MS } from '../util/constants';\nimport { ERROR_FACTORY, ErrorCode, isServerError } from '../util/errors';\nimport { sleep } from '../util/sleep';\nimport { generateFid, INVALID_FID } from './generate-fid';\nimport { remove, set, update } from './idb-manager';\n\nexport interface InstallationEntryWithRegistrationPromise {\n installationEntry: InstallationEntry;\n /** Exist iff the installationEntry is not registered. */\n registrationPromise?: Promise<RegisteredInstallationEntry>;\n}\n\n/**\n * Updates and returns the InstallationEntry from the database.\n * Also triggers a registration request if it is necessary and possible.\n */\nexport async function getInstallationEntry(\n installations: FirebaseInstallationsImpl\n): Promise<InstallationEntryWithRegistrationPromise> {\n let registrationPromise: Promise<RegisteredInstallationEntry> | undefined;\n\n const installationEntry = await update(installations.appConfig, oldEntry => {\n const installationEntry = updateOrCreateInstallationEntry(oldEntry);\n const entryWithPromise = triggerRegistrationIfNecessary(\n installations,\n installationEntry\n );\n registrationPromise = entryWithPromise.registrationPromise;\n return entryWithPromise.installationEntry;\n });\n\n if (installationEntry.fid === INVALID_FID) {\n // FID generation failed. Waiting for the FID from the server.\n return { installationEntry: await registrationPromise! };\n }\n\n return {\n installationEntry,\n registrationPromise\n };\n}\n\n/**\n * Creates a new Installation Entry if one does not exist.\n * Also clears timed out pending requests.\n */\nfunction updateOrCreateInstallationEntry(\n oldEntry: InstallationEntry | undefined\n): InstallationEntry {\n const entry: InstallationEntry = oldEntry || {\n fid: generateFid(),\n registrationStatus: RequestStatus.NOT_STARTED\n };\n\n return clearTimedOutRequest(entry);\n}\n\n/**\n * If the Firebase Installation is not registered yet, this will trigger the\n * registration and return an InProgressInstallationEntry.\n *\n * If registrationPromise does not exist, the installationEntry is guaranteed\n * to be registered.\n */\nfunction triggerRegistrationIfNecessary(\n installations: FirebaseInstallationsImpl,\n installationEntry: InstallationEntry\n): InstallationEntryWithRegistrationPromise {\n if (installationEntry.registrationStatus === RequestStatus.NOT_STARTED) {\n if (!navigator.onLine) {\n // Registration required but app is offline.\n const registrationPromiseWithError = Promise.reject(\n ERROR_FACTORY.create(ErrorCode.APP_OFFLINE)\n );\n return {\n installationEntry,\n registrationPromise: registrationPromiseWithError\n };\n }\n\n // Try registering. Change status to IN_PROGRESS.\n const inProgressEntry: InProgressInstallationEntry = {\n fid: installationEntry.fid,\n registrationStatus: RequestStatus.IN_PROGRESS,\n registrationTime: Date.now()\n };\n const registrationPromise = registerInstallation(\n installations,\n inProgressEntry\n );\n return { installationEntry: inProgressEntry, registrationPromise };\n } else if (\n installationEntry.registrationStatus === RequestStatus.IN_PROGRESS\n ) {\n return {\n installationEntry,\n registrationPromise: waitUntilFidRegistration(installations)\n };\n } else {\n return { installationEntry };\n }\n}\n\n/** This will be executed only once for each new Firebase Installation. */\nasync function registerInstallation(\n installations: FirebaseInstallationsImpl,\n installationEntry: InProgressInstallationEntry\n): Promise<RegisteredInstallationEntry> {\n try {\n const registeredInstallationEntry = await createInstallationRequest(\n installations,\n installationEntry\n );\n return set(installations.appConfig, registeredInstallationEntry);\n } catch (e) {\n if (isServerError(e) && e.customData.serverCode === 409) {\n // Server returned a \"FID cannot be used\" error.\n // Generate a new ID next time.\n await remove(installations.appConfig);\n } else {\n // Registration failed. Set FID as not registered.\n await set(installations.appConfig, {\n fid: installationEntry.fid,\n registrationStatus: RequestStatus.NOT_STARTED\n });\n }\n throw e;\n }\n}\n\n/** Call if FID registration is pending in another request. */\nasync function waitUntilFidRegistration(\n installations: FirebaseInstallationsImpl\n): Promise<RegisteredInstallationEntry> {\n // Unfortunately, there is no way of reliably observing when a value in\n // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers),\n // so we need to poll.\n\n let entry: InstallationEntry = await updateInstallationRequest(\n installations.appConfig\n );\n while (entry.registrationStatus === RequestStatus.IN_PROGRESS) {\n // createInstallation request still in progress.\n await sleep(100);\n\n entry = await updateInstallationRequest(installations.appConfig);\n }\n\n if (entry.registrationStatus === RequestStatus.NOT_STARTED) {\n // The request timed out or failed in a different call. Try again.\n const { installationEntry, registrationPromise } =\n await getInstallationEntry(installations);\n\n if (registrationPromise) {\n return registrationPromise;\n } else {\n // if there is no registrationPromise, entry is registered.\n return installationEntry as RegisteredInstallationEntry;\n }\n }\n\n return entry;\n}\n\n/**\n * Called only if there is a CreateInstallation request in progress.\n *\n * Updates the InstallationEntry in the DB based on the status of the\n * CreateInstallation request.\n *\n * Returns the updated InstallationEntry.\n */\nfunction updateInstallationRequest(\n appConfig: AppConfig\n): Promise<InstallationEntry> {\n return update(appConfig, oldEntry => {\n if (!oldEntry) {\n throw ERROR_FACTORY.create(ErrorCode.INSTALLATION_NOT_FOUND);\n }\n return clearTimedOutRequest(oldEntry);\n });\n}\n\nfunction clearTimedOutRequest(entry: InstallationEntry): InstallationEntry {\n if (hasInstallationRequestTimedOut(entry)) {\n return {\n fid: entry.fid,\n registrationStatus: RequestStatus.NOT_STARTED\n };\n }\n\n return entry;\n}\n\nfunction hasInstallationRequestTimedOut(\n installationEntry: InstallationEntry\n): boolean {\n return (\n installationEntry.registrationStatus === RequestStatus.IN_PROGRESS &&\n installationEntry.registrationTime + PENDING_TIMEOUT_MS < Date.now()\n );\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { GenerateAuthTokenResponse } from '../interfaces/api-response';\nimport {\n CompletedAuthToken,\n RegisteredInstallationEntry\n} from '../interfaces/installation-entry';\nimport { PACKAGE_VERSION } from '../util/constants';\nimport {\n extractAuthTokenInfoFromResponse,\n getErrorFromResponse,\n getHeadersWithAuth,\n getInstallationsEndpoint,\n retryIfServerError\n} from './common';\nimport {\n FirebaseInstallationsImpl,\n AppConfig\n} from '../interfaces/installation-impl';\n\nexport async function generateAuthTokenRequest(\n { appConfig, heartbeatServiceProvider }: FirebaseInstallationsImpl,\n installationEntry: RegisteredInstallationEntry\n): Promise<CompletedAuthToken> {\n const endpoint = getGenerateAuthTokenEndpoint(appConfig, installationEntry);\n\n const headers = getHeadersWithAuth(appConfig, installationEntry);\n\n // If heartbeat service exists, add the heartbeat string to the header.\n const heartbeatService = heartbeatServiceProvider.getImmediate({\n optional: true\n });\n if (heartbeatService) {\n const heartbeatsHeader = await heartbeatService.getHeartbeatsHeader();\n if (heartbeatsHeader) {\n headers.append('x-firebase-client', heartbeatsHeader);\n }\n }\n\n const body = {\n installation: {\n sdkVersion: PACKAGE_VERSION,\n appId: appConfig.appId\n }\n };\n\n const request: RequestInit = {\n method: 'POST',\n headers,\n body: JSON.stringify(body)\n };\n\n const response = await retryIfServerError(() => fetch(endpoint, request));\n if (response.ok) {\n const responseValue: GenerateAuthTokenResponse = await response.json();\n const completedAuthToken: CompletedAuthToken =\n extractAuthTokenInfoFromResponse(responseValue);\n return completedAuthToken;\n } else {\n throw await getErrorFromResponse('Generate Auth Token', response);\n }\n}\n\nfunction getGenerateAuthTokenEndpoint(\n appConfig: AppConfig,\n { fid }: RegisteredInstallationEntry\n): string {\n return `${getInstallationsEndpoint(appConfig)}/${fid}/authTokens:generate`;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { generateAuthTokenRequest } from '../functions/generate-auth-token-request';\nimport {\n AppConfig,\n FirebaseInstallationsImpl\n} from '../interfaces/installation-impl';\nimport {\n AuthToken,\n CompletedAuthToken,\n InProgressAuthToken,\n InstallationEntry,\n RegisteredInstallationEntry,\n RequestStatus\n} from '../interfaces/installation-entry';\nimport { PENDING_TIMEOUT_MS, TOKEN_EXPIRATION_BUFFER } from '../util/constants';\nimport { ERROR_FACTORY, ErrorCode, isServerError } from '../util/errors';\nimport { sleep } from '../util/sleep';\nimport { remove, set, update } from './idb-manager';\n\n/**\n * Returns a valid authentication token for the installation. Generates a new\n * token if one doesn't exist, is expired or about to expire.\n *\n * Should only be called if the Firebase Installation is registered.\n */\nexport async function refreshAuthToken(\n installations: FirebaseInstallationsImpl,\n forceRefresh = false\n): Promise<CompletedAuthToken> {\n let tokenPromise: Promise<CompletedAuthToken> | undefined;\n const entry = await update(installations.appConfig, oldEntry => {\n if (!isEntryRegistered(oldEntry)) {\n throw ERROR_FACTORY.create(ErrorCode.NOT_REGISTERED);\n }\n\n const oldAuthToken = oldEntry.authToken;\n if (!forceRefresh && isAuthTokenValid(oldAuthToken)) {\n // There is a valid token in the DB.\n return oldEntry;\n } else if (oldAuthToken.requestStatus === RequestStatus.IN_PROGRESS) {\n // There already is a token request in progress.\n tokenPromise = waitUntilAuthTokenRequest(installations, forceRefresh);\n return oldEntry;\n } else {\n // No token or token expired.\n if (!navigator.onLine) {\n throw ERROR_FACTORY.create(ErrorCode.APP_OFFLINE);\n }\n\n const inProgressEntry = makeAuthTokenRequestInProgressEntry(oldEntry);\n tokenPromise = fetchAuthTokenFromServer(installations, inProgressEntry);\n return inProgressEntry;\n }\n });\n\n const authToken = tokenPromise\n ? await tokenPromise\n : (entry.authToken as CompletedAuthToken);\n return authToken;\n}\n\n/**\n * Call only if FID is registered and Auth Token request is in progress.\n *\n * Waits until the current pending request finishes. If the request times out,\n * tries once in this thread as well.\n */\nasync function waitUntilAuthTokenRequest(\n installations: FirebaseInstallationsImpl,\n forceRefresh: boolean\n): Promise<CompletedAuthToken> {\n // Unfortunately, there is no way of reliably observing when a value in\n // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers),\n // so we need to poll.\n\n let entry = await updateAuthTokenRequest(installations.appConfig);\n while (entry.authToken.requestStatus === RequestStatus.IN_PROGRESS) {\n // generateAuthToken still in progress.\n await sleep(100);\n\n entry = await updateAuthTokenRequest(installations.appConfig);\n }\n\n const authToken = entry.authToken;\n if (authToken.requestStatus === RequestStatus.NOT_STARTED) {\n // The request timed out or failed in a different call. Try again.\n return refreshAuthToken(installations, forceRefresh);\n } else {\n return authToken;\n }\n}\n\n/**\n * Called only if there is a GenerateAuthToken request in progress.\n *\n * Updates the InstallationEntry in the DB based on the status of the\n * GenerateAuthToken request.\n *\n * Returns the updated InstallationEntry.\n */\nfunction updateAuthTokenRequest(\n appConfig: AppConfig\n): Promise<RegisteredInstallationEntry> {\n return update(appConfig, oldEntry => {\n if (!isEntryRegistered(oldEntry)) {\n throw ERROR_FACTORY.create(ErrorCode.NOT_REGISTERED);\n }\n\n const oldAuthToken = oldEntry.authToken;\n if (hasAuthTokenRequestTimedOut(oldAuthToken)) {\n return {\n ...oldEntry,\n authToken: { requestStatus: RequestStatus.NOT_STARTED }\n };\n }\n\n return oldEntry;\n });\n}\n\nasync function fetchAuthTokenFromServer(\n installations: FirebaseInstallationsImpl,\n installationEntry: RegisteredInstallationEntry\n): Promise<CompletedAuthToken> {\n try {\n const authToken = await generateAuthTokenRequest(\n installations,\n installationEntry\n );\n const updatedInstallationEntry: RegisteredInstallationEntry = {\n ...installationEntry,\n authToken\n };\n await set(installations.appConfig, updatedInstallationEntry);\n return authToken;\n } catch (e) {\n if (\n isServerError(e) &&\n (e.customData.serverCode === 401 || e.customData.serverCode === 404)\n ) {\n // Server returned a \"FID not found\" or a \"Invalid authentication\" error.\n // Generate a new ID next time.\n await remove(installations.appConfig);\n } else {\n const updatedInstallationEntry: RegisteredInstallationEntry = {\n ...installationEntry,\n authToken: { requestStatus: RequestStatus.NOT_STARTED }\n };\n await set(installations.appConfig, updatedInstallationEntry);\n }\n throw e;\n }\n}\n\nfunction isEntryRegistered(\n installationEntry: InstallationEntry | undefined\n): installationEntry is RegisteredInstallationEntry {\n return (\n installationEntry !== undefined &&\n installationEntry.registrationStatus === RequestStatus.COMPLETED\n );\n}\n\nfunction isAuthTokenValid(authToken: AuthToken): boolean {\n return (\n authToken.requestStatus === RequestStatus.COMPLETED &&\n !isAuthTokenExpired(authToken)\n );\n}\n\nfunction isAuthTokenExpired(authToken: CompletedAuthToken): boolean {\n const now = Date.now();\n return (\n now < authToken.creationTime ||\n authToken.creationTime + authToken.expiresIn < now + TOKEN_EXPIRATION_BUFFER\n );\n}\n\n/** Returns an updated InstallationEntry with an InProgressAuthToken. */\nfunction makeAuthTokenRequestInProgressEntry(\n oldEntry: RegisteredInstallationEntry\n): RegisteredInstallationEntry {\n const inProgressAuthToken: InProgressAuthToken = {\n requestStatus: RequestStatus.IN_PROGRESS,\n requestTime: Date.now()\n };\n return {\n ...oldEntry,\n authToken: inProgressAuthToken\n };\n}\n\nfunction hasAuthTokenRequestTimedOut(authToken: AuthToken): boolean {\n return (\n authToken.requestStatus === RequestStatus.IN_PROGRESS &&\n authToken.requestTime + PENDING_TIMEOUT_MS < Date.now()\n );\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getInstallationEntry } from '../helpers/get-installation-entry';\nimport { refreshAuthToken } from '../helpers/refresh-auth-token';\nimport { FirebaseInstallationsImpl } from '../interfaces/installation-impl';\nimport { Installations } from '../interfaces/public-types';\n\n/**\n * Creates a Firebase Installation if there isn't one for the app and\n * returns the Installation ID.\n * @param installations - The `Installations` instance.\n *\n * @public\n */\nexport async function getId(installations: Installations): Promise<string> {\n const installationsImpl = installations as FirebaseInstallationsImpl;\n const { installationEntry, registrationPromise } = await getInstallationEntry(\n installationsImpl\n );\n\n if (registrationPromise) {\n registrationPromise.catch(console.error);\n } else {\n // If the installation is already registered, update the authentication\n // token if needed.\n refreshAuthToken(installationsImpl).catch(console.error);\n }\n\n return installationEntry.fid;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getInstallationEntry } from '../helpers/get-installation-entry';\nimport { refreshAuthToken } from '../helpers/refresh-auth-token';\nimport { FirebaseInstallationsImpl } from '../interfaces/installation-impl';\nimport { Installations } from '../interfaces/public-types';\n\n/**\n * Returns a Firebase Installations auth token, identifying the current\n * Firebase Installation.\n * @param installations - The `Installations` instance.\n * @param forceRefresh - Force refresh regardless of token expiration.\n *\n * @public\n */\nexport async function getToken(\n installations: Installations,\n forceRefresh = false\n): Promise<string> {\n const installationsImpl = installations as FirebaseInstallationsImpl;\n await completeInstallationRegistration(installationsImpl);\n\n // At this point we either have a Registered Installation in the DB, or we've\n // already thrown an error.\n const authToken = await refreshAuthToken(installationsImpl, forceRefresh);\n return authToken.token;\n}\n\nasync function completeInstallationRegistration(\n installations: FirebaseInstallationsImpl\n): Promise<void> {\n const { registrationPromise } = await getInstallationEntry(installations);\n\n if (registrationPromise) {\n // A createInstallation request is in progress. Wait until it finishes.\n await registrationPromise;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AppConfig } from '../interfaces/installation-impl';\nimport { RegisteredInstallationEntry } from '../interfaces/installation-entry';\nimport {\n getErrorFromResponse,\n getHeadersWithAuth,\n getInstallationsEndpoint,\n retryIfServerError\n} from './common';\n\nexport async function deleteInstallationRequest(\n appConfig: AppConfig,\n installationEntry: RegisteredInstallationEntry\n): Promise<void> {\n const endpoint = getDeleteEndpoint(appConfig, installationEntry);\n\n const headers = getHeadersWithAuth(appConfig, installationEntry);\n const request: RequestInit = {\n method: 'DELETE',\n headers\n };\n\n const response = await retryIfServerError(() => fetch(endpoint, request));\n if (!response.ok) {\n throw await getErrorFromResponse('Delete Installation', response);\n }\n}\n\nfunction getDeleteEndpoint(\n appConfig: AppConfig,\n { fid }: RegisteredInstallationEntry\n): string {\n return `${getInstallationsEndpoint(appConfig)}/${fid}`;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { deleteInstallationRequest } from '../functions/delete-installation-request';\nimport { remove, update } from '../helpers/idb-manager';\nimport { RequestStatus } from '../interfaces/installation-entry';\nimport { ERROR_FACTORY, ErrorCode } from '../util/errors';\nimport { FirebaseInstallationsImpl } from '../interfaces/installation-impl';\nimport { Installations } from '../interfaces/public-types';\n\n/**\n * Deletes the Firebase Installation and all associated data.\n * @param installations - The `Installations` instance.\n *\n * @public\n */\nexport async function deleteInstallations(\n installations: Installations\n): Promise<void> {\n const { appConfig } = installations as FirebaseInstallationsImpl;\n\n const entry = await update(appConfig, oldEntry => {\n if (oldEntry && oldEntry.registrationStatus === RequestStatus.NOT_STARTED) {\n // Delete the unregistered entry without sending a deleteInstallation request.\n return undefined;\n }\n return oldEntry;\n });\n\n if (entry) {\n if (entry.registrationStatus === RequestStatus.IN_PROGRESS) {\n // Can't delete while trying to register.\n throw ERROR_FACTORY.create(ErrorCode.DELETE_PENDING_REGISTRATION);\n } else if (entry.registrationStatus === RequestStatus.COMPLETED) {\n if (!navigator.onLine) {\n throw ERROR_FACTORY.create(ErrorCode.APP_OFFLINE);\n } else {\n await deleteInstallationRequest(appConfig, entry);\n await remove(appConfig);\n }\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { addCallback, removeCallback } from '../helpers/fid-changed';\nimport { FirebaseInstallationsImpl } from '../interfaces/installation-impl';\nimport { Installations } from '../interfaces/public-types';\n\n/**\n * An user defined callback function that gets called when Installations ID changes.\n *\n * @public\n */\nexport type IdChangeCallbackFn = (installationId: string) => void;\n/**\n * Unsubscribe a callback function previously added via {@link IdChangeCallbackFn}.\n *\n * @public\n */\nexport type IdChangeUnsubscribeFn = () => void;\n\n/**\n * Sets a new callback that will get called when Installation ID changes.\n * Returns an unsubscribe function that will remove the callback when called.\n * @param installations - The `Installations` instance.\n * @param callback - The callback function that is invoked when FID changes.\n * @returns A function that can be called to unsubscribe.\n *\n * @public\n */\nexport function onIdChange(\n installations: Installations,\n callback: IdChangeCallbackFn\n): IdChangeUnsubscribeFn {\n const { appConfig } = installations as FirebaseInstallationsImpl;\n\n addCallback(appConfig, callback);\n return () => {\n removeCallback(appConfig, callback);\n };\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, getApp, _getProvider } from '@firebase/app';\nimport { Installations } from '../interfaces/public-types';\n\n/**\n * Returns an instance of {@link Installations} associated with the given\n * {@link @firebase/app#FirebaseApp} instance.\n * @param app - The {@link @firebase/app#FirebaseApp} instance.\n *\n * @public\n */\nexport function getInstallations(app: FirebaseApp = getApp()): Installations {\n const installationsImpl = _getProvider(app, 'installations').getImmediate();\n return installationsImpl;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, FirebaseOptions } from '@firebase/app';\nimport { FirebaseError } from '@firebase/util';\nimport { AppConfig } from '../interfaces/installation-impl';\nimport { ERROR_FACTORY, ErrorCode } from '../util/errors';\n\nexport function extractAppConfig(app: FirebaseApp): AppConfig {\n if (!app || !app.options) {\n throw getMissingValueError('App Configuration');\n }\n\n if (!app.name) {\n throw getMissingValueError('App Name');\n }\n\n // Required app config keys\n const configKeys: Array<keyof FirebaseOptions> = [\n 'projectId',\n 'apiKey',\n 'appId'\n ];\n\n for (const keyName of configKeys) {\n if (!app.options[keyName]) {\n throw getMissingValueError(keyName);\n }\n }\n\n return {\n appName: app.name,\n projectId: app.options.projectId!,\n apiKey: app.options.apiKey!,\n appId: app.options.appId!\n };\n}\n\nfunction getMissingValueError(valueName: string): FirebaseError {\n return ERROR_FACTORY.create(ErrorCode.MISSING_APP_CONFIG_VALUES, {\n valueName\n });\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { _registerComponent, _getProvider } from '@firebase/app';\nimport {\n Component,\n ComponentType,\n InstanceFactory,\n ComponentContainer\n} from '@firebase/component';\nimport { getId, getToken } from '../api/index';\nimport { _FirebaseInstallationsInternal } from '../interfaces/public-types';\nimport { FirebaseInstallationsImpl } from '../interfaces/installation-impl';\nimport { extractAppConfig } from '../helpers/extract-app-config';\n\nconst INSTALLATIONS_NAME = 'installations';\nconst INSTALLATIONS_NAME_INTERNAL = 'installations-internal';\n\nconst publicFactory: InstanceFactory<'installations'> = (\n container: ComponentContainer\n) => {\n const app = container.getProvider('app').getImmediate();\n // Throws if app isn't configured properly.\n const appConfig = extractAppConfig(app);\n const heartbeatServiceProvider = _getProvider(app, 'heartbeat');\n\n const installationsImpl: FirebaseInstallationsImpl = {\n app,\n appConfig,\n heartbeatServiceProvider,\n _delete: () => Promise.resolve()\n };\n return installationsImpl;\n};\n\nconst internalFactory: InstanceFactory<'installations-internal'> = (\n container: ComponentContainer\n) => {\n const app = container.getProvider('app').getImmediate();\n // Internal FIS instance relies on public FIS instance.\n const installations = _getProvider(app, INSTALLATIONS_NAME).getImmediate();\n\n const installationsInternal: _FirebaseInstallationsInternal = {\n getId: () => getId(installations),\n getToken: (forceRefresh?: boolean) => getToken(installations, forceRefresh)\n };\n return installationsInternal;\n};\n\nexport function registerInstallations(): void {\n _registerComponent(\n new Component(INSTALLATIONS_NAME, publicFactory, ComponentType.PUBLIC)\n );\n _registerComponent(\n new Component(\n INSTALLATIONS_NAME_INTERNAL,\n internalFactory,\n ComponentType.PRIVATE\n )\n );\n}\n","/**\n * The Firebase Installations Web SDK.\n * This SDK does not work in a Node.js environment.\n *\n * @packageDocumentation\n */\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { registerInstallations } from './functions/config';\nimport { registerVersion } from '@firebase/app';\nimport { name, version } from '../package.json';\n\nexport * from './api';\nexport * from './interfaces/public-types';\n\nregisterInstallations();\nregisterVersion(name, version);\n// BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation\nregisterVersion(name, version, '__BUILD_TARGET__');\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAII,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAEjC,MAAM,eAAe,GAAG,CAAK,EAAA,EAAA,OAAO,EAAE,CAAC;AACvC,MAAM,qBAAqB,GAAG,QAAQ,CAAC;AAEvC,MAAM,qBAAqB,GAChC,iDAAiD,CAAC;AAE7C,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE/C,MAAM,OAAO,GAAG,eAAe,CAAC;AAChC,MAAM,YAAY,GAAG,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AA,6BAAA,CACF,CAAC;AACJ;;AC1EA;;;;;AAKG;AA0BH,qBAAqB,EAAE,CAAC;AACxB,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/B;AACA,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,SAAkB,CAAC;;;;"}
\ No newline at end of file diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/package.json b/frontend-old/node_modules/@firebase/installations/dist/esm/package.json deleted file mode 100644 index 7c34deb..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"}
\ No newline at end of file diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/delete-installations.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/delete-installations.d.ts deleted file mode 100644 index 071ce49..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/delete-installations.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { Installations } from '../interfaces/public-types'; -/** - * Deletes the Firebase Installation and all associated data. - * @param installations - The `Installations` instance. - * - * @public - */ -export declare function deleteInstallations(installations: Installations): Promise<void>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/get-id.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/get-id.d.ts deleted file mode 100644 index 7041940..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/get-id.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { Installations } from '../interfaces/public-types'; -/** - * Creates a Firebase Installation if there isn't one for the app and - * returns the Installation ID. - * @param installations - The `Installations` instance. - * - * @public - */ -export declare function getId(installations: Installations): Promise<string>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/get-installations.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/get-installations.d.ts deleted file mode 100644 index e79d514..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/get-installations.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * 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. - */ -import { FirebaseApp } from '@firebase/app'; -import { Installations } from '../interfaces/public-types'; -/** - * Returns an instance of {@link Installations} associated with the given - * {@link @firebase/app#FirebaseApp} instance. - * @param app - The {@link @firebase/app#FirebaseApp} instance. - * - * @public - */ -export declare function getInstallations(app?: FirebaseApp): Installations; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/get-token.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/get-token.d.ts deleted file mode 100644 index 28b2aed..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/get-token.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { Installations } from '../interfaces/public-types'; -/** - * Returns a Firebase Installations auth token, identifying the current - * Firebase Installation. - * @param installations - The `Installations` instance. - * @param forceRefresh - Force refresh regardless of token expiration. - * - * @public - */ -export declare function getToken(installations: Installations, forceRefresh?: boolean): Promise<string>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/index.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/index.d.ts deleted file mode 100644 index 9af626f..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -export * from './get-id'; -export * from './get-token'; -export * from './delete-installations'; -export * from './on-id-change'; -export * from './get-installations'; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/on-id-change.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/on-id-change.d.ts deleted file mode 100644 index 5f7811e..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/api/on-id-change.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { Installations } from '../interfaces/public-types'; -/** - * An user defined callback function that gets called when Installations ID changes. - * - * @public - */ -export type IdChangeCallbackFn = (installationId: string) => void; -/** - * Unsubscribe a callback function previously added via {@link IdChangeCallbackFn}. - * - * @public - */ -export type IdChangeUnsubscribeFn = () => void; -/** - * Sets a new callback that will get called when Installation ID changes. - * Returns an unsubscribe function that will remove the callback when called. - * @param installations - The `Installations` instance. - * @param callback - The callback function that is invoked when FID changes. - * @returns A function that can be called to unsubscribe. - * - * @public - */ -export declare function onIdChange(installations: Installations, callback: IdChangeCallbackFn): IdChangeUnsubscribeFn; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/common.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/common.d.ts deleted file mode 100644 index d592734..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/common.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { FirebaseError } from '@firebase/util'; -import { GenerateAuthTokenResponse } from '../interfaces/api-response'; -import { CompletedAuthToken, RegisteredInstallationEntry } from '../interfaces/installation-entry'; -import { AppConfig } from '../interfaces/installation-impl'; -export declare function getInstallationsEndpoint({ projectId }: AppConfig): string; -export declare function extractAuthTokenInfoFromResponse(response: GenerateAuthTokenResponse): CompletedAuthToken; -export declare function getErrorFromResponse(requestName: string, response: Response): Promise<FirebaseError>; -export declare function getHeaders({ apiKey }: AppConfig): Headers; -export declare function getHeadersWithAuth(appConfig: AppConfig, { refreshToken }: RegisteredInstallationEntry): Headers; -export interface ErrorResponse { - error: { - code: number; - message: string; - status: string; - }; -} -/** - * Calls the passed in fetch wrapper and returns the response. - * If the returned response has a status of 5xx, re-runs the function once and - * returns the response. - */ -export declare function retryIfServerError(fn: () => Promise<Response>): Promise<Response>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/config.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/config.d.ts deleted file mode 100644 index 06082e0..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/config.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * 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. - */ -export declare function registerInstallations(): void; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/create-installation-request.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/create-installation-request.d.ts deleted file mode 100644 index d1997d5..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/create-installation-request.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { InProgressInstallationEntry, RegisteredInstallationEntry } from '../interfaces/installation-entry'; -import { FirebaseInstallationsImpl } from '../interfaces/installation-impl'; -export declare function createInstallationRequest({ appConfig, heartbeatServiceProvider }: FirebaseInstallationsImpl, { fid }: InProgressInstallationEntry): Promise<RegisteredInstallationEntry>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/delete-installation-request.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/delete-installation-request.d.ts deleted file mode 100644 index d8dfda8..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/delete-installation-request.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { AppConfig } from '../interfaces/installation-impl'; -import { RegisteredInstallationEntry } from '../interfaces/installation-entry'; -export declare function deleteInstallationRequest(appConfig: AppConfig, installationEntry: RegisteredInstallationEntry): Promise<void>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/generate-auth-token-request.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/generate-auth-token-request.d.ts deleted file mode 100644 index 7b4179e..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/functions/generate-auth-token-request.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { CompletedAuthToken, RegisteredInstallationEntry } from '../interfaces/installation-entry'; -import { FirebaseInstallationsImpl } from '../interfaces/installation-impl'; -export declare function generateAuthTokenRequest({ appConfig, heartbeatServiceProvider }: FirebaseInstallationsImpl, installationEntry: RegisteredInstallationEntry): Promise<CompletedAuthToken>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/buffer-to-base64-url-safe.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/buffer-to-base64-url-safe.d.ts deleted file mode 100644 index 19bcb44..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/buffer-to-base64-url-safe.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -export declare function bufferToBase64UrlSafe(array: Uint8Array): string; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/extract-app-config.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/extract-app-config.d.ts deleted file mode 100644 index 4293d64..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/extract-app-config.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { FirebaseApp } from '@firebase/app'; -import { AppConfig } from '../interfaces/installation-impl'; -export declare function extractAppConfig(app: FirebaseApp): AppConfig; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/fid-changed.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/fid-changed.d.ts deleted file mode 100644 index 58dcb38..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/fid-changed.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { AppConfig } from '../interfaces/installation-impl'; -import { IdChangeCallbackFn } from '../api'; -/** - * Calls the onIdChange callbacks with the new FID value, and broadcasts the - * change to other tabs. - */ -export declare function fidChanged(appConfig: AppConfig, fid: string): void; -export declare function addCallback(appConfig: AppConfig, callback: IdChangeCallbackFn): void; -export declare function removeCallback(appConfig: AppConfig, callback: IdChangeCallbackFn): void; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/generate-fid.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/generate-fid.d.ts deleted file mode 100644 index a1a8f8d..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/generate-fid.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -export declare const VALID_FID_PATTERN: RegExp; -export declare const INVALID_FID = ""; -/** - * Generates a new FID using random values from Web Crypto API. - * Returns an empty string if FID generation fails for any reason. - */ -export declare function generateFid(): string; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/get-installation-entry.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/get-installation-entry.d.ts deleted file mode 100644 index 1b0355f..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/get-installation-entry.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { FirebaseInstallationsImpl } from '../interfaces/installation-impl'; -import { InstallationEntry, RegisteredInstallationEntry } from '../interfaces/installation-entry'; -export interface InstallationEntryWithRegistrationPromise { - installationEntry: InstallationEntry; - /** Exist iff the installationEntry is not registered. */ - registrationPromise?: Promise<RegisteredInstallationEntry>; -} -/** - * Updates and returns the InstallationEntry from the database. - * Also triggers a registration request if it is necessary and possible. - */ -export declare function getInstallationEntry(installations: FirebaseInstallationsImpl): Promise<InstallationEntryWithRegistrationPromise>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/idb-manager.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/idb-manager.d.ts deleted file mode 100644 index 8ee7efa..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/idb-manager.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { AppConfig } from '../interfaces/installation-impl'; -import { InstallationEntry } from '../interfaces/installation-entry'; -/** Gets record(s) from the objectStore that match the given key. */ -export declare function get(appConfig: AppConfig): Promise<InstallationEntry | undefined>; -/** Assigns or overwrites the record for the given key with the given value. */ -export declare function set<ValueType extends InstallationEntry>(appConfig: AppConfig, value: ValueType): Promise<ValueType>; -/** Removes record(s) from the objectStore that match the given key. */ -export declare function remove(appConfig: AppConfig): Promise<void>; -/** - * Atomically updates a record with the result of updateFn, which gets - * called with the current value. If newValue is undefined, the record is - * deleted instead. - * @return Updated value - */ -export declare function update<ValueType extends InstallationEntry | undefined>(appConfig: AppConfig, updateFn: (previousValue: InstallationEntry | undefined) => ValueType): Promise<ValueType>; -export declare function clear(): Promise<void>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/refresh-auth-token.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/refresh-auth-token.d.ts deleted file mode 100644 index 9bf6c6b..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/helpers/refresh-auth-token.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { FirebaseInstallationsImpl } from '../interfaces/installation-impl'; -import { CompletedAuthToken } from '../interfaces/installation-entry'; -/** - * Returns a valid authentication token for the installation. Generates a new - * token if one doesn't exist, is expired or about to expire. - * - * Should only be called if the Firebase Installation is registered. - */ -export declare function refreshAuthToken(installations: FirebaseInstallationsImpl, forceRefresh?: boolean): Promise<CompletedAuthToken>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/index.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/index.d.ts deleted file mode 100644 index 8059f56..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * The Firebase Installations Web SDK. - * This SDK does not work in a Node.js environment. - * - * @packageDocumentation - */ -export * from './api'; -export * from './interfaces/public-types'; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/interfaces/api-response.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/interfaces/api-response.d.ts deleted file mode 100644 index b7ab7fa..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/interfaces/api-response.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -export interface CreateInstallationResponse { - readonly refreshToken: string; - readonly authToken: GenerateAuthTokenResponse; - readonly fid?: string; -} -export interface GenerateAuthTokenResponse { - readonly token: string; - /** - * Encoded as a string with the suffix 's' (indicating seconds), preceded by - * the number of seconds. - * - * Example: "604800s". - */ - readonly expiresIn: string; -} diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/interfaces/installation-entry.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/interfaces/installation-entry.d.ts deleted file mode 100644 index fbdc655..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/interfaces/installation-entry.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** Status of a server request. */ -export declare const enum RequestStatus { - NOT_STARTED = 0, - IN_PROGRESS = 1, - COMPLETED = 2 -} -export interface NotStartedAuthToken { - readonly requestStatus: RequestStatus.NOT_STARTED; -} -export interface InProgressAuthToken { - readonly requestStatus: RequestStatus.IN_PROGRESS; - /** - * Unix timestamp when the current generateAuthRequest was initiated. - * Used for figuring out how long the request status has been IN_PROGRESS. - */ - readonly requestTime: number; -} -export interface CompletedAuthToken { - readonly requestStatus: RequestStatus.COMPLETED; - /** - * Firebase Installations Authentication Token. - * Only exists if requestStatus is COMPLETED. - */ - readonly token: string; - /** - * Unix timestamp when Authentication Token was created. - * Only exists if requestStatus is COMPLETED. - */ - readonly creationTime: number; - /** - * Authentication Token time to live duration in milliseconds. - * Only exists if requestStatus is COMPLETED. - */ - readonly expiresIn: number; -} -export type AuthToken = NotStartedAuthToken | InProgressAuthToken | CompletedAuthToken; -export interface UnregisteredInstallationEntry { - /** Status of the Firebase Installation registration on the server. */ - readonly registrationStatus: RequestStatus.NOT_STARTED; - /** Firebase Installation ID */ - readonly fid: string; -} -export interface InProgressInstallationEntry { - /** Status of the Firebase Installation registration on the server. */ - readonly registrationStatus: RequestStatus.IN_PROGRESS; - /** - * Unix timestamp that shows the time when the current createInstallation - * request was initiated. - * Used for figuring out how long the registration status has been PENDING. - */ - readonly registrationTime: number; - /** Firebase Installation ID */ - readonly fid: string; -} -export interface RegisteredInstallationEntry { - /** Status of the Firebase Installation registration on the server. */ - readonly registrationStatus: RequestStatus.COMPLETED; - /** Firebase Installation ID */ - readonly fid: string; - /** - * Refresh Token returned from the server. - * Used for authenticating generateAuthToken requests. - */ - readonly refreshToken: string; - /** Firebase Installation Authentication Token. */ - readonly authToken: AuthToken; -} -/** Firebase Installation ID and related data in the database. */ -export type InstallationEntry = UnregisteredInstallationEntry | InProgressInstallationEntry | RegisteredInstallationEntry; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/interfaces/installation-impl.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/interfaces/installation-impl.d.ts deleted file mode 100644 index 5c7f8d0..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/interfaces/installation-impl.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * 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. - */ -import { Provider } from '@firebase/component'; -import { _FirebaseService } from '@firebase/app'; -import { Installations } from '../interfaces/public-types'; -export interface FirebaseInstallationsImpl extends Installations, _FirebaseService { - readonly appConfig: AppConfig; - readonly heartbeatServiceProvider: Provider<'heartbeat'>; -} -export interface AppConfig { - readonly appName: string; - readonly projectId: string; - readonly apiKey: string; - readonly appId: string; -} diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/interfaces/public-types.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/interfaces/public-types.d.ts deleted file mode 100644 index 794511e..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/interfaces/public-types.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * 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. - */ -import { FirebaseApp } from '@firebase/app'; -/** - * Public interface of the Firebase Installations SDK. - * - * @public - */ -export interface Installations { - /** - * The {@link @firebase/app#FirebaseApp} this `Installations` instance is associated with. - */ - app: FirebaseApp; -} -/** - * An interface for Firebase internal SDKs use only. - * - * @internal - */ -export interface _FirebaseInstallationsInternal { - /** - * Creates a Firebase Installation if there isn't one for the app and - * returns the Installation ID. - */ - getId(): Promise<string>; - /** - * Returns an Authentication Token for the current Firebase Installation. - */ - getToken(forceRefresh?: boolean): Promise<string>; -} -declare module '@firebase/component' { - interface NameServiceMapping { - 'installations': Installations; - 'installations-internal': _FirebaseInstallationsInternal; - } -} diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/testing/compare-headers.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/testing/compare-headers.d.ts deleted file mode 100644 index 11bff68..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/testing/compare-headers.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -declare class HeadersWithEntries extends Headers { - entries?(): Iterable<[string, string]>; -} -export declare function compareHeaders(expectedHeaders: HeadersWithEntries, actualHeaders: HeadersWithEntries): void; -export {}; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/testing/fake-generators.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/testing/fake-generators.d.ts deleted file mode 100644 index c03290f..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/testing/fake-generators.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { FirebaseApp } from '@firebase/app'; -import { FirebaseInstallationsImpl, AppConfig } from '../interfaces/installation-impl'; -export declare function getFakeApp(): FirebaseApp; -export declare function getFakeAppConfig(customValues?: Partial<AppConfig>): AppConfig; -export declare function getFakeInstallations(): FirebaseInstallationsImpl; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/testing/setup.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/testing/setup.d.ts deleted file mode 100644 index 1c93d90..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/testing/setup.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -export {}; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/util/constants.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/util/constants.d.ts deleted file mode 100644 index 1bef807..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/util/constants.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -export declare const PENDING_TIMEOUT_MS = 10000; -export declare const PACKAGE_VERSION: string; -export declare const INTERNAL_AUTH_VERSION = "FIS_v2"; -export declare const INSTALLATIONS_API_URL = "https://firebaseinstallations.googleapis.com/v1"; -export declare const TOKEN_EXPIRATION_BUFFER: number; -export declare const SERVICE = "installations"; -export declare const SERVICE_NAME = "Installations"; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/util/errors.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/util/errors.d.ts deleted file mode 100644 index 8d596b1..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/util/errors.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { ErrorFactory, FirebaseError } from '@firebase/util'; -export declare const enum ErrorCode { - MISSING_APP_CONFIG_VALUES = "missing-app-config-values", - NOT_REGISTERED = "not-registered", - INSTALLATION_NOT_FOUND = "installation-not-found", - REQUEST_FAILED = "request-failed", - APP_OFFLINE = "app-offline", - DELETE_PENDING_REGISTRATION = "delete-pending-registration" -} -interface ErrorParams { - [ErrorCode.MISSING_APP_CONFIG_VALUES]: { - valueName: string; - }; - [ErrorCode.REQUEST_FAILED]: { - requestName: string; - [index: string]: string | number; - } & ServerErrorData; -} -export declare const ERROR_FACTORY: ErrorFactory<ErrorCode, ErrorParams>; -export interface ServerErrorData { - serverCode: number; - serverMessage: string; - serverStatus: string; -} -export type ServerError = FirebaseError & { - customData: ServerErrorData; -}; -/** Returns true if error is a FirebaseError that is based on an error from the server. */ -export declare function isServerError(error: unknown): error is ServerError; -export {}; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/util/get-key.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/util/get-key.d.ts deleted file mode 100644 index 7b20b2e..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/util/get-key.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { AppConfig } from '../interfaces/installation-impl'; -/** Returns a string key that can be used to identify the app. */ -export declare function getKey(appConfig: AppConfig): string; diff --git a/frontend-old/node_modules/@firebase/installations/dist/esm/src/util/sleep.d.ts b/frontend-old/node_modules/@firebase/installations/dist/esm/src/util/sleep.d.ts deleted file mode 100644 index f51e6cd..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/esm/src/util/sleep.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** Returns a promise that resolves after given time passes. */ -export declare function sleep(ms: number): Promise<void>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/index.cjs.js b/frontend-old/node_modules/@firebase/installations/dist/index.cjs.js deleted file mode 100644 index 2520e79..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/index.cjs.js +++ /dev/null @@ -1,1175 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var app = require('@firebase/app'); -var component = require('@firebase/component'); -var util = require('@firebase/util'); -var idb = require('idb'); - -const name = "@firebase/installations"; -const version = "0.6.19"; - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 PENDING_TIMEOUT_MS = 10000; -const PACKAGE_VERSION = `w:${version}`; -const INTERNAL_AUTH_VERSION = 'FIS_v2'; -const INSTALLATIONS_API_URL = 'https://firebaseinstallations.googleapis.com/v1'; -const TOKEN_EXPIRATION_BUFFER = 60 * 60 * 1000; // One hour -const SERVICE = 'installations'; -const SERVICE_NAME = 'Installations'; - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 ERROR_DESCRIPTION_MAP = { - ["missing-app-config-values" /* ErrorCode.MISSING_APP_CONFIG_VALUES */]: 'Missing App configuration value: "{$valueName}"', - ["not-registered" /* ErrorCode.NOT_REGISTERED */]: 'Firebase Installation is not registered.', - ["installation-not-found" /* ErrorCode.INSTALLATION_NOT_FOUND */]: 'Firebase Installation not found.', - ["request-failed" /* ErrorCode.REQUEST_FAILED */]: '{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"', - ["app-offline" /* ErrorCode.APP_OFFLINE */]: 'Could not process request. Application offline.', - ["delete-pending-registration" /* ErrorCode.DELETE_PENDING_REGISTRATION */]: "Can't delete installation while there is a pending registration request." -}; -const ERROR_FACTORY = new util.ErrorFactory(SERVICE, SERVICE_NAME, ERROR_DESCRIPTION_MAP); -/** Returns true if error is a FirebaseError that is based on an error from the server. */ -function isServerError(error) { - return (error instanceof util.FirebaseError && - error.code.includes("request-failed" /* ErrorCode.REQUEST_FAILED */)); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 getInstallationsEndpoint({ projectId }) { - return `${INSTALLATIONS_API_URL}/projects/${projectId}/installations`; -} -function extractAuthTokenInfoFromResponse(response) { - return { - token: response.token, - requestStatus: 2 /* RequestStatus.COMPLETED */, - expiresIn: getExpiresInFromResponseExpiresIn(response.expiresIn), - creationTime: Date.now() - }; -} -async function getErrorFromResponse(requestName, response) { - const responseJson = await response.json(); - const errorData = responseJson.error; - return ERROR_FACTORY.create("request-failed" /* ErrorCode.REQUEST_FAILED */, { - requestName, - serverCode: errorData.code, - serverMessage: errorData.message, - serverStatus: errorData.status - }); -} -function getHeaders({ apiKey }) { - return new Headers({ - 'Content-Type': 'application/json', - Accept: 'application/json', - 'x-goog-api-key': apiKey - }); -} -function getHeadersWithAuth(appConfig, { refreshToken }) { - const headers = getHeaders(appConfig); - headers.append('Authorization', getAuthorizationHeader(refreshToken)); - return headers; -} -/** - * Calls the passed in fetch wrapper and returns the response. - * If the returned response has a status of 5xx, re-runs the function once and - * returns the response. - */ -async function retryIfServerError(fn) { - const result = await fn(); - if (result.status >= 500 && result.status < 600) { - // Internal Server Error. Retry request. - return fn(); - } - return result; -} -function getExpiresInFromResponseExpiresIn(responseExpiresIn) { - // This works because the server will never respond with fractions of a second. - return Number(responseExpiresIn.replace('s', '000')); -} -function getAuthorizationHeader(refreshToken) { - return `${INTERNAL_AUTH_VERSION} ${refreshToken}`; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -async function createInstallationRequest({ appConfig, heartbeatServiceProvider }, { fid }) { - const endpoint = getInstallationsEndpoint(appConfig); - const headers = getHeaders(appConfig); - // If heartbeat service exists, add the heartbeat string to the header. - const heartbeatService = heartbeatServiceProvider.getImmediate({ - optional: true - }); - if (heartbeatService) { - const heartbeatsHeader = await heartbeatService.getHeartbeatsHeader(); - if (heartbeatsHeader) { - headers.append('x-firebase-client', heartbeatsHeader); - } - } - const body = { - fid, - authVersion: INTERNAL_AUTH_VERSION, - appId: appConfig.appId, - sdkVersion: PACKAGE_VERSION - }; - const request = { - method: 'POST', - headers, - body: JSON.stringify(body) - }; - const response = await retryIfServerError(() => fetch(endpoint, request)); - if (response.ok) { - const responseValue = await response.json(); - const registeredInstallationEntry = { - fid: responseValue.fid || fid, - registrationStatus: 2 /* RequestStatus.COMPLETED */, - refreshToken: responseValue.refreshToken, - authToken: extractAuthTokenInfoFromResponse(responseValue.authToken) - }; - return registeredInstallationEntry; - } - else { - throw await getErrorFromResponse('Create Installation', response); - } -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** Returns a promise that resolves after given time passes. */ -function sleep(ms) { - return new Promise(resolve => { - setTimeout(resolve, ms); - }); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 bufferToBase64UrlSafe(array) { - const b64 = btoa(String.fromCharCode(...array)); - return b64.replace(/\+/g, '-').replace(/\//g, '_'); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 VALID_FID_PATTERN = /^[cdef][\w-]{21}$/; -const INVALID_FID = ''; -/** - * Generates a new FID using random values from Web Crypto API. - * Returns an empty string if FID generation fails for any reason. - */ -function generateFid() { - try { - // A valid FID has exactly 22 base64 characters, which is 132 bits, or 16.5 - // bytes. our implementation generates a 17 byte array instead. - const fidByteArray = new Uint8Array(17); - const crypto = self.crypto || self.msCrypto; - crypto.getRandomValues(fidByteArray); - // Replace the first 4 random bits with the constant FID header of 0b0111. - fidByteArray[0] = 0b01110000 + (fidByteArray[0] % 0b00010000); - const fid = encode(fidByteArray); - return VALID_FID_PATTERN.test(fid) ? fid : INVALID_FID; - } - catch { - // FID generation errored - return INVALID_FID; - } -} -/** Converts a FID Uint8Array to a base64 string representation. */ -function encode(fidByteArray) { - const b64String = bufferToBase64UrlSafe(fidByteArray); - // Remove the 23rd character that was added because of the extra 4 bits at the - // end of our 17 byte array, and the '=' padding. - return b64String.substr(0, 22); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** Returns a string key that can be used to identify the app. */ -function getKey(appConfig) { - return `${appConfig.appName}!${appConfig.appId}`; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 fidChangeCallbacks = new Map(); -/** - * Calls the onIdChange callbacks with the new FID value, and broadcasts the - * change to other tabs. - */ -function fidChanged(appConfig, fid) { - const key = getKey(appConfig); - callFidChangeCallbacks(key, fid); - broadcastFidChange(key, fid); -} -function addCallback(appConfig, callback) { - // Open the broadcast channel if it's not already open, - // to be able to listen to change events from other tabs. - getBroadcastChannel(); - const key = getKey(appConfig); - let callbackSet = fidChangeCallbacks.get(key); - if (!callbackSet) { - callbackSet = new Set(); - fidChangeCallbacks.set(key, callbackSet); - } - callbackSet.add(callback); -} -function removeCallback(appConfig, callback) { - const key = getKey(appConfig); - const callbackSet = fidChangeCallbacks.get(key); - if (!callbackSet) { - return; - } - callbackSet.delete(callback); - if (callbackSet.size === 0) { - fidChangeCallbacks.delete(key); - } - // Close broadcast channel if there are no more callbacks. - closeBroadcastChannel(); -} -function callFidChangeCallbacks(key, fid) { - const callbacks = fidChangeCallbacks.get(key); - if (!callbacks) { - return; - } - for (const callback of callbacks) { - callback(fid); - } -} -function broadcastFidChange(key, fid) { - const channel = getBroadcastChannel(); - if (channel) { - channel.postMessage({ key, fid }); - } - closeBroadcastChannel(); -} -let broadcastChannel = null; -/** Opens and returns a BroadcastChannel if it is supported by the browser. */ -function getBroadcastChannel() { - if (!broadcastChannel && 'BroadcastChannel' in self) { - broadcastChannel = new BroadcastChannel('[Firebase] FID Change'); - broadcastChannel.onmessage = e => { - callFidChangeCallbacks(e.data.key, e.data.fid); - }; - } - return broadcastChannel; -} -function closeBroadcastChannel() { - if (fidChangeCallbacks.size === 0 && broadcastChannel) { - broadcastChannel.close(); - broadcastChannel = null; - } -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 DATABASE_NAME = 'firebase-installations-database'; -const DATABASE_VERSION = 1; -const OBJECT_STORE_NAME = 'firebase-installations-store'; -let dbPromise = null; -function getDbPromise() { - if (!dbPromise) { - dbPromise = idb.openDB(DATABASE_NAME, DATABASE_VERSION, { - upgrade: (db, oldVersion) => { - // We don't use 'break' in this switch statement, the fall-through - // behavior is what we want, because if there are multiple versions between - // the old version and the current version, we want ALL the migrations - // that correspond to those versions to run, not only the last one. - // eslint-disable-next-line default-case - switch (oldVersion) { - case 0: - db.createObjectStore(OBJECT_STORE_NAME); - } - } - }); - } - return dbPromise; -} -/** Assigns or overwrites the record for the given key with the given value. */ -async function set(appConfig, value) { - const key = getKey(appConfig); - const db = await getDbPromise(); - const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite'); - const objectStore = tx.objectStore(OBJECT_STORE_NAME); - const oldValue = (await objectStore.get(key)); - await objectStore.put(value, key); - await tx.done; - if (!oldValue || oldValue.fid !== value.fid) { - fidChanged(appConfig, value.fid); - } - return value; -} -/** Removes record(s) from the objectStore that match the given key. */ -async function remove(appConfig) { - const key = getKey(appConfig); - const db = await getDbPromise(); - const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite'); - await tx.objectStore(OBJECT_STORE_NAME).delete(key); - await tx.done; -} -/** - * Atomically updates a record with the result of updateFn, which gets - * called with the current value. If newValue is undefined, the record is - * deleted instead. - * @return Updated value - */ -async function update(appConfig, updateFn) { - const key = getKey(appConfig); - const db = await getDbPromise(); - const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite'); - const store = tx.objectStore(OBJECT_STORE_NAME); - const oldValue = (await store.get(key)); - const newValue = updateFn(oldValue); - if (newValue === undefined) { - await store.delete(key); - } - else { - await store.put(newValue, key); - } - await tx.done; - if (newValue && (!oldValue || oldValue.fid !== newValue.fid)) { - fidChanged(appConfig, newValue.fid); - } - return newValue; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** - * Updates and returns the InstallationEntry from the database. - * Also triggers a registration request if it is necessary and possible. - */ -async function getInstallationEntry(installations) { - let registrationPromise; - const installationEntry = await update(installations.appConfig, oldEntry => { - const installationEntry = updateOrCreateInstallationEntry(oldEntry); - const entryWithPromise = triggerRegistrationIfNecessary(installations, installationEntry); - registrationPromise = entryWithPromise.registrationPromise; - return entryWithPromise.installationEntry; - }); - if (installationEntry.fid === INVALID_FID) { - // FID generation failed. Waiting for the FID from the server. - return { installationEntry: await registrationPromise }; - } - return { - installationEntry, - registrationPromise - }; -} -/** - * Creates a new Installation Entry if one does not exist. - * Also clears timed out pending requests. - */ -function updateOrCreateInstallationEntry(oldEntry) { - const entry = oldEntry || { - fid: generateFid(), - registrationStatus: 0 /* RequestStatus.NOT_STARTED */ - }; - return clearTimedOutRequest(entry); -} -/** - * If the Firebase Installation is not registered yet, this will trigger the - * registration and return an InProgressInstallationEntry. - * - * If registrationPromise does not exist, the installationEntry is guaranteed - * to be registered. - */ -function triggerRegistrationIfNecessary(installations, installationEntry) { - if (installationEntry.registrationStatus === 0 /* RequestStatus.NOT_STARTED */) { - if (!navigator.onLine) { - // Registration required but app is offline. - const registrationPromiseWithError = Promise.reject(ERROR_FACTORY.create("app-offline" /* ErrorCode.APP_OFFLINE */)); - return { - installationEntry, - registrationPromise: registrationPromiseWithError - }; - } - // Try registering. Change status to IN_PROGRESS. - const inProgressEntry = { - fid: installationEntry.fid, - registrationStatus: 1 /* RequestStatus.IN_PROGRESS */, - registrationTime: Date.now() - }; - const registrationPromise = registerInstallation(installations, inProgressEntry); - return { installationEntry: inProgressEntry, registrationPromise }; - } - else if (installationEntry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */) { - return { - installationEntry, - registrationPromise: waitUntilFidRegistration(installations) - }; - } - else { - return { installationEntry }; - } -} -/** This will be executed only once for each new Firebase Installation. */ -async function registerInstallation(installations, installationEntry) { - try { - const registeredInstallationEntry = await createInstallationRequest(installations, installationEntry); - return set(installations.appConfig, registeredInstallationEntry); - } - catch (e) { - if (isServerError(e) && e.customData.serverCode === 409) { - // Server returned a "FID cannot be used" error. - // Generate a new ID next time. - await remove(installations.appConfig); - } - else { - // Registration failed. Set FID as not registered. - await set(installations.appConfig, { - fid: installationEntry.fid, - registrationStatus: 0 /* RequestStatus.NOT_STARTED */ - }); - } - throw e; - } -} -/** Call if FID registration is pending in another request. */ -async function waitUntilFidRegistration(installations) { - // Unfortunately, there is no way of reliably observing when a value in - // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers), - // so we need to poll. - let entry = await updateInstallationRequest(installations.appConfig); - while (entry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */) { - // createInstallation request still in progress. - await sleep(100); - entry = await updateInstallationRequest(installations.appConfig); - } - if (entry.registrationStatus === 0 /* RequestStatus.NOT_STARTED */) { - // The request timed out or failed in a different call. Try again. - const { installationEntry, registrationPromise } = await getInstallationEntry(installations); - if (registrationPromise) { - return registrationPromise; - } - else { - // if there is no registrationPromise, entry is registered. - return installationEntry; - } - } - return entry; -} -/** - * Called only if there is a CreateInstallation request in progress. - * - * Updates the InstallationEntry in the DB based on the status of the - * CreateInstallation request. - * - * Returns the updated InstallationEntry. - */ -function updateInstallationRequest(appConfig) { - return update(appConfig, oldEntry => { - if (!oldEntry) { - throw ERROR_FACTORY.create("installation-not-found" /* ErrorCode.INSTALLATION_NOT_FOUND */); - } - return clearTimedOutRequest(oldEntry); - }); -} -function clearTimedOutRequest(entry) { - if (hasInstallationRequestTimedOut(entry)) { - return { - fid: entry.fid, - registrationStatus: 0 /* RequestStatus.NOT_STARTED */ - }; - } - return entry; -} -function hasInstallationRequestTimedOut(installationEntry) { - return (installationEntry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */ && - installationEntry.registrationTime + PENDING_TIMEOUT_MS < Date.now()); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -async function generateAuthTokenRequest({ appConfig, heartbeatServiceProvider }, installationEntry) { - const endpoint = getGenerateAuthTokenEndpoint(appConfig, installationEntry); - const headers = getHeadersWithAuth(appConfig, installationEntry); - // If heartbeat service exists, add the heartbeat string to the header. - const heartbeatService = heartbeatServiceProvider.getImmediate({ - optional: true - }); - if (heartbeatService) { - const heartbeatsHeader = await heartbeatService.getHeartbeatsHeader(); - if (heartbeatsHeader) { - headers.append('x-firebase-client', heartbeatsHeader); - } - } - const body = { - installation: { - sdkVersion: PACKAGE_VERSION, - appId: appConfig.appId - } - }; - const request = { - method: 'POST', - headers, - body: JSON.stringify(body) - }; - const response = await retryIfServerError(() => fetch(endpoint, request)); - if (response.ok) { - const responseValue = await response.json(); - const completedAuthToken = extractAuthTokenInfoFromResponse(responseValue); - return completedAuthToken; - } - else { - throw await getErrorFromResponse('Generate Auth Token', response); - } -} -function getGenerateAuthTokenEndpoint(appConfig, { fid }) { - return `${getInstallationsEndpoint(appConfig)}/${fid}/authTokens:generate`; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** - * Returns a valid authentication token for the installation. Generates a new - * token if one doesn't exist, is expired or about to expire. - * - * Should only be called if the Firebase Installation is registered. - */ -async function refreshAuthToken(installations, forceRefresh = false) { - let tokenPromise; - const entry = await update(installations.appConfig, oldEntry => { - if (!isEntryRegistered(oldEntry)) { - throw ERROR_FACTORY.create("not-registered" /* ErrorCode.NOT_REGISTERED */); - } - const oldAuthToken = oldEntry.authToken; - if (!forceRefresh && isAuthTokenValid(oldAuthToken)) { - // There is a valid token in the DB. - return oldEntry; - } - else if (oldAuthToken.requestStatus === 1 /* RequestStatus.IN_PROGRESS */) { - // There already is a token request in progress. - tokenPromise = waitUntilAuthTokenRequest(installations, forceRefresh); - return oldEntry; - } - else { - // No token or token expired. - if (!navigator.onLine) { - throw ERROR_FACTORY.create("app-offline" /* ErrorCode.APP_OFFLINE */); - } - const inProgressEntry = makeAuthTokenRequestInProgressEntry(oldEntry); - tokenPromise = fetchAuthTokenFromServer(installations, inProgressEntry); - return inProgressEntry; - } - }); - const authToken = tokenPromise - ? await tokenPromise - : entry.authToken; - return authToken; -} -/** - * Call only if FID is registered and Auth Token request is in progress. - * - * Waits until the current pending request finishes. If the request times out, - * tries once in this thread as well. - */ -async function waitUntilAuthTokenRequest(installations, forceRefresh) { - // Unfortunately, there is no way of reliably observing when a value in - // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers), - // so we need to poll. - let entry = await updateAuthTokenRequest(installations.appConfig); - while (entry.authToken.requestStatus === 1 /* RequestStatus.IN_PROGRESS */) { - // generateAuthToken still in progress. - await sleep(100); - entry = await updateAuthTokenRequest(installations.appConfig); - } - const authToken = entry.authToken; - if (authToken.requestStatus === 0 /* RequestStatus.NOT_STARTED */) { - // The request timed out or failed in a different call. Try again. - return refreshAuthToken(installations, forceRefresh); - } - else { - return authToken; - } -} -/** - * Called only if there is a GenerateAuthToken request in progress. - * - * Updates the InstallationEntry in the DB based on the status of the - * GenerateAuthToken request. - * - * Returns the updated InstallationEntry. - */ -function updateAuthTokenRequest(appConfig) { - return update(appConfig, oldEntry => { - if (!isEntryRegistered(oldEntry)) { - throw ERROR_FACTORY.create("not-registered" /* ErrorCode.NOT_REGISTERED */); - } - const oldAuthToken = oldEntry.authToken; - if (hasAuthTokenRequestTimedOut(oldAuthToken)) { - return { - ...oldEntry, - authToken: { requestStatus: 0 /* RequestStatus.NOT_STARTED */ } - }; - } - return oldEntry; - }); -} -async function fetchAuthTokenFromServer(installations, installationEntry) { - try { - const authToken = await generateAuthTokenRequest(installations, installationEntry); - const updatedInstallationEntry = { - ...installationEntry, - authToken - }; - await set(installations.appConfig, updatedInstallationEntry); - return authToken; - } - catch (e) { - if (isServerError(e) && - (e.customData.serverCode === 401 || e.customData.serverCode === 404)) { - // Server returned a "FID not found" or a "Invalid authentication" error. - // Generate a new ID next time. - await remove(installations.appConfig); - } - else { - const updatedInstallationEntry = { - ...installationEntry, - authToken: { requestStatus: 0 /* RequestStatus.NOT_STARTED */ } - }; - await set(installations.appConfig, updatedInstallationEntry); - } - throw e; - } -} -function isEntryRegistered(installationEntry) { - return (installationEntry !== undefined && - installationEntry.registrationStatus === 2 /* RequestStatus.COMPLETED */); -} -function isAuthTokenValid(authToken) { - return (authToken.requestStatus === 2 /* RequestStatus.COMPLETED */ && - !isAuthTokenExpired(authToken)); -} -function isAuthTokenExpired(authToken) { - const now = Date.now(); - return (now < authToken.creationTime || - authToken.creationTime + authToken.expiresIn < now + TOKEN_EXPIRATION_BUFFER); -} -/** Returns an updated InstallationEntry with an InProgressAuthToken. */ -function makeAuthTokenRequestInProgressEntry(oldEntry) { - const inProgressAuthToken = { - requestStatus: 1 /* RequestStatus.IN_PROGRESS */, - requestTime: Date.now() - }; - return { - ...oldEntry, - authToken: inProgressAuthToken - }; -} -function hasAuthTokenRequestTimedOut(authToken) { - return (authToken.requestStatus === 1 /* RequestStatus.IN_PROGRESS */ && - authToken.requestTime + PENDING_TIMEOUT_MS < Date.now()); -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** - * Creates a Firebase Installation if there isn't one for the app and - * returns the Installation ID. - * @param installations - The `Installations` instance. - * - * @public - */ -async function getId(installations) { - const installationsImpl = installations; - const { installationEntry, registrationPromise } = await getInstallationEntry(installationsImpl); - if (registrationPromise) { - registrationPromise.catch(console.error); - } - else { - // If the installation is already registered, update the authentication - // token if needed. - refreshAuthToken(installationsImpl).catch(console.error); - } - return installationEntry.fid; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** - * Returns a Firebase Installations auth token, identifying the current - * Firebase Installation. - * @param installations - The `Installations` instance. - * @param forceRefresh - Force refresh regardless of token expiration. - * - * @public - */ -async function getToken(installations, forceRefresh = false) { - const installationsImpl = installations; - await completeInstallationRegistration(installationsImpl); - // At this point we either have a Registered Installation in the DB, or we've - // already thrown an error. - const authToken = await refreshAuthToken(installationsImpl, forceRefresh); - return authToken.token; -} -async function completeInstallationRegistration(installations) { - const { registrationPromise } = await getInstallationEntry(installations); - if (registrationPromise) { - // A createInstallation request is in progress. Wait until it finishes. - await registrationPromise; - } -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -async function deleteInstallationRequest(appConfig, installationEntry) { - const endpoint = getDeleteEndpoint(appConfig, installationEntry); - const headers = getHeadersWithAuth(appConfig, installationEntry); - const request = { - method: 'DELETE', - headers - }; - const response = await retryIfServerError(() => fetch(endpoint, request)); - if (!response.ok) { - throw await getErrorFromResponse('Delete Installation', response); - } -} -function getDeleteEndpoint(appConfig, { fid }) { - return `${getInstallationsEndpoint(appConfig)}/${fid}`; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** - * Deletes the Firebase Installation and all associated data. - * @param installations - The `Installations` instance. - * - * @public - */ -async function deleteInstallations(installations) { - const { appConfig } = installations; - const entry = await update(appConfig, oldEntry => { - if (oldEntry && oldEntry.registrationStatus === 0 /* RequestStatus.NOT_STARTED */) { - // Delete the unregistered entry without sending a deleteInstallation request. - return undefined; - } - return oldEntry; - }); - if (entry) { - if (entry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */) { - // Can't delete while trying to register. - throw ERROR_FACTORY.create("delete-pending-registration" /* ErrorCode.DELETE_PENDING_REGISTRATION */); - } - else if (entry.registrationStatus === 2 /* RequestStatus.COMPLETED */) { - if (!navigator.onLine) { - throw ERROR_FACTORY.create("app-offline" /* ErrorCode.APP_OFFLINE */); - } - else { - await deleteInstallationRequest(appConfig, entry); - await remove(appConfig); - } - } - } -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** - * Sets a new callback that will get called when Installation ID changes. - * Returns an unsubscribe function that will remove the callback when called. - * @param installations - The `Installations` instance. - * @param callback - The callback function that is invoked when FID changes. - * @returns A function that can be called to unsubscribe. - * - * @public - */ -function onIdChange(installations, callback) { - const { appConfig } = installations; - addCallback(appConfig, callback); - return () => { - removeCallback(appConfig, callback); - }; -} - -/** - * @license - * Copyright 2020 Google LLC - * - * 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. - */ -/** - * Returns an instance of {@link Installations} associated with the given - * {@link @firebase/app#FirebaseApp} instance. - * @param app - The {@link @firebase/app#FirebaseApp} instance. - * - * @public - */ -function getInstallations(app$1 = app.getApp()) { - const installationsImpl = app._getProvider(app$1, 'installations').getImmediate(); - return installationsImpl; -} - -/** - * @license - * Copyright 2019 Google LLC - * - * 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 extractAppConfig(app) { - if (!app || !app.options) { - throw getMissingValueError('App Configuration'); - } - if (!app.name) { - throw getMissingValueError('App Name'); - } - // Required app config keys - const configKeys = [ - 'projectId', - 'apiKey', - 'appId' - ]; - for (const keyName of configKeys) { - if (!app.options[keyName]) { - throw getMissingValueError(keyName); - } - } - return { - appName: app.name, - projectId: app.options.projectId, - apiKey: app.options.apiKey, - appId: app.options.appId - }; -} -function getMissingValueError(valueName) { - return ERROR_FACTORY.create("missing-app-config-values" /* ErrorCode.MISSING_APP_CONFIG_VALUES */, { - valueName - }); -} - -/** - * @license - * Copyright 2020 Google LLC - * - * 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 INSTALLATIONS_NAME = 'installations'; -const INSTALLATIONS_NAME_INTERNAL = 'installations-internal'; -const publicFactory = (container) => { - const app$1 = container.getProvider('app').getImmediate(); - // Throws if app isn't configured properly. - const appConfig = extractAppConfig(app$1); - const heartbeatServiceProvider = app._getProvider(app$1, 'heartbeat'); - const installationsImpl = { - app: app$1, - appConfig, - heartbeatServiceProvider, - _delete: () => Promise.resolve() - }; - return installationsImpl; -}; -const internalFactory = (container) => { - const app$1 = container.getProvider('app').getImmediate(); - // Internal FIS instance relies on public FIS instance. - const installations = app._getProvider(app$1, INSTALLATIONS_NAME).getImmediate(); - const installationsInternal = { - getId: () => getId(installations), - getToken: (forceRefresh) => getToken(installations, forceRefresh) - }; - return installationsInternal; -}; -function registerInstallations() { - app._registerComponent(new component.Component(INSTALLATIONS_NAME, publicFactory, "PUBLIC" /* ComponentType.PUBLIC */)); - app._registerComponent(new component.Component(INSTALLATIONS_NAME_INTERNAL, internalFactory, "PRIVATE" /* ComponentType.PRIVATE */)); -} - -/** - * The Firebase Installations Web SDK. - * This SDK does not work in a Node.js environment. - * - * @packageDocumentation - */ -registerInstallations(); -app.registerVersion(name, version); -// BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation -app.registerVersion(name, version, 'cjs2020'); - -exports.deleteInstallations = deleteInstallations; -exports.getId = getId; -exports.getInstallations = getInstallations; -exports.getToken = getToken; -exports.onIdChange = onIdChange; -//# sourceMappingURL=index.cjs.js.map diff --git a/frontend-old/node_modules/@firebase/installations/dist/index.cjs.js.map b/frontend-old/node_modules/@firebase/installations/dist/index.cjs.js.map deleted file mode 100644 index 79cb332..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/index.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.cjs.js","sources":["../src/util/constants.ts","../src/util/errors.ts","../src/functions/common.ts","../src/functions/create-installation-request.ts","../src/util/sleep.ts","../src/helpers/buffer-to-base64-url-safe.ts","../src/helpers/generate-fid.ts","../src/util/get-key.ts","../src/helpers/fid-changed.ts","../src/helpers/idb-manager.ts","../src/helpers/get-installation-entry.ts","../src/functions/generate-auth-token-request.ts","../src/helpers/refresh-auth-token.ts","../src/api/get-id.ts","../src/api/get-token.ts","../src/functions/delete-installation-request.ts","../src/api/delete-installations.ts","../src/api/on-id-change.ts","../src/api/get-installations.ts","../src/helpers/extract-app-config.ts","../src/functions/config.ts","../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { version } from '../../package.json';\n\nexport const PENDING_TIMEOUT_MS = 10000;\n\nexport const PACKAGE_VERSION = `w:${version}`;\nexport const INTERNAL_AUTH_VERSION = 'FIS_v2';\n\nexport const INSTALLATIONS_API_URL =\n 'https://firebaseinstallations.googleapis.com/v1';\n\nexport const TOKEN_EXPIRATION_BUFFER = 60 * 60 * 1000; // One hour\n\nexport const SERVICE = 'installations';\nexport const SERVICE_NAME = 'Installations';\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, FirebaseError } from '@firebase/util';\nimport { SERVICE, SERVICE_NAME } from './constants';\n\nexport const enum ErrorCode {\n MISSING_APP_CONFIG_VALUES = 'missing-app-config-values',\n NOT_REGISTERED = 'not-registered',\n INSTALLATION_NOT_FOUND = 'installation-not-found',\n REQUEST_FAILED = 'request-failed',\n APP_OFFLINE = 'app-offline',\n DELETE_PENDING_REGISTRATION = 'delete-pending-registration'\n}\n\nconst ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = {\n [ErrorCode.MISSING_APP_CONFIG_VALUES]:\n 'Missing App configuration value: \"{$valueName}\"',\n [ErrorCode.NOT_REGISTERED]: 'Firebase Installation is not registered.',\n [ErrorCode.INSTALLATION_NOT_FOUND]: 'Firebase Installation not found.',\n [ErrorCode.REQUEST_FAILED]:\n '{$requestName} request failed with error \"{$serverCode} {$serverStatus}: {$serverMessage}\"',\n [ErrorCode.APP_OFFLINE]: 'Could not process request. Application offline.',\n [ErrorCode.DELETE_PENDING_REGISTRATION]:\n \"Can't delete installation while there is a pending registration request.\"\n};\n\ninterface ErrorParams {\n [ErrorCode.MISSING_APP_CONFIG_VALUES]: {\n valueName: string;\n };\n [ErrorCode.REQUEST_FAILED]: {\n requestName: string;\n [index: string]: string | number; // to make TypeScript 3.8 happy\n } & ServerErrorData;\n}\n\nexport const ERROR_FACTORY = new ErrorFactory<ErrorCode, ErrorParams>(\n SERVICE,\n SERVICE_NAME,\n ERROR_DESCRIPTION_MAP\n);\n\nexport interface ServerErrorData {\n serverCode: number;\n serverMessage: string;\n serverStatus: string;\n}\n\nexport type ServerError = FirebaseError & { customData: ServerErrorData };\n\n/** Returns true if error is a FirebaseError that is based on an error from the server. */\nexport function isServerError(error: unknown): error is ServerError {\n return (\n error instanceof FirebaseError &&\n error.code.includes(ErrorCode.REQUEST_FAILED)\n );\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseError } from '@firebase/util';\nimport { GenerateAuthTokenResponse } from '../interfaces/api-response';\nimport {\n CompletedAuthToken,\n RegisteredInstallationEntry,\n RequestStatus\n} from '../interfaces/installation-entry';\nimport {\n INSTALLATIONS_API_URL,\n INTERNAL_AUTH_VERSION\n} from '../util/constants';\nimport { ERROR_FACTORY, ErrorCode } from '../util/errors';\nimport { AppConfig } from '../interfaces/installation-impl';\n\nexport function getInstallationsEndpoint({ projectId }: AppConfig): string {\n return `${INSTALLATIONS_API_URL}/projects/${projectId}/installations`;\n}\n\nexport function extractAuthTokenInfoFromResponse(\n response: GenerateAuthTokenResponse\n): CompletedAuthToken {\n return {\n token: response.token,\n requestStatus: RequestStatus.COMPLETED,\n expiresIn: getExpiresInFromResponseExpiresIn(response.expiresIn),\n creationTime: Date.now()\n };\n}\n\nexport async function getErrorFromResponse(\n requestName: string,\n response: Response\n): Promise<FirebaseError> {\n const responseJson: ErrorResponse = await response.json();\n const errorData = responseJson.error;\n return ERROR_FACTORY.create(ErrorCode.REQUEST_FAILED, {\n requestName,\n serverCode: errorData.code,\n serverMessage: errorData.message,\n serverStatus: errorData.status\n });\n}\n\nexport function getHeaders({ apiKey }: AppConfig): Headers {\n return new Headers({\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n 'x-goog-api-key': apiKey\n });\n}\n\nexport function getHeadersWithAuth(\n appConfig: AppConfig,\n { refreshToken }: RegisteredInstallationEntry\n): Headers {\n const headers = getHeaders(appConfig);\n headers.append('Authorization', getAuthorizationHeader(refreshToken));\n return headers;\n}\n\nexport interface ErrorResponse {\n error: {\n code: number;\n message: string;\n status: string;\n };\n}\n\n/**\n * Calls the passed in fetch wrapper and returns the response.\n * If the returned response has a status of 5xx, re-runs the function once and\n * returns the response.\n */\nexport async function retryIfServerError(\n fn: () => Promise<Response>\n): Promise<Response> {\n const result = await fn();\n\n if (result.status >= 500 && result.status < 600) {\n // Internal Server Error. Retry request.\n return fn();\n }\n\n return result;\n}\n\nfunction getExpiresInFromResponseExpiresIn(responseExpiresIn: string): number {\n // This works because the server will never respond with fractions of a second.\n return Number(responseExpiresIn.replace('s', '000'));\n}\n\nfunction getAuthorizationHeader(refreshToken: string): string {\n return `${INTERNAL_AUTH_VERSION} ${refreshToken}`;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CreateInstallationResponse } from '../interfaces/api-response';\nimport {\n InProgressInstallationEntry,\n RegisteredInstallationEntry,\n RequestStatus\n} from '../interfaces/installation-entry';\nimport { INTERNAL_AUTH_VERSION, PACKAGE_VERSION } from '../util/constants';\nimport {\n extractAuthTokenInfoFromResponse,\n getErrorFromResponse,\n getHeaders,\n getInstallationsEndpoint,\n retryIfServerError\n} from './common';\nimport { FirebaseInstallationsImpl } from '../interfaces/installation-impl';\n\nexport async function createInstallationRequest(\n { appConfig, heartbeatServiceProvider }: FirebaseInstallationsImpl,\n { fid }: InProgressInstallationEntry\n): Promise<RegisteredInstallationEntry> {\n const endpoint = getInstallationsEndpoint(appConfig);\n\n const headers = getHeaders(appConfig);\n\n // If heartbeat service exists, add the heartbeat string to the header.\n const heartbeatService = heartbeatServiceProvider.getImmediate({\n optional: true\n });\n if (heartbeatService) {\n const heartbeatsHeader = await heartbeatService.getHeartbeatsHeader();\n if (heartbeatsHeader) {\n headers.append('x-firebase-client', heartbeatsHeader);\n }\n }\n\n const body = {\n fid,\n authVersion: INTERNAL_AUTH_VERSION,\n appId: appConfig.appId,\n sdkVersion: PACKAGE_VERSION\n };\n\n const request: RequestInit = {\n method: 'POST',\n headers,\n body: JSON.stringify(body)\n };\n\n const response = await retryIfServerError(() => fetch(endpoint, request));\n if (response.ok) {\n const responseValue: CreateInstallationResponse = await response.json();\n const registeredInstallationEntry: RegisteredInstallationEntry = {\n fid: responseValue.fid || fid,\n registrationStatus: RequestStatus.COMPLETED,\n refreshToken: responseValue.refreshToken,\n authToken: extractAuthTokenInfoFromResponse(responseValue.authToken)\n };\n return registeredInstallationEntry;\n } else {\n throw await getErrorFromResponse('Create Installation', response);\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Returns a promise that resolves after given time passes. */\nexport function sleep(ms: number): Promise<void> {\n return new Promise<void>(resolve => {\n setTimeout(resolve, ms);\n });\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function bufferToBase64UrlSafe(array: Uint8Array): string {\n const b64 = btoa(String.fromCharCode(...array));\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_');\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bufferToBase64UrlSafe } from './buffer-to-base64-url-safe';\n\nexport const VALID_FID_PATTERN = /^[cdef][\\w-]{21}$/;\nexport const INVALID_FID = '';\n\n/**\n * Generates a new FID using random values from Web Crypto API.\n * Returns an empty string if FID generation fails for any reason.\n */\nexport function generateFid(): string {\n try {\n // A valid FID has exactly 22 base64 characters, which is 132 bits, or 16.5\n // bytes. our implementation generates a 17 byte array instead.\n const fidByteArray = new Uint8Array(17);\n const crypto =\n self.crypto || (self as unknown as { msCrypto: Crypto }).msCrypto;\n crypto.getRandomValues(fidByteArray);\n\n // Replace the first 4 random bits with the constant FID header of 0b0111.\n fidByteArray[0] = 0b01110000 + (fidByteArray[0] % 0b00010000);\n\n const fid = encode(fidByteArray);\n\n return VALID_FID_PATTERN.test(fid) ? fid : INVALID_FID;\n } catch {\n // FID generation errored\n return INVALID_FID;\n }\n}\n\n/** Converts a FID Uint8Array to a base64 string representation. */\nfunction encode(fidByteArray: Uint8Array): string {\n const b64String = bufferToBase64UrlSafe(fidByteArray);\n\n // Remove the 23rd character that was added because of the extra 4 bits at the\n // end of our 17 byte array, and the '=' padding.\n return b64String.substr(0, 22);\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AppConfig } from '../interfaces/installation-impl';\n\n/** Returns a string key that can be used to identify the app. */\nexport function getKey(appConfig: AppConfig): string {\n return `${appConfig.appName}!${appConfig.appId}`;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getKey } from '../util/get-key';\nimport { AppConfig } from '../interfaces/installation-impl';\nimport { IdChangeCallbackFn } from '../api';\n\nconst fidChangeCallbacks: Map<string, Set<IdChangeCallbackFn>> = new Map();\n\n/**\n * Calls the onIdChange callbacks with the new FID value, and broadcasts the\n * change to other tabs.\n */\nexport function fidChanged(appConfig: AppConfig, fid: string): void {\n const key = getKey(appConfig);\n\n callFidChangeCallbacks(key, fid);\n broadcastFidChange(key, fid);\n}\n\nexport function addCallback(\n appConfig: AppConfig,\n callback: IdChangeCallbackFn\n): void {\n // Open the broadcast channel if it's not already open,\n // to be able to listen to change events from other tabs.\n getBroadcastChannel();\n\n const key = getKey(appConfig);\n\n let callbackSet = fidChangeCallbacks.get(key);\n if (!callbackSet) {\n callbackSet = new Set();\n fidChangeCallbacks.set(key, callbackSet);\n }\n callbackSet.add(callback);\n}\n\nexport function removeCallback(\n appConfig: AppConfig,\n callback: IdChangeCallbackFn\n): void {\n const key = getKey(appConfig);\n\n const callbackSet = fidChangeCallbacks.get(key);\n\n if (!callbackSet) {\n return;\n }\n\n callbackSet.delete(callback);\n if (callbackSet.size === 0) {\n fidChangeCallbacks.delete(key);\n }\n\n // Close broadcast channel if there are no more callbacks.\n closeBroadcastChannel();\n}\n\nfunction callFidChangeCallbacks(key: string, fid: string): void {\n const callbacks = fidChangeCallbacks.get(key);\n if (!callbacks) {\n return;\n }\n\n for (const callback of callbacks) {\n callback(fid);\n }\n}\n\nfunction broadcastFidChange(key: string, fid: string): void {\n const channel = getBroadcastChannel();\n if (channel) {\n channel.postMessage({ key, fid });\n }\n closeBroadcastChannel();\n}\n\nlet broadcastChannel: BroadcastChannel | null = null;\n/** Opens and returns a BroadcastChannel if it is supported by the browser. */\nfunction getBroadcastChannel(): BroadcastChannel | null {\n if (!broadcastChannel && 'BroadcastChannel' in self) {\n broadcastChannel = new BroadcastChannel('[Firebase] FID Change');\n broadcastChannel.onmessage = e => {\n callFidChangeCallbacks(e.data.key, e.data.fid);\n };\n }\n return broadcastChannel;\n}\n\nfunction closeBroadcastChannel(): void {\n if (fidChangeCallbacks.size === 0 && broadcastChannel) {\n broadcastChannel.close();\n broadcastChannel = null;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DBSchema, IDBPDatabase, openDB } from 'idb';\nimport { AppConfig } from '../interfaces/installation-impl';\nimport { InstallationEntry } from '../interfaces/installation-entry';\nimport { getKey } from '../util/get-key';\nimport { fidChanged } from './fid-changed';\n\nconst DATABASE_NAME = 'firebase-installations-database';\nconst DATABASE_VERSION = 1;\nconst OBJECT_STORE_NAME = 'firebase-installations-store';\n\ninterface InstallationsDB extends DBSchema {\n 'firebase-installations-store': {\n key: string;\n value: InstallationEntry | undefined;\n };\n}\n\nlet dbPromise: Promise<IDBPDatabase<InstallationsDB>> | null = null;\nfunction getDbPromise(): Promise<IDBPDatabase<InstallationsDB>> {\n if (!dbPromise) {\n dbPromise = openDB(DATABASE_NAME, DATABASE_VERSION, {\n upgrade: (db, oldVersion) => {\n // We don't use 'break' in this switch statement, the fall-through\n // behavior is what we want, because if there are multiple versions between\n // the old version and the current version, we want ALL the migrations\n // that correspond to those versions to run, not only the last one.\n // eslint-disable-next-line default-case\n switch (oldVersion) {\n case 0:\n db.createObjectStore(OBJECT_STORE_NAME);\n }\n }\n });\n }\n return dbPromise;\n}\n\n/** Gets record(s) from the objectStore that match the given key. */\nexport async function get(\n appConfig: AppConfig\n): Promise<InstallationEntry | undefined> {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n return db\n .transaction(OBJECT_STORE_NAME)\n .objectStore(OBJECT_STORE_NAME)\n .get(key) as Promise<InstallationEntry>;\n}\n\n/** Assigns or overwrites the record for the given key with the given value. */\nexport async function set<ValueType extends InstallationEntry>(\n appConfig: AppConfig,\n value: ValueType\n): Promise<ValueType> {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n const objectStore = tx.objectStore(OBJECT_STORE_NAME);\n const oldValue = (await objectStore.get(key)) as InstallationEntry;\n await objectStore.put(value, key);\n await tx.done;\n\n if (!oldValue || oldValue.fid !== value.fid) {\n fidChanged(appConfig, value.fid);\n }\n\n return value;\n}\n\n/** Removes record(s) from the objectStore that match the given key. */\nexport async function remove(appConfig: AppConfig): Promise<void> {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n await tx.objectStore(OBJECT_STORE_NAME).delete(key);\n await tx.done;\n}\n\n/**\n * Atomically updates a record with the result of updateFn, which gets\n * called with the current value. If newValue is undefined, the record is\n * deleted instead.\n * @return Updated value\n */\nexport async function update<ValueType extends InstallationEntry | undefined>(\n appConfig: AppConfig,\n updateFn: (previousValue: InstallationEntry | undefined) => ValueType\n): Promise<ValueType> {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n const store = tx.objectStore(OBJECT_STORE_NAME);\n const oldValue: InstallationEntry | undefined = (await store.get(\n key\n )) as InstallationEntry;\n const newValue = updateFn(oldValue);\n\n if (newValue === undefined) {\n await store.delete(key);\n } else {\n await store.put(newValue, key);\n }\n await tx.done;\n\n if (newValue && (!oldValue || oldValue.fid !== newValue.fid)) {\n fidChanged(appConfig, newValue.fid);\n }\n\n return newValue;\n}\n\nexport async function clear(): Promise<void> {\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n await tx.objectStore(OBJECT_STORE_NAME).clear();\n await tx.done;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createInstallationRequest } from '../functions/create-installation-request';\nimport {\n AppConfig,\n FirebaseInstallationsImpl\n} from '../interfaces/installation-impl';\nimport {\n InProgressInstallationEntry,\n InstallationEntry,\n RegisteredInstallationEntry,\n RequestStatus\n} from '../interfaces/installation-entry';\nimport { PENDING_TIMEOUT_MS } from '../util/constants';\nimport { ERROR_FACTORY, ErrorCode, isServerError } from '../util/errors';\nimport { sleep } from '../util/sleep';\nimport { generateFid, INVALID_FID } from './generate-fid';\nimport { remove, set, update } from './idb-manager';\n\nexport interface InstallationEntryWithRegistrationPromise {\n installationEntry: InstallationEntry;\n /** Exist iff the installationEntry is not registered. */\n registrationPromise?: Promise<RegisteredInstallationEntry>;\n}\n\n/**\n * Updates and returns the InstallationEntry from the database.\n * Also triggers a registration request if it is necessary and possible.\n */\nexport async function getInstallationEntry(\n installations: FirebaseInstallationsImpl\n): Promise<InstallationEntryWithRegistrationPromise> {\n let registrationPromise: Promise<RegisteredInstallationEntry> | undefined;\n\n const installationEntry = await update(installations.appConfig, oldEntry => {\n const installationEntry = updateOrCreateInstallationEntry(oldEntry);\n const entryWithPromise = triggerRegistrationIfNecessary(\n installations,\n installationEntry\n );\n registrationPromise = entryWithPromise.registrationPromise;\n return entryWithPromise.installationEntry;\n });\n\n if (installationEntry.fid === INVALID_FID) {\n // FID generation failed. Waiting for the FID from the server.\n return { installationEntry: await registrationPromise! };\n }\n\n return {\n installationEntry,\n registrationPromise\n };\n}\n\n/**\n * Creates a new Installation Entry if one does not exist.\n * Also clears timed out pending requests.\n */\nfunction updateOrCreateInstallationEntry(\n oldEntry: InstallationEntry | undefined\n): InstallationEntry {\n const entry: InstallationEntry = oldEntry || {\n fid: generateFid(),\n registrationStatus: RequestStatus.NOT_STARTED\n };\n\n return clearTimedOutRequest(entry);\n}\n\n/**\n * If the Firebase Installation is not registered yet, this will trigger the\n * registration and return an InProgressInstallationEntry.\n *\n * If registrationPromise does not exist, the installationEntry is guaranteed\n * to be registered.\n */\nfunction triggerRegistrationIfNecessary(\n installations: FirebaseInstallationsImpl,\n installationEntry: InstallationEntry\n): InstallationEntryWithRegistrationPromise {\n if (installationEntry.registrationStatus === RequestStatus.NOT_STARTED) {\n if (!navigator.onLine) {\n // Registration required but app is offline.\n const registrationPromiseWithError = Promise.reject(\n ERROR_FACTORY.create(ErrorCode.APP_OFFLINE)\n );\n return {\n installationEntry,\n registrationPromise: registrationPromiseWithError\n };\n }\n\n // Try registering. Change status to IN_PROGRESS.\n const inProgressEntry: InProgressInstallationEntry = {\n fid: installationEntry.fid,\n registrationStatus: RequestStatus.IN_PROGRESS,\n registrationTime: Date.now()\n };\n const registrationPromise = registerInstallation(\n installations,\n inProgressEntry\n );\n return { installationEntry: inProgressEntry, registrationPromise };\n } else if (\n installationEntry.registrationStatus === RequestStatus.IN_PROGRESS\n ) {\n return {\n installationEntry,\n registrationPromise: waitUntilFidRegistration(installations)\n };\n } else {\n return { installationEntry };\n }\n}\n\n/** This will be executed only once for each new Firebase Installation. */\nasync function registerInstallation(\n installations: FirebaseInstallationsImpl,\n installationEntry: InProgressInstallationEntry\n): Promise<RegisteredInstallationEntry> {\n try {\n const registeredInstallationEntry = await createInstallationRequest(\n installations,\n installationEntry\n );\n return set(installations.appConfig, registeredInstallationEntry);\n } catch (e) {\n if (isServerError(e) && e.customData.serverCode === 409) {\n // Server returned a \"FID cannot be used\" error.\n // Generate a new ID next time.\n await remove(installations.appConfig);\n } else {\n // Registration failed. Set FID as not registered.\n await set(installations.appConfig, {\n fid: installationEntry.fid,\n registrationStatus: RequestStatus.NOT_STARTED\n });\n }\n throw e;\n }\n}\n\n/** Call if FID registration is pending in another request. */\nasync function waitUntilFidRegistration(\n installations: FirebaseInstallationsImpl\n): Promise<RegisteredInstallationEntry> {\n // Unfortunately, there is no way of reliably observing when a value in\n // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers),\n // so we need to poll.\n\n let entry: InstallationEntry = await updateInstallationRequest(\n installations.appConfig\n );\n while (entry.registrationStatus === RequestStatus.IN_PROGRESS) {\n // createInstallation request still in progress.\n await sleep(100);\n\n entry = await updateInstallationRequest(installations.appConfig);\n }\n\n if (entry.registrationStatus === RequestStatus.NOT_STARTED) {\n // The request timed out or failed in a different call. Try again.\n const { installationEntry, registrationPromise } =\n await getInstallationEntry(installations);\n\n if (registrationPromise) {\n return registrationPromise;\n } else {\n // if there is no registrationPromise, entry is registered.\n return installationEntry as RegisteredInstallationEntry;\n }\n }\n\n return entry;\n}\n\n/**\n * Called only if there is a CreateInstallation request in progress.\n *\n * Updates the InstallationEntry in the DB based on the status of the\n * CreateInstallation request.\n *\n * Returns the updated InstallationEntry.\n */\nfunction updateInstallationRequest(\n appConfig: AppConfig\n): Promise<InstallationEntry> {\n return update(appConfig, oldEntry => {\n if (!oldEntry) {\n throw ERROR_FACTORY.create(ErrorCode.INSTALLATION_NOT_FOUND);\n }\n return clearTimedOutRequest(oldEntry);\n });\n}\n\nfunction clearTimedOutRequest(entry: InstallationEntry): InstallationEntry {\n if (hasInstallationRequestTimedOut(entry)) {\n return {\n fid: entry.fid,\n registrationStatus: RequestStatus.NOT_STARTED\n };\n }\n\n return entry;\n}\n\nfunction hasInstallationRequestTimedOut(\n installationEntry: InstallationEntry\n): boolean {\n return (\n installationEntry.registrationStatus === RequestStatus.IN_PROGRESS &&\n installationEntry.registrationTime + PENDING_TIMEOUT_MS < Date.now()\n );\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { GenerateAuthTokenResponse } from '../interfaces/api-response';\nimport {\n CompletedAuthToken,\n RegisteredInstallationEntry\n} from '../interfaces/installation-entry';\nimport { PACKAGE_VERSION } from '../util/constants';\nimport {\n extractAuthTokenInfoFromResponse,\n getErrorFromResponse,\n getHeadersWithAuth,\n getInstallationsEndpoint,\n retryIfServerError\n} from './common';\nimport {\n FirebaseInstallationsImpl,\n AppConfig\n} from '../interfaces/installation-impl';\n\nexport async function generateAuthTokenRequest(\n { appConfig, heartbeatServiceProvider }: FirebaseInstallationsImpl,\n installationEntry: RegisteredInstallationEntry\n): Promise<CompletedAuthToken> {\n const endpoint = getGenerateAuthTokenEndpoint(appConfig, installationEntry);\n\n const headers = getHeadersWithAuth(appConfig, installationEntry);\n\n // If heartbeat service exists, add the heartbeat string to the header.\n const heartbeatService = heartbeatServiceProvider.getImmediate({\n optional: true\n });\n if (heartbeatService) {\n const heartbeatsHeader = await heartbeatService.getHeartbeatsHeader();\n if (heartbeatsHeader) {\n headers.append('x-firebase-client', heartbeatsHeader);\n }\n }\n\n const body = {\n installation: {\n sdkVersion: PACKAGE_VERSION,\n appId: appConfig.appId\n }\n };\n\n const request: RequestInit = {\n method: 'POST',\n headers,\n body: JSON.stringify(body)\n };\n\n const response = await retryIfServerError(() => fetch(endpoint, request));\n if (response.ok) {\n const responseValue: GenerateAuthTokenResponse = await response.json();\n const completedAuthToken: CompletedAuthToken =\n extractAuthTokenInfoFromResponse(responseValue);\n return completedAuthToken;\n } else {\n throw await getErrorFromResponse('Generate Auth Token', response);\n }\n}\n\nfunction getGenerateAuthTokenEndpoint(\n appConfig: AppConfig,\n { fid }: RegisteredInstallationEntry\n): string {\n return `${getInstallationsEndpoint(appConfig)}/${fid}/authTokens:generate`;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { generateAuthTokenRequest } from '../functions/generate-auth-token-request';\nimport {\n AppConfig,\n FirebaseInstallationsImpl\n} from '../interfaces/installation-impl';\nimport {\n AuthToken,\n CompletedAuthToken,\n InProgressAuthToken,\n InstallationEntry,\n RegisteredInstallationEntry,\n RequestStatus\n} from '../interfaces/installation-entry';\nimport { PENDING_TIMEOUT_MS, TOKEN_EXPIRATION_BUFFER } from '../util/constants';\nimport { ERROR_FACTORY, ErrorCode, isServerError } from '../util/errors';\nimport { sleep } from '../util/sleep';\nimport { remove, set, update } from './idb-manager';\n\n/**\n * Returns a valid authentication token for the installation. Generates a new\n * token if one doesn't exist, is expired or about to expire.\n *\n * Should only be called if the Firebase Installation is registered.\n */\nexport async function refreshAuthToken(\n installations: FirebaseInstallationsImpl,\n forceRefresh = false\n): Promise<CompletedAuthToken> {\n let tokenPromise: Promise<CompletedAuthToken> | undefined;\n const entry = await update(installations.appConfig, oldEntry => {\n if (!isEntryRegistered(oldEntry)) {\n throw ERROR_FACTORY.create(ErrorCode.NOT_REGISTERED);\n }\n\n const oldAuthToken = oldEntry.authToken;\n if (!forceRefresh && isAuthTokenValid(oldAuthToken)) {\n // There is a valid token in the DB.\n return oldEntry;\n } else if (oldAuthToken.requestStatus === RequestStatus.IN_PROGRESS) {\n // There already is a token request in progress.\n tokenPromise = waitUntilAuthTokenRequest(installations, forceRefresh);\n return oldEntry;\n } else {\n // No token or token expired.\n if (!navigator.onLine) {\n throw ERROR_FACTORY.create(ErrorCode.APP_OFFLINE);\n }\n\n const inProgressEntry = makeAuthTokenRequestInProgressEntry(oldEntry);\n tokenPromise = fetchAuthTokenFromServer(installations, inProgressEntry);\n return inProgressEntry;\n }\n });\n\n const authToken = tokenPromise\n ? await tokenPromise\n : (entry.authToken as CompletedAuthToken);\n return authToken;\n}\n\n/**\n * Call only if FID is registered and Auth Token request is in progress.\n *\n * Waits until the current pending request finishes. If the request times out,\n * tries once in this thread as well.\n */\nasync function waitUntilAuthTokenRequest(\n installations: FirebaseInstallationsImpl,\n forceRefresh: boolean\n): Promise<CompletedAuthToken> {\n // Unfortunately, there is no way of reliably observing when a value in\n // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers),\n // so we need to poll.\n\n let entry = await updateAuthTokenRequest(installations.appConfig);\n while (entry.authToken.requestStatus === RequestStatus.IN_PROGRESS) {\n // generateAuthToken still in progress.\n await sleep(100);\n\n entry = await updateAuthTokenRequest(installations.appConfig);\n }\n\n const authToken = entry.authToken;\n if (authToken.requestStatus === RequestStatus.NOT_STARTED) {\n // The request timed out or failed in a different call. Try again.\n return refreshAuthToken(installations, forceRefresh);\n } else {\n return authToken;\n }\n}\n\n/**\n * Called only if there is a GenerateAuthToken request in progress.\n *\n * Updates the InstallationEntry in the DB based on the status of the\n * GenerateAuthToken request.\n *\n * Returns the updated InstallationEntry.\n */\nfunction updateAuthTokenRequest(\n appConfig: AppConfig\n): Promise<RegisteredInstallationEntry> {\n return update(appConfig, oldEntry => {\n if (!isEntryRegistered(oldEntry)) {\n throw ERROR_FACTORY.create(ErrorCode.NOT_REGISTERED);\n }\n\n const oldAuthToken = oldEntry.authToken;\n if (hasAuthTokenRequestTimedOut(oldAuthToken)) {\n return {\n ...oldEntry,\n authToken: { requestStatus: RequestStatus.NOT_STARTED }\n };\n }\n\n return oldEntry;\n });\n}\n\nasync function fetchAuthTokenFromServer(\n installations: FirebaseInstallationsImpl,\n installationEntry: RegisteredInstallationEntry\n): Promise<CompletedAuthToken> {\n try {\n const authToken = await generateAuthTokenRequest(\n installations,\n installationEntry\n );\n const updatedInstallationEntry: RegisteredInstallationEntry = {\n ...installationEntry,\n authToken\n };\n await set(installations.appConfig, updatedInstallationEntry);\n return authToken;\n } catch (e) {\n if (\n isServerError(e) &&\n (e.customData.serverCode === 401 || e.customData.serverCode === 404)\n ) {\n // Server returned a \"FID not found\" or a \"Invalid authentication\" error.\n // Generate a new ID next time.\n await remove(installations.appConfig);\n } else {\n const updatedInstallationEntry: RegisteredInstallationEntry = {\n ...installationEntry,\n authToken: { requestStatus: RequestStatus.NOT_STARTED }\n };\n await set(installations.appConfig, updatedInstallationEntry);\n }\n throw e;\n }\n}\n\nfunction isEntryRegistered(\n installationEntry: InstallationEntry | undefined\n): installationEntry is RegisteredInstallationEntry {\n return (\n installationEntry !== undefined &&\n installationEntry.registrationStatus === RequestStatus.COMPLETED\n );\n}\n\nfunction isAuthTokenValid(authToken: AuthToken): boolean {\n return (\n authToken.requestStatus === RequestStatus.COMPLETED &&\n !isAuthTokenExpired(authToken)\n );\n}\n\nfunction isAuthTokenExpired(authToken: CompletedAuthToken): boolean {\n const now = Date.now();\n return (\n now < authToken.creationTime ||\n authToken.creationTime + authToken.expiresIn < now + TOKEN_EXPIRATION_BUFFER\n );\n}\n\n/** Returns an updated InstallationEntry with an InProgressAuthToken. */\nfunction makeAuthTokenRequestInProgressEntry(\n oldEntry: RegisteredInstallationEntry\n): RegisteredInstallationEntry {\n const inProgressAuthToken: InProgressAuthToken = {\n requestStatus: RequestStatus.IN_PROGRESS,\n requestTime: Date.now()\n };\n return {\n ...oldEntry,\n authToken: inProgressAuthToken\n };\n}\n\nfunction hasAuthTokenRequestTimedOut(authToken: AuthToken): boolean {\n return (\n authToken.requestStatus === RequestStatus.IN_PROGRESS &&\n authToken.requestTime + PENDING_TIMEOUT_MS < Date.now()\n );\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getInstallationEntry } from '../helpers/get-installation-entry';\nimport { refreshAuthToken } from '../helpers/refresh-auth-token';\nimport { FirebaseInstallationsImpl } from '../interfaces/installation-impl';\nimport { Installations } from '../interfaces/public-types';\n\n/**\n * Creates a Firebase Installation if there isn't one for the app and\n * returns the Installation ID.\n * @param installations - The `Installations` instance.\n *\n * @public\n */\nexport async function getId(installations: Installations): Promise<string> {\n const installationsImpl = installations as FirebaseInstallationsImpl;\n const { installationEntry, registrationPromise } = await getInstallationEntry(\n installationsImpl\n );\n\n if (registrationPromise) {\n registrationPromise.catch(console.error);\n } else {\n // If the installation is already registered, update the authentication\n // token if needed.\n refreshAuthToken(installationsImpl).catch(console.error);\n }\n\n return installationEntry.fid;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getInstallationEntry } from '../helpers/get-installation-entry';\nimport { refreshAuthToken } from '../helpers/refresh-auth-token';\nimport { FirebaseInstallationsImpl } from '../interfaces/installation-impl';\nimport { Installations } from '../interfaces/public-types';\n\n/**\n * Returns a Firebase Installations auth token, identifying the current\n * Firebase Installation.\n * @param installations - The `Installations` instance.\n * @param forceRefresh - Force refresh regardless of token expiration.\n *\n * @public\n */\nexport async function getToken(\n installations: Installations,\n forceRefresh = false\n): Promise<string> {\n const installationsImpl = installations as FirebaseInstallationsImpl;\n await completeInstallationRegistration(installationsImpl);\n\n // At this point we either have a Registered Installation in the DB, or we've\n // already thrown an error.\n const authToken = await refreshAuthToken(installationsImpl, forceRefresh);\n return authToken.token;\n}\n\nasync function completeInstallationRegistration(\n installations: FirebaseInstallationsImpl\n): Promise<void> {\n const { registrationPromise } = await getInstallationEntry(installations);\n\n if (registrationPromise) {\n // A createInstallation request is in progress. Wait until it finishes.\n await registrationPromise;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AppConfig } from '../interfaces/installation-impl';\nimport { RegisteredInstallationEntry } from '../interfaces/installation-entry';\nimport {\n getErrorFromResponse,\n getHeadersWithAuth,\n getInstallationsEndpoint,\n retryIfServerError\n} from './common';\n\nexport async function deleteInstallationRequest(\n appConfig: AppConfig,\n installationEntry: RegisteredInstallationEntry\n): Promise<void> {\n const endpoint = getDeleteEndpoint(appConfig, installationEntry);\n\n const headers = getHeadersWithAuth(appConfig, installationEntry);\n const request: RequestInit = {\n method: 'DELETE',\n headers\n };\n\n const response = await retryIfServerError(() => fetch(endpoint, request));\n if (!response.ok) {\n throw await getErrorFromResponse('Delete Installation', response);\n }\n}\n\nfunction getDeleteEndpoint(\n appConfig: AppConfig,\n { fid }: RegisteredInstallationEntry\n): string {\n return `${getInstallationsEndpoint(appConfig)}/${fid}`;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { deleteInstallationRequest } from '../functions/delete-installation-request';\nimport { remove, update } from '../helpers/idb-manager';\nimport { RequestStatus } from '../interfaces/installation-entry';\nimport { ERROR_FACTORY, ErrorCode } from '../util/errors';\nimport { FirebaseInstallationsImpl } from '../interfaces/installation-impl';\nimport { Installations } from '../interfaces/public-types';\n\n/**\n * Deletes the Firebase Installation and all associated data.\n * @param installations - The `Installations` instance.\n *\n * @public\n */\nexport async function deleteInstallations(\n installations: Installations\n): Promise<void> {\n const { appConfig } = installations as FirebaseInstallationsImpl;\n\n const entry = await update(appConfig, oldEntry => {\n if (oldEntry && oldEntry.registrationStatus === RequestStatus.NOT_STARTED) {\n // Delete the unregistered entry without sending a deleteInstallation request.\n return undefined;\n }\n return oldEntry;\n });\n\n if (entry) {\n if (entry.registrationStatus === RequestStatus.IN_PROGRESS) {\n // Can't delete while trying to register.\n throw ERROR_FACTORY.create(ErrorCode.DELETE_PENDING_REGISTRATION);\n } else if (entry.registrationStatus === RequestStatus.COMPLETED) {\n if (!navigator.onLine) {\n throw ERROR_FACTORY.create(ErrorCode.APP_OFFLINE);\n } else {\n await deleteInstallationRequest(appConfig, entry);\n await remove(appConfig);\n }\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { addCallback, removeCallback } from '../helpers/fid-changed';\nimport { FirebaseInstallationsImpl } from '../interfaces/installation-impl';\nimport { Installations } from '../interfaces/public-types';\n\n/**\n * An user defined callback function that gets called when Installations ID changes.\n *\n * @public\n */\nexport type IdChangeCallbackFn = (installationId: string) => void;\n/**\n * Unsubscribe a callback function previously added via {@link IdChangeCallbackFn}.\n *\n * @public\n */\nexport type IdChangeUnsubscribeFn = () => void;\n\n/**\n * Sets a new callback that will get called when Installation ID changes.\n * Returns an unsubscribe function that will remove the callback when called.\n * @param installations - The `Installations` instance.\n * @param callback - The callback function that is invoked when FID changes.\n * @returns A function that can be called to unsubscribe.\n *\n * @public\n */\nexport function onIdChange(\n installations: Installations,\n callback: IdChangeCallbackFn\n): IdChangeUnsubscribeFn {\n const { appConfig } = installations as FirebaseInstallationsImpl;\n\n addCallback(appConfig, callback);\n return () => {\n removeCallback(appConfig, callback);\n };\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, getApp, _getProvider } from '@firebase/app';\nimport { Installations } from '../interfaces/public-types';\n\n/**\n * Returns an instance of {@link Installations} associated with the given\n * {@link @firebase/app#FirebaseApp} instance.\n * @param app - The {@link @firebase/app#FirebaseApp} instance.\n *\n * @public\n */\nexport function getInstallations(app: FirebaseApp = getApp()): Installations {\n const installationsImpl = _getProvider(app, 'installations').getImmediate();\n return installationsImpl;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, FirebaseOptions } from '@firebase/app';\nimport { FirebaseError } from '@firebase/util';\nimport { AppConfig } from '../interfaces/installation-impl';\nimport { ERROR_FACTORY, ErrorCode } from '../util/errors';\n\nexport function extractAppConfig(app: FirebaseApp): AppConfig {\n if (!app || !app.options) {\n throw getMissingValueError('App Configuration');\n }\n\n if (!app.name) {\n throw getMissingValueError('App Name');\n }\n\n // Required app config keys\n const configKeys: Array<keyof FirebaseOptions> = [\n 'projectId',\n 'apiKey',\n 'appId'\n ];\n\n for (const keyName of configKeys) {\n if (!app.options[keyName]) {\n throw getMissingValueError(keyName);\n }\n }\n\n return {\n appName: app.name,\n projectId: app.options.projectId!,\n apiKey: app.options.apiKey!,\n appId: app.options.appId!\n };\n}\n\nfunction getMissingValueError(valueName: string): FirebaseError {\n return ERROR_FACTORY.create(ErrorCode.MISSING_APP_CONFIG_VALUES, {\n valueName\n });\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { _registerComponent, _getProvider } from '@firebase/app';\nimport {\n Component,\n ComponentType,\n InstanceFactory,\n ComponentContainer\n} from '@firebase/component';\nimport { getId, getToken } from '../api/index';\nimport { _FirebaseInstallationsInternal } from '../interfaces/public-types';\nimport { FirebaseInstallationsImpl } from '../interfaces/installation-impl';\nimport { extractAppConfig } from '../helpers/extract-app-config';\n\nconst INSTALLATIONS_NAME = 'installations';\nconst INSTALLATIONS_NAME_INTERNAL = 'installations-internal';\n\nconst publicFactory: InstanceFactory<'installations'> = (\n container: ComponentContainer\n) => {\n const app = container.getProvider('app').getImmediate();\n // Throws if app isn't configured properly.\n const appConfig = extractAppConfig(app);\n const heartbeatServiceProvider = _getProvider(app, 'heartbeat');\n\n const installationsImpl: FirebaseInstallationsImpl = {\n app,\n appConfig,\n heartbeatServiceProvider,\n _delete: () => Promise.resolve()\n };\n return installationsImpl;\n};\n\nconst internalFactory: InstanceFactory<'installations-internal'> = (\n container: ComponentContainer\n) => {\n const app = container.getProvider('app').getImmediate();\n // Internal FIS instance relies on public FIS instance.\n const installations = _getProvider(app, INSTALLATIONS_NAME).getImmediate();\n\n const installationsInternal: _FirebaseInstallationsInternal = {\n getId: () => getId(installations),\n getToken: (forceRefresh?: boolean) => getToken(installations, forceRefresh)\n };\n return installationsInternal;\n};\n\nexport function registerInstallations(): void {\n _registerComponent(\n new Component(INSTALLATIONS_NAME, publicFactory, ComponentType.PUBLIC)\n );\n _registerComponent(\n new Component(\n INSTALLATIONS_NAME_INTERNAL,\n internalFactory,\n ComponentType.PRIVATE\n )\n );\n}\n","/**\n * The Firebase Installations Web SDK.\n * This SDK does not work in a Node.js environment.\n *\n * @packageDocumentation\n */\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { registerInstallations } from './functions/config';\nimport { registerVersion } from '@firebase/app';\nimport { name, version } from '../package.json';\n\nexport * from './api';\nexport * from './interfaces/public-types';\n\nregisterInstallations();\nregisterVersion(name, version);\n// BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation\nregisterVersion(name, version, '__BUILD_TARGET__');\n"],"names":["ErrorFactory","FirebaseError","openDB","app","getApp","_getProvider","_registerComponent","Component","registerVersion"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAII,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAEjC,MAAM,eAAe,GAAG,CAAK,EAAA,EAAA,OAAO,EAAE,CAAC;AACvC,MAAM,qBAAqB,GAAG,QAAQ,CAAC;AAEvC,MAAM,qBAAqB,GAChC,iDAAiD,CAAC;AAE7C,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE/C,MAAM,OAAO,GAAG,eAAe,CAAC;AAChC,MAAM,YAAY,GAAG,eAAe;;AC9B3C;;;;;;;;;;;;;;;AAeG;AAcH,MAAM,qBAAqB,GAA4C;AACrE,IAAA,CAAA,2BAAA,6CACE,iDAAiD;AACnD,IAAA,CAAA,gBAAA,kCAA4B,0CAA0C;AACtE,IAAA,CAAA,wBAAA,0CAAoC,kCAAkC;AACtE,IAAA,CAAA,gBAAA,kCACE,4FAA4F;AAC9F,IAAA,CAAA,aAAA,+BAAyB,iDAAiD;AAC1E,IAAA,CAAA,6BAAA,+CACE,0EAA0E;CAC7E,CAAC;AAYK,MAAM,aAAa,GAAG,IAAIA,iBAAY,CAC3C,OAAO,EACP,YAAY,EACZ,qBAAqB,CACtB,CAAC;AAUF;AACM,SAAU,aAAa,CAAC,KAAc,EAAA;IAC1C,QACE,KAAK,YAAYC,kBAAa;AAC9B,QAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAA,gBAAA,gCAA0B,EAC7C;AACJ;;ACvEA;;;;;;;;;;;;;;;AAeG;AAgBa,SAAA,wBAAwB,CAAC,EAAE,SAAS,EAAa,EAAA;AAC/D,IAAA,OAAO,CAAG,EAAA,qBAAqB,CAAa,UAAA,EAAA,SAAS,gBAAgB,CAAC;AACxE,CAAC;AAEK,SAAU,gCAAgC,CAC9C,QAAmC,E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gBAAY,CAACF,KAAG,EAAE,kBAAkB,CAAC,CAAC,YAAY,EAAE,CAAC;AAE3E,IAAA,MAAM,qBAAqB,GAAmC;AAC5D,QAAA,KAAK,EAAE,MAAM,KAAK,CAAC,aAAa,CAAC;QACjC,QAAQ,EAAE,CAAC,YAAsB,KAAK,QAAQ,CAAC,aAAa,EAAE,YAAY,CAAC;KAC5E,CAAC;AACF,IAAA,OAAO,qBAAqB,CAAC;AAC/B,CAAC,CAAC;SAEc,qBAAqB,GAAA;IACnCG,sBAAkB,CAChB,IAAIC,mBAAS,CAAC,kBAAkB,EAAE,aAAa,EAAuB,QAAA,4BAAA,CACvE,CAAC;IACFD,sBAAkB,CAChB,IAAIC,mBAAS,CACX,2BAA2B,EAC3B,eAAe,EAEhB,SAAA,6BAAA,CACF,CAAC;AACJ;;AC1EA;;;;;AAKG;AA0BH,qBAAqB,EAAE,CAAC;AACxBC,mBAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/B;AACAA,mBAAe,CAAC,IAAI,EAAE,OAAO,EAAE,SAAkB,CAAC;;;;;;;;"}
\ No newline at end of file diff --git a/frontend-old/node_modules/@firebase/installations/dist/installations-public.d.ts b/frontend-old/node_modules/@firebase/installations/dist/installations-public.d.ts deleted file mode 100644 index fbde121..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/installations-public.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -/** - * The Firebase Installations Web SDK. - * This SDK does not work in a Node.js environment. - * - * @packageDocumentation - */ - -import { FirebaseApp } from '@firebase/app'; - -/** - * Deletes the Firebase Installation and all associated data. - * @param installations - The `Installations` instance. - * - * @public - */ -export declare function deleteInstallations(installations: Installations): Promise<void>; - -/* Excluded from this release type: _FirebaseInstallationsInternal */ - -/** - * Creates a Firebase Installation if there isn't one for the app and - * returns the Installation ID. - * @param installations - The `Installations` instance. - * - * @public - */ -export declare function getId(installations: Installations): Promise<string>; - -/** - * Returns an instance of {@link Installations} associated with the given - * {@link @firebase/app#FirebaseApp} instance. - * @param app - The {@link @firebase/app#FirebaseApp} instance. - * - * @public - */ -export declare function getInstallations(app?: FirebaseApp): Installations; - -/** - * Returns a Firebase Installations auth token, identifying the current - * Firebase Installation. - * @param installations - The `Installations` instance. - * @param forceRefresh - Force refresh regardless of token expiration. - * - * @public - */ -export declare function getToken(installations: Installations, forceRefresh?: boolean): Promise<string>; - -/** - * An user defined callback function that gets called when Installations ID changes. - * - * @public - */ -export declare type IdChangeCallbackFn = (installationId: string) => void; - -/** - * Unsubscribe a callback function previously added via {@link IdChangeCallbackFn}. - * - * @public - */ -export declare type IdChangeUnsubscribeFn = () => void; - -/** - * Public interface of the Firebase Installations SDK. - * - * @public - */ -export declare interface Installations { - /** - * The {@link @firebase/app#FirebaseApp} this `Installations` instance is associated with. - */ - app: FirebaseApp; -} - -/** - * Sets a new callback that will get called when Installation ID changes. - * Returns an unsubscribe function that will remove the callback when called. - * @param installations - The `Installations` instance. - * @param callback - The callback function that is invoked when FID changes. - * @returns A function that can be called to unsubscribe. - * - * @public - */ -export declare function onIdChange(installations: Installations, callback: IdChangeCallbackFn): IdChangeUnsubscribeFn; - -export { } diff --git a/frontend-old/node_modules/@firebase/installations/dist/installations.d.ts b/frontend-old/node_modules/@firebase/installations/dist/installations.d.ts deleted file mode 100644 index 9e00846..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/installations.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** - * The Firebase Installations Web SDK. - * This SDK does not work in a Node.js environment. - * - * @packageDocumentation - */ - -import { FirebaseApp } from '@firebase/app'; - -/** - * Deletes the Firebase Installation and all associated data. - * @param installations - The `Installations` instance. - * - * @public - */ -export declare function deleteInstallations(installations: Installations): Promise<void>; - -/** - * An interface for Firebase internal SDKs use only. - * - * @internal - */ -export declare interface _FirebaseInstallationsInternal { - /** - * Creates a Firebase Installation if there isn't one for the app and - * returns the Installation ID. - */ - getId(): Promise<string>; - /** - * Returns an Authentication Token for the current Firebase Installation. - */ - getToken(forceRefresh?: boolean): Promise<string>; -} - -/** - * Creates a Firebase Installation if there isn't one for the app and - * returns the Installation ID. - * @param installations - The `Installations` instance. - * - * @public - */ -export declare function getId(installations: Installations): Promise<string>; - -/** - * Returns an instance of {@link Installations} associated with the given - * {@link @firebase/app#FirebaseApp} instance. - * @param app - The {@link @firebase/app#FirebaseApp} instance. - * - * @public - */ -export declare function getInstallations(app?: FirebaseApp): Installations; - -/** - * Returns a Firebase Installations auth token, identifying the current - * Firebase Installation. - * @param installations - The `Installations` instance. - * @param forceRefresh - Force refresh regardless of token expiration. - * - * @public - */ -export declare function getToken(installations: Installations, forceRefresh?: boolean): Promise<string>; - -/** - * An user defined callback function that gets called when Installations ID changes. - * - * @public - */ -export declare type IdChangeCallbackFn = (installationId: string) => void; - -/** - * Unsubscribe a callback function previously added via {@link IdChangeCallbackFn}. - * - * @public - */ -export declare type IdChangeUnsubscribeFn = () => void; - -/** - * Public interface of the Firebase Installations SDK. - * - * @public - */ -export declare interface Installations { - /** - * The {@link @firebase/app#FirebaseApp} this `Installations` instance is associated with. - */ - app: FirebaseApp; -} - -/** - * Sets a new callback that will get called when Installation ID changes. - * Returns an unsubscribe function that will remove the callback when called. - * @param installations - The `Installations` instance. - * @param callback - The callback function that is invoked when FID changes. - * @returns A function that can be called to unsubscribe. - * - * @public - */ -export declare function onIdChange(installations: Installations, callback: IdChangeCallbackFn): IdChangeUnsubscribeFn; - -export { } diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/api/delete-installations.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/api/delete-installations.d.ts deleted file mode 100644 index 071ce49..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/api/delete-installations.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { Installations } from '../interfaces/public-types'; -/** - * Deletes the Firebase Installation and all associated data. - * @param installations - The `Installations` instance. - * - * @public - */ -export declare function deleteInstallations(installations: Installations): Promise<void>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/api/get-id.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/api/get-id.d.ts deleted file mode 100644 index 7041940..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/api/get-id.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { Installations } from '../interfaces/public-types'; -/** - * Creates a Firebase Installation if there isn't one for the app and - * returns the Installation ID. - * @param installations - The `Installations` instance. - * - * @public - */ -export declare function getId(installations: Installations): Promise<string>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/api/get-installations.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/api/get-installations.d.ts deleted file mode 100644 index e79d514..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/api/get-installations.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * 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. - */ -import { FirebaseApp } from '@firebase/app'; -import { Installations } from '../interfaces/public-types'; -/** - * Returns an instance of {@link Installations} associated with the given - * {@link @firebase/app#FirebaseApp} instance. - * @param app - The {@link @firebase/app#FirebaseApp} instance. - * - * @public - */ -export declare function getInstallations(app?: FirebaseApp): Installations; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/api/get-token.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/api/get-token.d.ts deleted file mode 100644 index 28b2aed..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/api/get-token.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { Installations } from '../interfaces/public-types'; -/** - * Returns a Firebase Installations auth token, identifying the current - * Firebase Installation. - * @param installations - The `Installations` instance. - * @param forceRefresh - Force refresh regardless of token expiration. - * - * @public - */ -export declare function getToken(installations: Installations, forceRefresh?: boolean): Promise<string>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/api/index.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/api/index.d.ts deleted file mode 100644 index 9af626f..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/api/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -export * from './get-id'; -export * from './get-token'; -export * from './delete-installations'; -export * from './on-id-change'; -export * from './get-installations'; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/api/on-id-change.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/api/on-id-change.d.ts deleted file mode 100644 index 5f7811e..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/api/on-id-change.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { Installations } from '../interfaces/public-types'; -/** - * An user defined callback function that gets called when Installations ID changes. - * - * @public - */ -export type IdChangeCallbackFn = (installationId: string) => void; -/** - * Unsubscribe a callback function previously added via {@link IdChangeCallbackFn}. - * - * @public - */ -export type IdChangeUnsubscribeFn = () => void; -/** - * Sets a new callback that will get called when Installation ID changes. - * Returns an unsubscribe function that will remove the callback when called. - * @param installations - The `Installations` instance. - * @param callback - The callback function that is invoked when FID changes. - * @returns A function that can be called to unsubscribe. - * - * @public - */ -export declare function onIdChange(installations: Installations, callback: IdChangeCallbackFn): IdChangeUnsubscribeFn; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/functions/common.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/functions/common.d.ts deleted file mode 100644 index d592734..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/functions/common.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { FirebaseError } from '@firebase/util'; -import { GenerateAuthTokenResponse } from '../interfaces/api-response'; -import { CompletedAuthToken, RegisteredInstallationEntry } from '../interfaces/installation-entry'; -import { AppConfig } from '../interfaces/installation-impl'; -export declare function getInstallationsEndpoint({ projectId }: AppConfig): string; -export declare function extractAuthTokenInfoFromResponse(response: GenerateAuthTokenResponse): CompletedAuthToken; -export declare function getErrorFromResponse(requestName: string, response: Response): Promise<FirebaseError>; -export declare function getHeaders({ apiKey }: AppConfig): Headers; -export declare function getHeadersWithAuth(appConfig: AppConfig, { refreshToken }: RegisteredInstallationEntry): Headers; -export interface ErrorResponse { - error: { - code: number; - message: string; - status: string; - }; -} -/** - * Calls the passed in fetch wrapper and returns the response. - * If the returned response has a status of 5xx, re-runs the function once and - * returns the response. - */ -export declare function retryIfServerError(fn: () => Promise<Response>): Promise<Response>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/functions/config.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/functions/config.d.ts deleted file mode 100644 index 06082e0..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/functions/config.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * 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. - */ -export declare function registerInstallations(): void; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/functions/create-installation-request.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/functions/create-installation-request.d.ts deleted file mode 100644 index d1997d5..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/functions/create-installation-request.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { InProgressInstallationEntry, RegisteredInstallationEntry } from '../interfaces/installation-entry'; -import { FirebaseInstallationsImpl } from '../interfaces/installation-impl'; -export declare function createInstallationRequest({ appConfig, heartbeatServiceProvider }: FirebaseInstallationsImpl, { fid }: InProgressInstallationEntry): Promise<RegisteredInstallationEntry>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/functions/delete-installation-request.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/functions/delete-installation-request.d.ts deleted file mode 100644 index d8dfda8..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/functions/delete-installation-request.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { AppConfig } from '../interfaces/installation-impl'; -import { RegisteredInstallationEntry } from '../interfaces/installation-entry'; -export declare function deleteInstallationRequest(appConfig: AppConfig, installationEntry: RegisteredInstallationEntry): Promise<void>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/functions/generate-auth-token-request.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/functions/generate-auth-token-request.d.ts deleted file mode 100644 index 7b4179e..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/functions/generate-auth-token-request.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { CompletedAuthToken, RegisteredInstallationEntry } from '../interfaces/installation-entry'; -import { FirebaseInstallationsImpl } from '../interfaces/installation-impl'; -export declare function generateAuthTokenRequest({ appConfig, heartbeatServiceProvider }: FirebaseInstallationsImpl, installationEntry: RegisteredInstallationEntry): Promise<CompletedAuthToken>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/buffer-to-base64-url-safe.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/helpers/buffer-to-base64-url-safe.d.ts deleted file mode 100644 index 19bcb44..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/buffer-to-base64-url-safe.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -export declare function bufferToBase64UrlSafe(array: Uint8Array): string; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/extract-app-config.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/helpers/extract-app-config.d.ts deleted file mode 100644 index 4293d64..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/extract-app-config.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { FirebaseApp } from '@firebase/app'; -import { AppConfig } from '../interfaces/installation-impl'; -export declare function extractAppConfig(app: FirebaseApp): AppConfig; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/fid-changed.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/helpers/fid-changed.d.ts deleted file mode 100644 index 58dcb38..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/fid-changed.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { AppConfig } from '../interfaces/installation-impl'; -import { IdChangeCallbackFn } from '../api'; -/** - * Calls the onIdChange callbacks with the new FID value, and broadcasts the - * change to other tabs. - */ -export declare function fidChanged(appConfig: AppConfig, fid: string): void; -export declare function addCallback(appConfig: AppConfig, callback: IdChangeCallbackFn): void; -export declare function removeCallback(appConfig: AppConfig, callback: IdChangeCallbackFn): void; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/generate-fid.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/helpers/generate-fid.d.ts deleted file mode 100644 index a1a8f8d..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/generate-fid.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -export declare const VALID_FID_PATTERN: RegExp; -export declare const INVALID_FID = ""; -/** - * Generates a new FID using random values from Web Crypto API. - * Returns an empty string if FID generation fails for any reason. - */ -export declare function generateFid(): string; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/get-installation-entry.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/helpers/get-installation-entry.d.ts deleted file mode 100644 index 1b0355f..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/get-installation-entry.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { FirebaseInstallationsImpl } from '../interfaces/installation-impl'; -import { InstallationEntry, RegisteredInstallationEntry } from '../interfaces/installation-entry'; -export interface InstallationEntryWithRegistrationPromise { - installationEntry: InstallationEntry; - /** Exist iff the installationEntry is not registered. */ - registrationPromise?: Promise<RegisteredInstallationEntry>; -} -/** - * Updates and returns the InstallationEntry from the database. - * Also triggers a registration request if it is necessary and possible. - */ -export declare function getInstallationEntry(installations: FirebaseInstallationsImpl): Promise<InstallationEntryWithRegistrationPromise>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/idb-manager.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/helpers/idb-manager.d.ts deleted file mode 100644 index 8ee7efa..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/idb-manager.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { AppConfig } from '../interfaces/installation-impl'; -import { InstallationEntry } from '../interfaces/installation-entry'; -/** Gets record(s) from the objectStore that match the given key. */ -export declare function get(appConfig: AppConfig): Promise<InstallationEntry | undefined>; -/** Assigns or overwrites the record for the given key with the given value. */ -export declare function set<ValueType extends InstallationEntry>(appConfig: AppConfig, value: ValueType): Promise<ValueType>; -/** Removes record(s) from the objectStore that match the given key. */ -export declare function remove(appConfig: AppConfig): Promise<void>; -/** - * Atomically updates a record with the result of updateFn, which gets - * called with the current value. If newValue is undefined, the record is - * deleted instead. - * @return Updated value - */ -export declare function update<ValueType extends InstallationEntry | undefined>(appConfig: AppConfig, updateFn: (previousValue: InstallationEntry | undefined) => ValueType): Promise<ValueType>; -export declare function clear(): Promise<void>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/refresh-auth-token.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/helpers/refresh-auth-token.d.ts deleted file mode 100644 index 9bf6c6b..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/helpers/refresh-auth-token.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { FirebaseInstallationsImpl } from '../interfaces/installation-impl'; -import { CompletedAuthToken } from '../interfaces/installation-entry'; -/** - * Returns a valid authentication token for the installation. Generates a new - * token if one doesn't exist, is expired or about to expire. - * - * Should only be called if the Firebase Installation is registered. - */ -export declare function refreshAuthToken(installations: FirebaseInstallationsImpl, forceRefresh?: boolean): Promise<CompletedAuthToken>; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/index.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/index.d.ts deleted file mode 100644 index 8059f56..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * The Firebase Installations Web SDK. - * This SDK does not work in a Node.js environment. - * - * @packageDocumentation - */ -export * from './api'; -export * from './interfaces/public-types'; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/interfaces/api-response.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/interfaces/api-response.d.ts deleted file mode 100644 index b7ab7fa..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/interfaces/api-response.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -export interface CreateInstallationResponse { - readonly refreshToken: string; - readonly authToken: GenerateAuthTokenResponse; - readonly fid?: string; -} -export interface GenerateAuthTokenResponse { - readonly token: string; - /** - * Encoded as a string with the suffix 's' (indicating seconds), preceded by - * the number of seconds. - * - * Example: "604800s". - */ - readonly expiresIn: string; -} diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/interfaces/installation-entry.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/interfaces/installation-entry.d.ts deleted file mode 100644 index fbdc655..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/interfaces/installation-entry.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** Status of a server request. */ -export declare const enum RequestStatus { - NOT_STARTED = 0, - IN_PROGRESS = 1, - COMPLETED = 2 -} -export interface NotStartedAuthToken { - readonly requestStatus: RequestStatus.NOT_STARTED; -} -export interface InProgressAuthToken { - readonly requestStatus: RequestStatus.IN_PROGRESS; - /** - * Unix timestamp when the current generateAuthRequest was initiated. - * Used for figuring out how long the request status has been IN_PROGRESS. - */ - readonly requestTime: number; -} -export interface CompletedAuthToken { - readonly requestStatus: RequestStatus.COMPLETED; - /** - * Firebase Installations Authentication Token. - * Only exists if requestStatus is COMPLETED. - */ - readonly token: string; - /** - * Unix timestamp when Authentication Token was created. - * Only exists if requestStatus is COMPLETED. - */ - readonly creationTime: number; - /** - * Authentication Token time to live duration in milliseconds. - * Only exists if requestStatus is COMPLETED. - */ - readonly expiresIn: number; -} -export type AuthToken = NotStartedAuthToken | InProgressAuthToken | CompletedAuthToken; -export interface UnregisteredInstallationEntry { - /** Status of the Firebase Installation registration on the server. */ - readonly registrationStatus: RequestStatus.NOT_STARTED; - /** Firebase Installation ID */ - readonly fid: string; -} -export interface InProgressInstallationEntry { - /** Status of the Firebase Installation registration on the server. */ - readonly registrationStatus: RequestStatus.IN_PROGRESS; - /** - * Unix timestamp that shows the time when the current createInstallation - * request was initiated. - * Used for figuring out how long the registration status has been PENDING. - */ - readonly registrationTime: number; - /** Firebase Installation ID */ - readonly fid: string; -} -export interface RegisteredInstallationEntry { - /** Status of the Firebase Installation registration on the server. */ - readonly registrationStatus: RequestStatus.COMPLETED; - /** Firebase Installation ID */ - readonly fid: string; - /** - * Refresh Token returned from the server. - * Used for authenticating generateAuthToken requests. - */ - readonly refreshToken: string; - /** Firebase Installation Authentication Token. */ - readonly authToken: AuthToken; -} -/** Firebase Installation ID and related data in the database. */ -export type InstallationEntry = UnregisteredInstallationEntry | InProgressInstallationEntry | RegisteredInstallationEntry; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/interfaces/installation-impl.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/interfaces/installation-impl.d.ts deleted file mode 100644 index 5c7f8d0..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/interfaces/installation-impl.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * 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. - */ -import { Provider } from '@firebase/component'; -import { _FirebaseService } from '@firebase/app'; -import { Installations } from '../interfaces/public-types'; -export interface FirebaseInstallationsImpl extends Installations, _FirebaseService { - readonly appConfig: AppConfig; - readonly heartbeatServiceProvider: Provider<'heartbeat'>; -} -export interface AppConfig { - readonly appName: string; - readonly projectId: string; - readonly apiKey: string; - readonly appId: string; -} diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/interfaces/public-types.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/interfaces/public-types.d.ts deleted file mode 100644 index 794511e..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/interfaces/public-types.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC - * - * 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. - */ -import { FirebaseApp } from '@firebase/app'; -/** - * Public interface of the Firebase Installations SDK. - * - * @public - */ -export interface Installations { - /** - * The {@link @firebase/app#FirebaseApp} this `Installations` instance is associated with. - */ - app: FirebaseApp; -} -/** - * An interface for Firebase internal SDKs use only. - * - * @internal - */ -export interface _FirebaseInstallationsInternal { - /** - * Creates a Firebase Installation if there isn't one for the app and - * returns the Installation ID. - */ - getId(): Promise<string>; - /** - * Returns an Authentication Token for the current Firebase Installation. - */ - getToken(forceRefresh?: boolean): Promise<string>; -} -declare module '@firebase/component' { - interface NameServiceMapping { - 'installations': Installations; - 'installations-internal': _FirebaseInstallationsInternal; - } -} diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/testing/compare-headers.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/testing/compare-headers.d.ts deleted file mode 100644 index 11bff68..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/testing/compare-headers.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -declare class HeadersWithEntries extends Headers { - entries?(): Iterable<[string, string]>; -} -export declare function compareHeaders(expectedHeaders: HeadersWithEntries, actualHeaders: HeadersWithEntries): void; -export {}; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/testing/fake-generators.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/testing/fake-generators.d.ts deleted file mode 100644 index c03290f..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/testing/fake-generators.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { FirebaseApp } from '@firebase/app'; -import { FirebaseInstallationsImpl, AppConfig } from '../interfaces/installation-impl'; -export declare function getFakeApp(): FirebaseApp; -export declare function getFakeAppConfig(customValues?: Partial<AppConfig>): AppConfig; -export declare function getFakeInstallations(): FirebaseInstallationsImpl; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/testing/setup.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/testing/setup.d.ts deleted file mode 100644 index 1c93d90..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/testing/setup.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -export {}; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/tsdoc-metadata.json b/frontend-old/node_modules/@firebase/installations/dist/src/tsdoc-metadata.json deleted file mode 100644 index 6af1f6a..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/tsdoc-metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -// This file is read by tools that parse documentation comments conforming to the TSDoc standard. -// It should be published with your NPM package. It should not be tracked by Git. -{ - "tsdocVersion": "0.12", - "toolPackages": [ - { - "packageName": "@microsoft/api-extractor", - "packageVersion": "0.1.2" - } - ] -} diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/util/constants.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/util/constants.d.ts deleted file mode 100644 index 1bef807..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/util/constants.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -export declare const PENDING_TIMEOUT_MS = 10000; -export declare const PACKAGE_VERSION: string; -export declare const INTERNAL_AUTH_VERSION = "FIS_v2"; -export declare const INSTALLATIONS_API_URL = "https://firebaseinstallations.googleapis.com/v1"; -export declare const TOKEN_EXPIRATION_BUFFER: number; -export declare const SERVICE = "installations"; -export declare const SERVICE_NAME = "Installations"; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/util/errors.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/util/errors.d.ts deleted file mode 100644 index 8d596b1..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/util/errors.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { ErrorFactory, FirebaseError } from '@firebase/util'; -export declare const enum ErrorCode { - MISSING_APP_CONFIG_VALUES = "missing-app-config-values", - NOT_REGISTERED = "not-registered", - INSTALLATION_NOT_FOUND = "installation-not-found", - REQUEST_FAILED = "request-failed", - APP_OFFLINE = "app-offline", - DELETE_PENDING_REGISTRATION = "delete-pending-registration" -} -interface ErrorParams { - [ErrorCode.MISSING_APP_CONFIG_VALUES]: { - valueName: string; - }; - [ErrorCode.REQUEST_FAILED]: { - requestName: string; - [index: string]: string | number; - } & ServerErrorData; -} -export declare const ERROR_FACTORY: ErrorFactory<ErrorCode, ErrorParams>; -export interface ServerErrorData { - serverCode: number; - serverMessage: string; - serverStatus: string; -} -export type ServerError = FirebaseError & { - customData: ServerErrorData; -}; -/** Returns true if error is a FirebaseError that is based on an error from the server. */ -export declare function isServerError(error: unknown): error is ServerError; -export {}; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/util/get-key.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/util/get-key.d.ts deleted file mode 100644 index 7b20b2e..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/util/get-key.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -import { AppConfig } from '../interfaces/installation-impl'; -/** Returns a string key that can be used to identify the app. */ -export declare function getKey(appConfig: AppConfig): string; diff --git a/frontend-old/node_modules/@firebase/installations/dist/src/util/sleep.d.ts b/frontend-old/node_modules/@firebase/installations/dist/src/util/sleep.d.ts deleted file mode 100644 index f51e6cd..0000000 --- a/frontend-old/node_modules/@firebase/installations/dist/src/util/sleep.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC - * - * 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. - */ -/** Returns a promise that resolves after given time passes. */ -export declare function sleep(ms: number): Promise<void>; diff --git a/frontend-old/node_modules/@firebase/installations/package.json b/frontend-old/node_modules/@firebase/installations/package.json deleted file mode 100644 index beac715..0000000 --- a/frontend-old/node_modules/@firebase/installations/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "@firebase/installations", - "version": "0.6.19", - "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)", - "main": "dist/index.cjs.js", - "module": "dist/esm/index.esm.js", - "browser": "dist/esm/index.esm.js", - "exports": { - ".": { - "types": "./dist/installations-public.d.ts", - "require": "./dist/index.cjs.js", - "default": "./dist/esm/index.esm.js" - }, - "./package.json": "./package.json" - }, - "typings": "./dist/installations-public.d.ts", - "license": "Apache-2.0", - "files": [ - "dist" - ], - "scripts": { - "lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'", - "build": "rollup -c && yarn api-report", - "build:deps": "lerna run --scope @firebase/installations --include-dependencies build", - "build:release": "yarn build && yarn typings:public", - "dev": "rollup -c -w", - "test": "yarn type-check && yarn test:karma && yarn lint", - "test:ci": "node ../../scripts/run_tests_in_ci.js", - "test:karma": "karma start", - "test:debug": "karma start --browsers=Chrome --auto-watch", - "trusted-type-check": "tsec -p tsconfig.json --noEmit", - "type-check": "tsc -p . --noEmit", - "serve": "yarn serve:build && yarn serve:host", - "serve:build": "rollup -c test-app/rollup.config.js", - "serve:host": "http-server -c-1 test-app", - "api-report": "api-extractor run --local --verbose", - "doc": "api-documenter markdown --input temp --output docs", - "build:doc": "yarn build && yarn doc", - "typings:public": "node ../../scripts/build/use_typings.js ./dist/installations-public.d.ts", - "typings:internal": "node ../../scripts/build/use_typings.js ./dist/src/index.d.ts" - }, - "repository": { - "directory": "packages/installations", - "type": "git", - "url": "git+https://github.com/firebase/firebase-js-sdk.git" - }, - "bugs": { - "url": "https://github.com/firebase/firebase-js-sdk/issues" - }, - "devDependencies": { - "@firebase/app": "0.14.0", - "rollup": "2.79.2", - "@rollup/plugin-commonjs": "21.1.0", - "@rollup/plugin-json": "6.1.0", - "@rollup/plugin-node-resolve": "16.0.0", - "rollup-plugin-typescript2": "0.36.0", - "rollup-plugin-uglify": "6.0.4", - "typescript": "5.5.4" - }, - "peerDependencies": { - "@firebase/app": "0.x" - }, - "dependencies": { - "@firebase/util": "1.13.0", - "@firebase/component": "0.7.0", - "idb": "7.1.1", - "tslib": "^2.1.0" - } -} |
