From 0ea5adae4ee34dd1bc5ebdd48fbcf10229ec6324 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 24 Apr 2023 14:23:06 -0700 Subject: [PATCH 01/18] Included standalone POC --- packages/database/src/api.ts | 1 + packages/database/src/internal/index.ts | 76 +++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 packages/database/src/internal/index.ts diff --git a/packages/database/src/api.ts b/packages/database/src/api.ts index 65f1321bc6b..786183afd16 100644 --- a/packages/database/src/api.ts +++ b/packages/database/src/api.ts @@ -16,4 +16,5 @@ */ export * from './api.standalone'; +export * from './internal'; export { getDatabase } from './api/Database'; diff --git a/packages/database/src/internal/index.ts b/packages/database/src/internal/index.ts new file mode 100644 index 00000000000..b293445955f --- /dev/null +++ b/packages/database/src/internal/index.ts @@ -0,0 +1,76 @@ +/** + * @license + * Copyright 2017 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-types'; +import { + FirebaseAuthInternal, + FirebaseAuthInternalName +} from '@firebase/auth-interop-types'; +import { + Component, + ComponentContainer, + ComponentType, + Provider +} from '@firebase/component'; +import { _repoManagerDatabaseFromApp, _setSDKVersion } from '../api.standalone'; + + + +/** + * Used by console to create a database based on the app, + * passed database URL and a custom auth implementation. + * + * @param app - A valid FirebaseApp-like object + * @param url - A valid Firebase databaseURL + * @param version - custom version e.g. firebase-admin version + * @param customAuthImpl - custom auth implementation + */ +export function initStandalone({ + app, + url, + version, + customAuthImpl, + nodeAdmin = false +}: { + app: FirebaseApp; + url: string; + version: string; + customAuthImpl: FirebaseAuthInternal; + nodeAdmin?: boolean; +}) { + _setSDKVersion(version); + + /** + * ComponentContainer('database-standalone') is just a placeholder that doesn't perform + * any actual function. + */ + const authProvider = new Provider( + 'auth-internal', + new ComponentContainer('database-standalone') + ); + authProvider.setComponent( + new Component('auth-internal', () => customAuthImpl, ComponentType.PRIVATE) + ); + + return _repoManagerDatabaseFromApp( + app, + authProvider, + /* appCheckProvider= */ undefined, + url, + nodeAdmin + ); +} From 76396fa69ed06c6bfb1616dbdcc7613c12abb76d Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Tue, 25 Apr 2023 17:07:45 -0700 Subject: [PATCH 02/18] Fixed api standalone issue --- packages/database/src/api.standalone.ts | 1 + packages/database/src/api.ts | 1 - packages/database/src/internal/index.ts | 14 ++++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/database/src/api.standalone.ts b/packages/database/src/api.standalone.ts index 876ec67c441..d2b68a7dc10 100644 --- a/packages/database/src/api.standalone.ts +++ b/packages/database/src/api.standalone.ts @@ -95,4 +95,5 @@ export { hijackHash as _TEST_ACCESS_hijackHash, forceRestClient as _TEST_ACCESS_forceRestClient } from './api/test_access'; +export * from './internal/notindex'; /* eslint-enable camelcase */ diff --git a/packages/database/src/api.ts b/packages/database/src/api.ts index 786183afd16..65f1321bc6b 100644 --- a/packages/database/src/api.ts +++ b/packages/database/src/api.ts @@ -16,5 +16,4 @@ */ export * from './api.standalone'; -export * from './internal'; export { getDatabase } from './api/Database'; diff --git a/packages/database/src/internal/index.ts b/packages/database/src/internal/index.ts index b293445955f..de21f91e43f 100644 --- a/packages/database/src/internal/index.ts +++ b/packages/database/src/internal/index.ts @@ -26,20 +26,22 @@ import { ComponentType, Provider } from '@firebase/component'; -import { _repoManagerDatabaseFromApp, _setSDKVersion } from '../api.standalone'; +import { setSDKVersion } from '../core/version'; +import { Database } from '../api.standalone'; +import { repoManagerDatabaseFromApp } from '../api/Database'; /** * Used by console to create a database based on the app, * passed database URL and a custom auth implementation. - * + * @internal * @param app - A valid FirebaseApp-like object * @param url - A valid Firebase databaseURL * @param version - custom version e.g. firebase-admin version * @param customAuthImpl - custom auth implementation */ -export function initStandalone({ +export function _initStandalone({ app, url, version, @@ -51,8 +53,8 @@ export function initStandalone({ version: string; customAuthImpl: FirebaseAuthInternal; nodeAdmin?: boolean; -}) { - _setSDKVersion(version); +}): Database { + setSDKVersion(version); /** * ComponentContainer('database-standalone') is just a placeholder that doesn't perform @@ -66,7 +68,7 @@ export function initStandalone({ new Component('auth-internal', () => customAuthImpl, ComponentType.PRIVATE) ); - return _repoManagerDatabaseFromApp( + return repoManagerDatabaseFromApp( app, authProvider, /* appCheckProvider= */ undefined, From 7b13fd1ffcfec431a3fe85ffe5e7af4a19a5652e Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Tue, 25 Apr 2023 17:12:06 -0700 Subject: [PATCH 03/18] Fixed paths --- packages/database/src/api.standalone.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/database/src/api.standalone.ts b/packages/database/src/api.standalone.ts index d2b68a7dc10..5e51b50c44b 100644 --- a/packages/database/src/api.standalone.ts +++ b/packages/database/src/api.standalone.ts @@ -95,5 +95,5 @@ export { hijackHash as _TEST_ACCESS_hijackHash, forceRestClient as _TEST_ACCESS_forceRestClient } from './api/test_access'; -export * from './internal/notindex'; +export * from './internal/index'; /* eslint-enable camelcase */ From 59e724df65822e8f51bf5c7fc73f1ce5c7145a34 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 8 May 2023 14:49:40 -0400 Subject: [PATCH 04/18] Added appcheck internal param --- packages/database/src/internal/index.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/database/src/internal/index.ts b/packages/database/src/internal/index.ts index de21f91e43f..ad7546988d9 100644 --- a/packages/database/src/internal/index.ts +++ b/packages/database/src/internal/index.ts @@ -29,6 +29,8 @@ import { import { setSDKVersion } from '../core/version'; import { Database } from '../api.standalone'; import { repoManagerDatabaseFromApp } from '../api/Database'; +import { FirebaseAppCheckInternal } from '@firebase/app-check-interop-types'; +import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; @@ -46,12 +48,14 @@ export function _initStandalone({ url, version, customAuthImpl, + customAppCheckImpl, nodeAdmin = false }: { app: FirebaseApp; url: string; version: string; customAuthImpl: FirebaseAuthInternal; + customAppCheckImpl?: FirebaseAppCheckInternal; nodeAdmin?: boolean; }): Database { setSDKVersion(version); @@ -60,10 +64,18 @@ export function _initStandalone({ * ComponentContainer('database-standalone') is just a placeholder that doesn't perform * any actual function. */ + const componentContainer = new ComponentContainer('database-standalone'); const authProvider = new Provider( 'auth-internal', - new ComponentContainer('database-standalone') + componentContainer ); + let appCheckProvider: Provider; + if(customAppCheckImpl) { + appCheckProvider = new Provider( + 'app-check-internal', + componentContainer + ); + } authProvider.setComponent( new Component('auth-internal', () => customAuthImpl, ComponentType.PRIVATE) ); @@ -71,7 +83,7 @@ export function _initStandalone({ return repoManagerDatabaseFromApp( app, authProvider, - /* appCheckProvider= */ undefined, + appCheckProvider, url, nodeAdmin ); From 2e5b9037185488020f4653d3fa22e26ce29ff5ff Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 8 May 2023 14:54:02 -0400 Subject: [PATCH 05/18] Fixed comments and liinting --- .../auth/src/core/strategies/redirect.test.ts | 3 ++- packages/auth/src/model/public_types.ts | 10 ++++---- packages/database/src/internal/index.ts | 23 +++++++++---------- .../src/internals/idb-manager.test.ts | 2 +- .../src/internals/token-manager.test.ts | 6 ++--- .../src/listeners/sw-listeners.test.ts | 4 ++-- packages/storage/src/implementation/string.ts | 2 +- .../storage/src/implementation/taskenums.ts | 2 +- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/auth/src/core/strategies/redirect.test.ts b/packages/auth/src/core/strategies/redirect.test.ts index 897de69cb9b..ace45d84349 100644 --- a/packages/auth/src/core/strategies/redirect.test.ts +++ b/packages/auth/src/core/strategies/redirect.test.ts @@ -238,7 +238,8 @@ describe('core/strategies/redirect', () => { it('returns false if sessionStorage is permission denied', async () => { _getInstance( resolver - )._redirectPersistence = ErroringUnavailablePersistence as unknown as Persistence; + )._redirectPersistence = + ErroringUnavailablePersistence as unknown as Persistence; expect( await _getAndClearPendingRedirectStatus(_getInstance(resolver), auth) ).to.be.false; diff --git a/packages/auth/src/model/public_types.ts b/packages/auth/src/model/public_types.ts index 0b872ec9297..ab945cfb8c7 100644 --- a/packages/auth/src/model/public_types.ts +++ b/packages/auth/src/model/public_types.ts @@ -416,7 +416,7 @@ export interface ActionCodeInfo { /** * The type of operation that generated the action code. */ - operation: typeof ActionCodeOperationMap[keyof typeof ActionCodeOperationMap]; + operation: (typeof ActionCodeOperationMap)[keyof typeof ActionCodeOperationMap]; } /** @@ -589,7 +589,7 @@ export interface ConfirmationResult { */ export interface MultiFactorAssertion { /** The identifier of the second factor. */ - readonly factorId: typeof FactorIdMap[keyof typeof FactorIdMap]; + readonly factorId: (typeof FactorIdMap)[keyof typeof FactorIdMap]; } /** @@ -629,7 +629,7 @@ export interface MultiFactorError extends AuthError { /** * The type of operation (sign-in, linking, or re-authentication) that raised the error. */ - readonly operationType: typeof OperationTypeMap[keyof typeof OperationTypeMap]; + readonly operationType: (typeof OperationTypeMap)[keyof typeof OperationTypeMap]; }; } @@ -646,7 +646,7 @@ export interface MultiFactorInfo { /** The enrollment date of the second factor formatted as a UTC string. */ readonly enrollmentTime: string; /** The identifier of the second factor. */ - readonly factorId: typeof FactorIdMap[keyof typeof FactorIdMap]; + readonly factorId: (typeof FactorIdMap)[keyof typeof FactorIdMap]; } /** @@ -1049,7 +1049,7 @@ export interface UserCredential { /** * The type of operation which was used to authenticate the user (such as sign-in or link). */ - operationType: typeof OperationTypeMap[keyof typeof OperationTypeMap]; + operationType: (typeof OperationTypeMap)[keyof typeof OperationTypeMap]; } /** diff --git a/packages/database/src/internal/index.ts b/packages/database/src/internal/index.ts index ad7546988d9..b91fc96856d 100644 --- a/packages/database/src/internal/index.ts +++ b/packages/database/src/internal/index.ts @@ -32,8 +32,6 @@ import { repoManagerDatabaseFromApp } from '../api/Database'; import { FirebaseAppCheckInternal } from '@firebase/app-check-interop-types'; import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; - - /** * Used by console to create a database based on the app, * passed database URL and a custom auth implementation. @@ -41,6 +39,7 @@ import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types * @param app - A valid FirebaseApp-like object * @param url - A valid Firebase databaseURL * @param version - custom version e.g. firebase-admin version + * @param customAppCheckImpl - custom app check implementation * @param customAuthImpl - custom auth implementation */ export function _initStandalone({ @@ -70,21 +69,21 @@ export function _initStandalone({ componentContainer ); let appCheckProvider: Provider; - if(customAppCheckImpl) { + if (customAppCheckImpl) { appCheckProvider = new Provider( - 'app-check-internal', - componentContainer - ); + 'app-check-internal', + componentContainer + ); } authProvider.setComponent( new Component('auth-internal', () => customAuthImpl, ComponentType.PRIVATE) ); return repoManagerDatabaseFromApp( - app, - authProvider, - appCheckProvider, - url, - nodeAdmin - ); + app, + authProvider, + appCheckProvider, + url, + nodeAdmin + ); } diff --git a/packages/messaging/src/internals/idb-manager.test.ts b/packages/messaging/src/internals/idb-manager.test.ts index c66f11ad440..5b12a488719 100644 --- a/packages/messaging/src/internals/idb-manager.test.ts +++ b/packages/messaging/src/internals/idb-manager.test.ts @@ -72,7 +72,7 @@ describe('idb manager', () => { describe('old DB migration', () => { let migrateOldDatabaseStub: Stub< - typeof migrateOldDatabaseModule['migrateOldDatabase'] + (typeof migrateOldDatabaseModule)['migrateOldDatabase'] >; beforeEach(() => { diff --git a/packages/messaging/src/internals/token-manager.test.ts b/packages/messaging/src/internals/token-manager.test.ts index 2129d82a34a..fd2bcf1105d 100644 --- a/packages/messaging/src/internals/token-manager.test.ts +++ b/packages/messaging/src/internals/token-manager.test.ts @@ -39,9 +39,9 @@ import { getFakeTokenDetails } from '../testing/fakes/token-details'; describe('Token Manager', () => { let tokenDetails: TokenDetails; let messaging: MessagingService; - let requestGetTokenStub: Stub; - let requestUpdateTokenStub: Stub; - let requestDeleteTokenStub: Stub; + let requestGetTokenStub: Stub<(typeof apiModule)['requestGetToken']>; + let requestUpdateTokenStub: Stub<(typeof apiModule)['requestUpdateToken']>; + let requestDeleteTokenStub: Stub<(typeof apiModule)['requestDeleteToken']>; beforeEach(() => { tokenDetails = getFakeTokenDetails(); diff --git a/packages/messaging/src/listeners/sw-listeners.test.ts b/packages/messaging/src/listeners/sw-listeners.test.ts index 867ac28c4a4..e3c04cfbf5e 100644 --- a/packages/messaging/src/listeners/sw-listeners.test.ts +++ b/packages/messaging/src/listeners/sw-listeners.test.ts @@ -92,9 +92,9 @@ describe('SwController', () => { // eslint-disable-next-line @typescript-eslint/ban-types let eventListenerMap: Map; let messaging: MessagingService; - let getTokenStub: Stub; + let getTokenStub: Stub<(typeof tokenManagementModule)['getTokenInternal']>; let deleteTokenStub: Stub< - typeof tokenManagementModule['deleteTokenInternal'] + (typeof tokenManagementModule)['deleteTokenInternal'] >; beforeEach(() => { diff --git a/packages/storage/src/implementation/string.ts b/packages/storage/src/implementation/string.ts index 6fbac66f55a..968ad12ce13 100644 --- a/packages/storage/src/implementation/string.ts +++ b/packages/storage/src/implementation/string.ts @@ -22,7 +22,7 @@ import { decodeBase64 } from '../platform/base64'; * An enumeration of the possible string formats for upload. * @public */ -export type StringFormat = typeof StringFormat[keyof typeof StringFormat]; +export type StringFormat = (typeof StringFormat)[keyof typeof StringFormat]; /** * An enumeration of the possible string formats for upload. * @public diff --git a/packages/storage/src/implementation/taskenums.ts b/packages/storage/src/implementation/taskenums.ts index 8be4e3a34c6..6ff513c3442 100644 --- a/packages/storage/src/implementation/taskenums.ts +++ b/packages/storage/src/implementation/taskenums.ts @@ -62,7 +62,7 @@ export const enum InternalTaskState { * Represents the current state of a running upload. * @internal */ -export type TaskState = typeof TaskState[keyof typeof TaskState]; +export type TaskState = (typeof TaskState)[keyof typeof TaskState]; // type keys = keyof TaskState /** From 83ca363fc791021c323d5500e42cc6891993cddc Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 8 May 2023 15:02:05 -0400 Subject: [PATCH 06/18] Fixed linting --- packages/database/src/internal/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/database/src/internal/index.ts b/packages/database/src/internal/index.ts index b91fc96856d..ee649fca946 100644 --- a/packages/database/src/internal/index.ts +++ b/packages/database/src/internal/index.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import { FirebaseAppCheckInternal , AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; import { FirebaseApp } from '@firebase/app-types'; import { FirebaseAuthInternal, @@ -26,11 +27,10 @@ import { ComponentType, Provider } from '@firebase/component'; -import { setSDKVersion } from '../core/version'; + import { Database } from '../api.standalone'; import { repoManagerDatabaseFromApp } from '../api/Database'; -import { FirebaseAppCheckInternal } from '@firebase/app-check-interop-types'; -import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; +import { setSDKVersion } from '../core/version'; /** * Used by console to create a database based on the app, From a53903267320010f2a7b39c2e6800fe4f3dc8c14 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 8 May 2023 15:07:24 -0400 Subject: [PATCH 07/18] Fixed linting --- packages/database/src/internal/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/database/src/internal/index.ts b/packages/database/src/internal/index.ts index ee649fca946..ca446380694 100644 --- a/packages/database/src/internal/index.ts +++ b/packages/database/src/internal/index.ts @@ -15,7 +15,10 @@ * limitations under the License. */ -import { FirebaseAppCheckInternal , AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; +import { + FirebaseAppCheckInternal, + AppCheckInternalComponentName +} from '@firebase/app-check-interop-types'; import { FirebaseApp } from '@firebase/app-types'; import { FirebaseAuthInternal, From a1343cce31ea02bdec796a9a158ca4ddceb5fb98 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Tue, 30 May 2023 08:17:51 -0700 Subject: [PATCH 08/18] Included appcheck in initStandalone --- packages/database-compat/src/api/internal.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/database-compat/src/api/internal.ts b/packages/database-compat/src/api/internal.ts index 6a8defcef7e..3e9c76ce0cf 100644 --- a/packages/database-compat/src/api/internal.ts +++ b/packages/database-compat/src/api/internal.ts @@ -33,6 +33,10 @@ import { import * as types from '@firebase/database-types'; import { Database } from './Database'; +import { + AppCheckInternalComponentName, + FirebaseAppCheckInternal +} from '@firebase/app-check-interop-types'; /** * Used by console to create a database based on the app, @@ -48,6 +52,7 @@ export function initStandalone({ url, version, customAuthImpl, + customAppCheckImpl, namespace, nodeAdmin = false }: { @@ -55,6 +60,7 @@ export function initStandalone({ url: string; version: string; customAuthImpl: FirebaseAuthInternal; + customAppCheckImpl?: FirebaseAppCheckInternal; namespace: T; nodeAdmin?: boolean; }): { @@ -63,24 +69,33 @@ export function initStandalone({ } { _setSDKVersion(version); + const container = new ComponentContainer('database-standalone'); /** * ComponentContainer('database-standalone') is just a placeholder that doesn't perform * any actual function. */ const authProvider = new Provider( 'auth-internal', - new ComponentContainer('database-standalone') + container ); authProvider.setComponent( new Component('auth-internal', () => customAuthImpl, ComponentType.PRIVATE) ); + let appCheckProvider: Provider = undefined; + if (customAppCheckImpl) { + appCheckProvider = new Provider( + 'app-check-internal', + container + ); + } + return { instance: new Database( _repoManagerDatabaseFromApp( app, authProvider, - /* appCheckProvider= */ undefined, + appCheckProvider, url, nodeAdmin ), From 2ccc5b13a72494a13e8c3cb7222aa7b09ec61837 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 5 Jun 2023 10:14:44 -0700 Subject: [PATCH 09/18] Addressed linting --- packages/database-compat/src/api/internal.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/database-compat/src/api/internal.ts b/packages/database-compat/src/api/internal.ts index 3e9c76ce0cf..f1d3d801e8b 100644 --- a/packages/database-compat/src/api/internal.ts +++ b/packages/database-compat/src/api/internal.ts @@ -14,7 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +import { + AppCheckInternalComponentName, + FirebaseAppCheckInternal +} from '@firebase/app-check-interop-types'; import { FirebaseApp } from '@firebase/app-types'; import { FirebaseAuthInternal, @@ -33,10 +36,7 @@ import { import * as types from '@firebase/database-types'; import { Database } from './Database'; -import { - AppCheckInternalComponentName, - FirebaseAppCheckInternal -} from '@firebase/app-check-interop-types'; + /** * Used by console to create a database based on the app, From ecc31509693da61d75f16ed287e2a414a5e109d9 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 5 Jun 2023 10:14:57 -0700 Subject: [PATCH 10/18] Ran formatter --- packages/database-compat/src/api/internal.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/database-compat/src/api/internal.ts b/packages/database-compat/src/api/internal.ts index f1d3d801e8b..d1749575600 100644 --- a/packages/database-compat/src/api/internal.ts +++ b/packages/database-compat/src/api/internal.ts @@ -37,7 +37,6 @@ import * as types from '@firebase/database-types'; import { Database } from './Database'; - /** * Used by console to create a database based on the app, * passed database URL and a custom auth implementation. From a07b14ff801946b64ba8337c5c93b4219875d145 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 5 Jun 2023 16:08:12 -0700 Subject: [PATCH 11/18] Create pretty-donkeys-brush.md --- .changeset/pretty-donkeys-brush.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/pretty-donkeys-brush.md diff --git a/.changeset/pretty-donkeys-brush.md b/.changeset/pretty-donkeys-brush.md new file mode 100644 index 00000000000..eebaca395f0 --- /dev/null +++ b/.changeset/pretty-donkeys-brush.md @@ -0,0 +1,6 @@ +--- +"@firebase/database-compat": patch +"@firebase/database": patch +--- + +Included `initStandalone` as an internal method to RTDB. From 642285a3ca1d0e3b926bad7903b4cab8765b7a96 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 5 Jun 2023 16:12:43 -0700 Subject: [PATCH 12/18] Added customappcheckimpl --- packages/database-compat/src/api/internal.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/database-compat/src/api/internal.ts b/packages/database-compat/src/api/internal.ts index d1749575600..5e53c3cf762 100644 --- a/packages/database-compat/src/api/internal.ts +++ b/packages/database-compat/src/api/internal.ts @@ -87,6 +87,13 @@ export function initStandalone({ 'app-check-internal', container ); + appCheckProvider.setComponent( + new Component( + 'app-check-internal', + () => customAppCheckImpl, + ComponentType.PRIVATE + ) + ); } return { From 1f088bb926b4728cb936268ad186ec236b53be5c Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 5 Jun 2023 16:13:55 -0700 Subject: [PATCH 13/18] Added appcheckinternal component --- packages/database/src/internal/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/database/src/internal/index.ts b/packages/database/src/internal/index.ts index ca446380694..f1886229689 100644 --- a/packages/database/src/internal/index.ts +++ b/packages/database/src/internal/index.ts @@ -77,6 +77,13 @@ export function _initStandalone({ 'app-check-internal', componentContainer ); + appCheckProvider.setComponent( + new Component( + 'app-check-internal', + () => customAppCheckImpl, + ComponentType.PRIVATE + ) + ); } authProvider.setComponent( new Component('auth-internal', () => customAuthImpl, ComponentType.PRIVATE) From 1357fe1a65ae7a53594b38c625d2b4bbcf4d024a Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Thu, 29 Jun 2023 15:03:30 -0700 Subject: [PATCH 14/18] Updated license --- packages/database/src/internal/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/database/src/internal/index.ts b/packages/database/src/internal/index.ts index f1886229689..99fa4e1369f 100644 --- a/packages/database/src/internal/index.ts +++ b/packages/database/src/internal/index.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright 2017 Google LLC + * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 0cf69f56157c727c65c8fc0acfb43f0adb567927 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Wed, 5 Jul 2023 14:34:56 -0700 Subject: [PATCH 15/18] Updated types --- packages/database/src/internal/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/database/src/internal/index.ts b/packages/database/src/internal/index.ts index 99fa4e1369f..f68d7e4eb59 100644 --- a/packages/database/src/internal/index.ts +++ b/packages/database/src/internal/index.ts @@ -19,11 +19,8 @@ import { FirebaseAppCheckInternal, AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; -import { FirebaseApp } from '@firebase/app-types'; -import { - FirebaseAuthInternal, - FirebaseAuthInternalName -} from '@firebase/auth-interop-types'; +import { FirebaseApp } from '@firebase/app'; + import { Component, ComponentContainer, @@ -34,6 +31,7 @@ import { import { Database } from '../api.standalone'; import { repoManagerDatabaseFromApp } from '../api/Database'; import { setSDKVersion } from '../core/version'; +import { FirebaseAuthInternal, FirebaseAuthInternalName } from '@firebase/auth-interop-types'; /** * Used by console to create a database based on the app, From 4fcedf58b7ce7c3b861d3fa55949d34f38283917 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Mon, 10 Jul 2023 15:26:33 -0700 Subject: [PATCH 16/18] Updated formatting --- packages/database/src/internal/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/database/src/internal/index.ts b/packages/database/src/internal/index.ts index f68d7e4eb59..b8ef9ff9b7d 100644 --- a/packages/database/src/internal/index.ts +++ b/packages/database/src/internal/index.ts @@ -31,7 +31,10 @@ import { import { Database } from '../api.standalone'; import { repoManagerDatabaseFromApp } from '../api/Database'; import { setSDKVersion } from '../core/version'; -import { FirebaseAuthInternal, FirebaseAuthInternalName } from '@firebase/auth-interop-types'; +import { + FirebaseAuthInternal, + FirebaseAuthInternalName +} from '@firebase/auth-interop-types'; /** * Used by console to create a database based on the app, From 02f1c16bce9bda9eca4e2d6e14e4350ff7e8eafb Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Tue, 11 Jul 2023 16:32:45 -0700 Subject: [PATCH 17/18] Revert "Updated formatting" This reverts commit 4fcedf58b7ce7c3b861d3fa55949d34f38283917. --- packages/database/src/internal/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/database/src/internal/index.ts b/packages/database/src/internal/index.ts index b8ef9ff9b7d..f68d7e4eb59 100644 --- a/packages/database/src/internal/index.ts +++ b/packages/database/src/internal/index.ts @@ -31,10 +31,7 @@ import { import { Database } from '../api.standalone'; import { repoManagerDatabaseFromApp } from '../api/Database'; import { setSDKVersion } from '../core/version'; -import { - FirebaseAuthInternal, - FirebaseAuthInternalName -} from '@firebase/auth-interop-types'; +import { FirebaseAuthInternal, FirebaseAuthInternalName } from '@firebase/auth-interop-types'; /** * Used by console to create a database based on the app, From 2887b7275ec81ded3640551cc6da5218931ecc65 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Tue, 11 Jul 2023 16:33:15 -0700 Subject: [PATCH 18/18] Revert "Updated types" This reverts commit 0cf69f56157c727c65c8fc0acfb43f0adb567927. --- packages/database/src/internal/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/database/src/internal/index.ts b/packages/database/src/internal/index.ts index f68d7e4eb59..99fa4e1369f 100644 --- a/packages/database/src/internal/index.ts +++ b/packages/database/src/internal/index.ts @@ -19,8 +19,11 @@ import { FirebaseAppCheckInternal, AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; -import { FirebaseApp } from '@firebase/app'; - +import { FirebaseApp } from '@firebase/app-types'; +import { + FirebaseAuthInternal, + FirebaseAuthInternalName +} from '@firebase/auth-interop-types'; import { Component, ComponentContainer, @@ -31,7 +34,6 @@ import { import { Database } from '../api.standalone'; import { repoManagerDatabaseFromApp } from '../api/Database'; import { setSDKVersion } from '../core/version'; -import { FirebaseAuthInternal, FirebaseAuthInternalName } from '@firebase/auth-interop-types'; /** * Used by console to create a database based on the app,