1 line
No EOL
8.1 KiB
Text
1 line
No EOL
8.1 KiB
Text
{"version":3,"file":"angular-fire-storage.js","sources":["../../../src/storage/storage.ts","../../../src/storage/storage.module.ts","../../../src/storage/rxfire.ts","../../../src/storage/firebase.ts","../../../src/storage/angular-fire-storage.ts"],"sourcesContent":["import { FirebaseStorage } from 'firebase/storage';\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 Storage extends FirebaseStorage {}\n\nexport class Storage {\n constructor(auth: FirebaseStorage) {\n return auth;\n }\n}\n\nexport const STORAGE_PROVIDER_NAME = 'storage';\n\n// tslint:disable-next-line:no-empty-interface\nexport interface StorageInstances extends Array<FirebaseStorage> {}\n\nexport class StorageInstances {\n constructor() {\n return ɵgetAllInstancesOf<FirebaseStorage>(STORAGE_PROVIDER_NAME);\n }\n}\n\nexport const storageInstance$ = timer(0, 300).pipe(\n concatMap(() => from(ɵgetAllInstancesOf<FirebaseStorage>(STORAGE_PROVIDER_NAME))),\n distinct(),\n);\n","import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector } from '@angular/core';\nimport { FirebaseStorage } from 'firebase/storage';\nimport { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION } from '@angular/fire';\nimport { Storage, StorageInstances, STORAGE_PROVIDER_NAME } from './storage';\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_STORAGE_INSTANCES = new InjectionToken<Storage[]>('angularfire2.storage-instances');\n\nexport function defaultStorageInstanceFactory(provided: FirebaseStorage[]|undefined, defaultApp: FirebaseApp) {\n const defaultStorage = ɵgetDefaultInstanceOf<FirebaseStorage>(STORAGE_PROVIDER_NAME, provided, defaultApp);\n return defaultStorage && new Storage(defaultStorage);\n}\n\nexport function storageInstanceFactory(fn: (injector: Injector) => FirebaseStorage) {\n return (zone: NgZone, injector: Injector) => {\n const storage = zone.runOutsideAngular(() => fn(injector));\n return new Storage(storage);\n };\n}\n\nconst STORAGE_INSTANCES_PROVIDER = {\n provide: StorageInstances,\n deps: [\n [new Optional(), PROVIDED_STORAGE_INSTANCES ],\n ]\n};\n\nconst DEFAULT_STORAGE_INSTANCE_PROVIDER = {\n provide: Storage,\n useFactory: defaultStorageInstanceFactory,\n deps: [\n [new Optional(), PROVIDED_STORAGE_INSTANCES ],\n FirebaseApp,\n ]\n};\n\n@NgModule({\n providers: [\n DEFAULT_STORAGE_INSTANCE_PROVIDER,\n STORAGE_INSTANCES_PROVIDER,\n ]\n})\nexport class StorageModule {\n constructor() {\n registerVersion('angularfire', VERSION.full, 'gcs');\n }\n}\n\nexport function provideStorage(fn: (injector: Injector) => FirebaseStorage, ...deps: any[]): ModuleWithProviders<StorageModule> {\n return {\n ngModule: StorageModule,\n providers: [{\n provide: PROVIDED_STORAGE_INSTANCES,\n useFactory: storageInstanceFactory(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 fromTask as _fromTask,\n percentage as _percentage\n} from 'rxfire/storage';\n\nexport const fromTask = ɵzoneWrap(_fromTask, true);\nexport const percentage = ɵzoneWrap(_percentage, true);\n","// DO NOT MODIFY, this file is autogenerated by tools/build.ts\nexport * from 'firebase/storage';\nimport { ɵzoneWrap } from '@angular/fire';\nimport {\n connectStorageEmulator as _connectStorageEmulator,\n deleteObject as _deleteObject,\n getBlob as _getBlob,\n getBytes as _getBytes,\n getDownloadURL as _getDownloadURL,\n getMetadata as _getMetadata,\n getStorage as _getStorage,\n getStream as _getStream,\n list as _list,\n listAll as _listAll,\n ref as _ref,\n updateMetadata as _updateMetadata,\n uploadBytes as _uploadBytes,\n uploadBytesResumable as _uploadBytesResumable,\n uploadString as _uploadString\n} from 'firebase/storage';\n\nexport const connectStorageEmulator = ɵzoneWrap(_connectStorageEmulator, true);\nexport const deleteObject = ɵzoneWrap(_deleteObject, true);\nexport const getBlob = ɵzoneWrap(_getBlob, true);\nexport const getBytes = ɵzoneWrap(_getBytes, true);\nexport const getDownloadURL = ɵzoneWrap(_getDownloadURL, true);\nexport const getMetadata = ɵzoneWrap(_getMetadata, true);\nexport const getStorage = ɵzoneWrap(_getStorage, true);\nexport const getStream = ɵzoneWrap(_getStream, true);\nexport const list = ɵzoneWrap(_list, true);\nexport const listAll = ɵzoneWrap(_listAll, true);\nexport const ref = ɵzoneWrap(_ref, true);\nexport const updateMetadata = ɵzoneWrap(_updateMetadata, true);\nexport const uploadBytes = ɵzoneWrap(_uploadBytes, true);\nexport const uploadBytesResumable = ɵzoneWrap(_uploadBytesResumable, true);\nexport const uploadString = ɵzoneWrap(_uploadString, true);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["_fromTask","_percentage","_connectStorageEmulator","_deleteObject","_getBlob","_getBytes","_getDownloadURL","_getMetadata","_getStorage","_getStream","_list","_listAll","_ref","_updateMetadata","_uploadBytes","_uploadBytesResumable","_uploadString"],"mappings":";;;;;;;;;;;;;MASa,OAAO;IAClB,YAAY,IAAqB;QAC/B,OAAO,IAAI,CAAC;KACb;CACF;AAEM,MAAM,qBAAqB,GAAG,SAAS,CAAC;MAKlC,gBAAgB;IAC3B;QACE,OAAO,kBAAkB,CAAkB,qBAAqB,CAAC,CAAC;KACnE;CACF;MAEY,gBAAgB,GAAG,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAChD,SAAS,CAAC,MAAM,IAAI,CAAC,kBAAkB,CA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