1 line
6.6 KiB
Text
1 line
6.6 KiB
Text
|
{"version":3,"file":"angular-fire-functions.js","sources":["../../../src/functions/functions.ts","../../../src/functions/functions.module.ts","../../../src/functions/rxfire.ts","../../../src/functions/firebase.ts","../../../src/functions/angular-fire-functions.ts"],"sourcesContent":["import { Functions as FirebaseFunctions } from 'firebase/functions';\nimport { ɵgetAllInstancesOf } from '@angular/fire';\nimport { from, timer } from 'rxjs';\nimport { concatMap, distinct } from 'rxjs/operators';\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 Functions extends FirebaseFunctions {}\n\nexport class Functions {\n constructor(functions: FirebaseFunctions) {\n return functions;\n }\n}\n\nexport const FUNCTIONS_PROVIDER_NAME = 'functions';\n\n// tslint:disable-next-line:no-empty-interface\nexport interface FunctionsInstances extends Array<FirebaseFunctions> {}\n\nexport class FunctionsInstances {\n constructor() {\n return ɵgetAllInstancesOf<FirebaseFunctions>(FUNCTIONS_PROVIDER_NAME);\n }\n}\n\nexport const functionInstance$ = timer(0, 300).pipe(\n concatMap(() => from(ɵgetAllInstancesOf<FirebaseFunctions>(FUNCTIONS_PROVIDER_NAME))),\n distinct(),\n);\n","import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector } from '@angular/core';\nimport { Functions as FirebaseFunctions } from 'firebase/functions';\nimport { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire';\nimport { Functions, FunctionsInstances, FUNCTIONS_PROVIDER_NAME } from './functions';\nimport { FirebaseApps, FirebaseApp } from '@angular/fire/app';\nimport { AuthInstances } from '@angular/fire/auth';\nimport { registerVersion } from 'firebase/app';\nimport { AppCheckInstances } from '@angular/fire/app-check';\n\nexport const PROVIDED_FUNCTIONS_INSTANCES = new InjectionToken<Functions[]>('angularfire2.functions-instances');\n\nexport function defaultFunctionsInstanceFactory(provided: FirebaseFunctions[]|undefined, defaultApp: FirebaseApp) {\n const defaultAuth = ɵgetDefaultInstanceOf<FirebaseFunctions>(FUNCTIONS_PROVIDER_NAME, provided, defaultApp);\n return defaultAuth && new Functions(defaultAuth);\n}\n\nexport function functionsInstanceFactory(fn: (injector: Injector) => FirebaseFunctions) {\n return (zone: NgZone, injector: Injector) => {\n const functions = zone.runOutsideAngular(() => fn(injector));\n return new Functions(functions);\n };\n}\n\nconst FUNCTIONS_INSTANCES_PROVIDER = {\n provide: FunctionsInstances,\n deps: [\n [new Optional(), PROVIDED_FUNCTIONS_INSTANCES ],\n ]\n};\n\nconst DEFAULT_FUNCTIONS_INSTANCE_PROVIDER = {\n provide: Functions,\n useFactory: defaultFunctionsInstanceFactory,\n deps: [\n [new Optional(), PROVIDED_FUNCTIONS_INSTANCES ],\n FirebaseApp,\n ]\n};\n\n@NgModule({\n providers: [\n DEFAULT_FUNCTIONS_INSTANCE_PROVIDER,\n FUNCTIONS_INSTANCES_PROVIDER,\n ]\n})\nexport class FunctionsModule {\n constructor() {\n registerVersion('angularfire', VERSION.full, 'fn');\n }\n}\n\nexport function provideFunctions(fn: (injector: Injector) => FirebaseFunctions, ...deps: any[]): ModuleWithProviders<FunctionsModule> {\n return {\n ngModule: FunctionsModule,\n providers: [{\n provide: PROVIDED_FUNCTIONS_INSTANCES,\n useFactory: functionsInstanceFactory(fn),\n multi: true,\n deps: [\n NgZone,\n Injector,\n ɵAngularFireSchedulers,\n FirebaseApps,\n // Defensively load Auth first, if provided\n [new Optional(), AuthInstances ],\n [new Optional(), AppCheckInstances ],\n ...deps,\n ]\n }]\n };\n}\n","// DO NOT MODIFY, this file is autogenerated by tools/build.ts\nimport { ɵzoneWrap } from '@angular/fire';\nimport {\n httpsCallable as _httpsCallable\n} from 'rxfire/functions';\n\nexport const httpsCallableData = ɵzoneWrap(_httpsCallable, true);\n","// DO NOT MODIFY, this file is autogenerated by tools/build.ts\nexport * from 'firebase/functions
|