UNPKG

7.06 kBSource Map (JSON)View Raw
1{"version":3,"file":"angular-fire-app-check.js","sources":["../../../src/app-check/app-check.ts","../../../src/app-check/app-check.module.ts","../../../src/app-check/firebase.ts","../../../src/app-check/angular-fire-app-check.ts"],"sourcesContent":["import { AppCheck as FirebaseAppCheck } from 'firebase/app-check';\nimport { ɵgetAllInstancesOf } from '@angular/fire';\nimport { from, timer } from 'rxjs';\nimport { concatMap, distinct } from 'rxjs/operators';\n\nexport const APP_CHECK_PROVIDER_NAME = 'app-check';\n\n// see notes in core/firebase.app.module.ts for why we're building the class like this\n// tslint:disable-next-line:no-empty-interface\nexport interface AppCheck extends FirebaseAppCheck {}\n\nexport class AppCheck {\n constructor(appCheck: FirebaseAppCheck) {\n return appCheck;\n }\n}\n\n// tslint:disable-next-line:no-empty-interface\nexport interface AppCheckInstances extends Array<FirebaseAppCheck> {}\n\nexport class AppCheckInstances {\n constructor() {\n return ɵgetAllInstancesOf<FirebaseAppCheck>(APP_CHECK_PROVIDER_NAME);\n }\n}\n\nexport const appCheckInstance$ = timer(0, 300).pipe(\n concatMap(() => from(ɵgetAllInstancesOf<FirebaseAppCheck>(APP_CHECK_PROVIDER_NAME))),\n distinct(),\n);\n","import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, PLATFORM_ID, isDevMode, Injector } from '@angular/core';\nimport { AppCheck as FirebaseAppCheck } from 'firebase/app-check';\nimport { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire';\nimport { AppCheck, AppCheckInstances, APP_CHECK_PROVIDER_NAME } from './app-check';\nimport { FirebaseApps, FirebaseApp } from '@angular/fire/app';\nimport { registerVersion } from 'firebase/app';\nimport { isPlatformServer } from '@angular/common';\n\nexport const PROVIDED_APP_CHECK_INSTANCES = new InjectionToken<AppCheck[]>('angularfire2.app-check-instances');\nexport const APP_CHECK_NAMESPACE_SYMBOL = Symbol('angularfire2.app-check.namespace');\n\nexport function defaultAppCheckInstanceFactory(provided: FirebaseAppCheck[]|undefined, defaultApp: FirebaseApp) {\n const defaultAppCheck = ɵgetDefaultInstanceOf<FirebaseAppCheck>(APP_CHECK_PROVIDER_NAME, provided, defaultApp);\n return defaultAppCheck && new AppCheck(defaultAppCheck);\n}\n\nconst LOCALHOSTS = ['localhost', '0.0.0.0', '127.0.0.1'];\nconst isLocalhost = typeof window !== 'undefined' && LOCALHOSTS.includes(window.location.hostname);\n\nexport function appCheckInstanceFactory(fn: (injector: Injector) => FirebaseAppCheck) {\n // tslint:disable-next-line:ban-types\n return (zone: NgZone, injector: Injector, platformId: Object) => {\n // Node should use admin token provider, browser devmode and localhost should use debug token\n if (!isPlatformServer(platformId) && (isDevMode() || isLocalhost)) {\n globalThis.FIREBASE_APPCHECK_DEBUG_TOKEN ??= true;\n }\n const appCheck = zone.runOutsideAngular(() => fn(injector));\n return new AppCheck(appCheck);\n };\n}\n\nconst APP_CHECK_INSTANCES_PROVIDER = {\n provide: AppCheckInstances,\n deps: [\n [new Optional(), PROVIDED_APP_CHECK_INSTANCES ],\n ]\n};\n\nconst DEFAULT_APP_CHECK_INSTANCE_PROVIDER = {\n provide: AppCheck,\n useFactory: defaultAppCheckInstanceFactory,\n deps: [\n [new Optional(), PROVIDED_APP_CHECK_INSTANCES ],\n FirebaseApp,\n PLATFORM_ID,\n ]\n};\n\n@NgModule({\n providers: [\n DEFAULT_APP_CHECK_INSTANCE_PROVIDER,\n APP_CHECK_INSTANCES_PROVIDER,\n ]\n})\nexport class AppCheckModule {\n constructor() {\n registerVersion('angularfire', VERSION.full, 'app-check');\n }\n}\n\nexport function provideAppCheck(fn: (injector: Injector) => FirebaseAppCheck, ...deps: any[]): ModuleWithProviders<AppCheckModule> {\n return {\n ngModule: AppCheckModule,\n providers: [{\n provide: PROVIDED_APP_CHECK_INSTANCES,\n useFactory: appCheckInstanceFactory(fn),\n multi: true,\n deps: [\n NgZone,\n Injector,\n PLATFORM_ID,\n ɵAngularFireSchedulers,\n FirebaseApps,\n ...deps,\n ]\n }]\n };\n}\n","// DO NOT MODIFY, this file is autogenerated by tools/build.ts\nexport * from 'firebase/app-check';\nimport { ɵzoneWrap } from '@angular/fire';\nimport {\n getToken as _getToken,\n initializeAppCheck as _initializeAppCheck,\n onTokenChanged as _onTokenChanged,\n setTokenAutoRefreshEnabled as _setTokenAutoRefreshEnabled\n} from 'firebase/app-check';\n\nexport const getToken = ɵzoneWrap(_getToken, true);\nexport const initializeAppCheck = ɵzoneWrap(_initializeAppCheck, true);\nexport const onTokenChanged = ɵzoneWrap(_onTokenChanged, true);\nexport const setTokenAutoRefreshEnabled = ɵzoneWrap(_setTokenAutoRefreshEnabled, true);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["_getToken","_initializeAppCheck","_onTokenChanged","_setTokenAutoRefreshEnabled"],"mappings":";;;;;;;;;;;AAKO,MAAM,uBAAuB,GAAG,WAAW,CAAC;MAMtC,QAAQ;IACnB,YAAY,QAA0B;QACpC,OAAO,QAAQ,CAAC;KACjB;CACF;MAKY,iBAAiB;IAC5B;QACE,OAAO,kBAAkB,CAAmB,uBAAuB,CAAC,CAAC;KACtE;CACF;MAEY,iBAAiB,GAAG,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CACjD,SAAS,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAmB,uBAAuB,CAAC,CAAC,CAAC,EACpF,QAAQ,EAAE;;ACpBL,MAAM,4BAA4B,GAAG,IAAI,cAAc,CAAa,kCAAkC,CAAC,CAAC;AACxG,MAAM,0BAA0B,GAAG,MAAM,CAAC,kCAAkC,CAAC,CAAC;SAErE,8BAA8B,CAAC,QAAsC,EAAE,UAAuB;IAC5G,MAAM,eAAe,GAAG,qBAAqB,CAAmB,uBAAuB,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC/G,OAAO,eAAe,IAAI,IAAI,QAAQ,CAAC,eAAe,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,GAAG,CA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