@rxap/firebase 15.0.0 → 16.0.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/esm2022/auth/lib/identity-platform.http-interceptor.mjs +56 -0
  2. package/esm2022/auth/lib/identity-platform.service.mjs +62 -0
  3. package/esm2022/lib/app-check.mjs +99 -0
  4. package/esm2022/lib/firebase-app-check.http-interceptor.mjs +50 -0
  5. package/esm2022/lib/firebase-messaging.service.mjs +59 -0
  6. package/esm2022/lib/storage.mjs +27 -0
  7. package/{fesm2020 → fesm2022}/rxap-firebase-auth.mjs +6 -7
  8. package/fesm2022/rxap-firebase-auth.mjs.map +1 -0
  9. package/{fesm2020 → fesm2022}/rxap-firebase.mjs +17 -18
  10. package/fesm2022/rxap-firebase.mjs.map +1 -0
  11. package/package.json +15 -23
  12. package/esm2020/auth/lib/identity-platform.http-interceptor.mjs +0 -55
  13. package/esm2020/auth/lib/identity-platform.service.mjs +0 -61
  14. package/esm2020/lib/app-check.mjs +0 -97
  15. package/esm2020/lib/firebase-app-check.http-interceptor.mjs +0 -49
  16. package/esm2020/lib/firebase-messaging.service.mjs +0 -58
  17. package/esm2020/lib/storage.mjs +0 -26
  18. package/fesm2015/rxap-firebase-auth.mjs +0 -131
  19. package/fesm2015/rxap-firebase-auth.mjs.map +0 -1
  20. package/fesm2015/rxap-firebase.mjs +0 -507
  21. package/fesm2015/rxap-firebase.mjs.map +0 -1
  22. package/fesm2020/rxap-firebase-auth.mjs.map +0 -1
  23. package/fesm2020/rxap-firebase.mjs.map +0 -1
  24. /package/{esm2020 → esm2022}/auth/public_api.mjs +0 -0
  25. /package/{esm2020 → esm2022}/auth/rxap-firebase-auth.mjs +0 -0
  26. /package/{esm2020 → esm2022}/index.mjs +0 -0
  27. /package/{esm2020 → esm2022}/lib/firebase.config.mjs +0 -0
  28. /package/{esm2020 → esm2022}/lib/firebase.provider.mjs +0 -0
  29. /package/{esm2020 → esm2022}/lib/tokens.mjs +0 -0
  30. /package/{esm2020 → esm2022}/rxap-firebase.mjs +0 -0
@@ -1,507 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, isDevMode, NgZone, Injectable, Inject, Optional, NgModule } from '@angular/core';
3
- import * as i1 from '@rxap/config';
4
- import { ConfigService } from '@rxap/config';
5
- import { FirebaseApp } from '@angular/fire/app';
6
- import { USE_EMULATOR as USE_EMULATOR$2, TENANT_ID, LANGUAGE_CODE, USE_DEVICE_LANGUAGE, PERSISTENCE, SETTINGS as SETTINGS$1 } from '@angular/fire/compat/auth';
7
- import { ɵfirebaseAppFactory, FIREBASE_OPTIONS, FIREBASE_APP_NAME } from '@angular/fire/compat';
8
- import { INSTRUMENTATION_ENABLED, DATA_COLLECTION_ENABLED } from '@angular/fire/compat/performance';
9
- import * as i1$2 from '@angular/fire/compat/storage';
10
- import { BUCKET, MAX_UPLOAD_RETRY_TIME, MAX_OPERATION_RETRY_TIME } from '@angular/fire/compat/storage';
11
- import { COLLECTION_ENABLED, APP_NAME } from '@angular/fire/compat/analytics';
12
- import * as i1$1 from '@angular/fire/compat/messaging';
13
- import { VAPID_KEY, SERVICE_WORKER, AngularFireMessaging } from '@angular/fire/compat/messaging';
14
- import { ENABLE_PERSISTENCE, PERSISTENCE_SETTINGS, SETTINGS, USE_EMULATOR } from '@angular/fire/compat/firestore';
15
- import { REGION, ORIGIN, USE_EMULATOR as USE_EMULATOR$1 } from '@angular/fire/compat/functions';
16
- import { EMPTY, Observable, ReplaySubject, from } from 'rxjs';
17
- import { shareReplay, tap, mergeMapTo, map, switchMap } from 'rxjs/operators';
18
- import * as i1$3 from '@angular/fire/app-check';
19
- import { onTokenChanged, getToken, setTokenAutoRefreshEnabled } from '@angular/fire/app-check';
20
- import { HTTP_INTERCEPTORS } from '@angular/common/http';
21
- import { coerceArray } from '@rxap/utilities';
22
-
23
- const RXAP_REQUEST_CLOUD_MESSAGING_TOKEN = new InjectionToken('rxap/firebase/request-cloud-messaging-token');
24
- const APP_CHECK_ENABLED = new InjectionToken('rxap/firebase/app-check-enabled');
25
- const APP_CHECK_SITE_KEY = new InjectionToken('rxap/firebase/app-check-site-key');
26
- const APP_CHECK_IS_TOKEN_AUTO_REFRESH_ENABLED = new InjectionToken('rxap/firebase/app-check-is-token-auto-refresh-enabled');
27
- const FIREBASE_APP_CHECK_HTTP_INTERCEPTOR_URL_PATTERN = new InjectionToken('firebase-app-check-http-interceptor-url-pattern');
28
-
29
- class AppCheckService {
30
- constructor(options, nameOrConfig, zone, config, enabled, siteKey, isTokenAutoRefreshEnabled) {
31
- this.config = config;
32
- this.enabled = enabled;
33
- this.onTokenChanged$ = EMPTY;
34
- this._appCheck = null;
35
- if (this.enabled) {
36
- if (siteKey) {
37
- const app = ɵfirebaseAppFactory(options, zone, nameOrConfig);
38
- const appCheck = this._appCheck = app.appCheck();
39
- appCheck.activate(siteKey, isTokenAutoRefreshEnabled !== null && isTokenAutoRefreshEnabled !== void 0 ? isTokenAutoRefreshEnabled : undefined);
40
- this.onTokenChanged$ = (new Observable(subscriber => {
41
- onTokenChanged(appCheck, tokenResult => subscriber.next(tokenResult), error => subscriber.error(error), () => subscriber.complete());
42
- })).pipe(shareReplay(1));
43
- }
44
- else {
45
- if (isDevMode()) {
46
- console.error('The app check site key is not provided');
47
- }
48
- }
49
- }
50
- else {
51
- if (isDevMode()) {
52
- console.warn('App check is disabled');
53
- }
54
- }
55
- }
56
- getToken(forceRefresh) {
57
- var _a;
58
- if (this._appCheck) {
59
- return (_a = getToken(this._appCheck, forceRefresh).then(result => result.token)) !== null && _a !== void 0 ? _a : Promise.reject(new Error('firebase app check is not initialized'));
60
- }
61
- return Promise.reject(new Error('firebase app check is not initialized'));
62
- }
63
- setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled) {
64
- if (this._appCheck) {
65
- setTokenAutoRefreshEnabled(this._appCheck, isTokenAutoRefreshEnabled);
66
- }
67
- }
68
- }
69
- AppCheckService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: AppCheckService, deps: [{ token: FIREBASE_OPTIONS }, { token: FIREBASE_APP_NAME, optional: true }, { token: NgZone }, { token: i1.ConfigService }, { token: APP_CHECK_ENABLED, optional: true }, { token: APP_CHECK_SITE_KEY, optional: true }, { token: APP_CHECK_IS_TOKEN_AUTO_REFRESH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
70
- AppCheckService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: AppCheckService });
71
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: AppCheckService, decorators: [{
72
- type: Injectable
73
- }], ctorParameters: function () {
74
- return [{ type: undefined, decorators: [{
75
- type: Inject,
76
- args: [FIREBASE_OPTIONS]
77
- }] }, { type: undefined, decorators: [{
78
- type: Optional
79
- }, {
80
- type: Inject,
81
- args: [FIREBASE_APP_NAME]
82
- }] }, { type: i0.NgZone, decorators: [{
83
- type: Inject,
84
- args: [NgZone]
85
- }] }, { type: i1.ConfigService }, { type: undefined, decorators: [{
86
- type: Optional
87
- }, {
88
- type: Inject,
89
- args: [APP_CHECK_ENABLED]
90
- }] }, { type: undefined, decorators: [{
91
- type: Optional
92
- }, {
93
- type: Inject,
94
- args: [APP_CHECK_SITE_KEY]
95
- }] }, { type: undefined, decorators: [{
96
- type: Optional
97
- }, {
98
- type: Inject,
99
- args: [APP_CHECK_IS_TOKEN_AUTO_REFRESH_ENABLED]
100
- }] }];
101
- } });
102
- class RxapAngularFireAppCheckModule {
103
- constructor(appCheck) {
104
- this.appCheck = appCheck;
105
- }
106
- }
107
- RxapAngularFireAppCheckModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: RxapAngularFireAppCheckModule, deps: [{ token: AppCheckService }], target: i0.ɵɵFactoryTarget.NgModule });
108
- RxapAngularFireAppCheckModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: RxapAngularFireAppCheckModule });
109
- RxapAngularFireAppCheckModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: RxapAngularFireAppCheckModule, providers: [AppCheckService] });
110
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: RxapAngularFireAppCheckModule, decorators: [{
111
- type: NgModule,
112
- args: [{
113
- providers: [AppCheckService]
114
- }]
115
- }], ctorParameters: function () {
116
- return [{ type: AppCheckService, decorators: [{
117
- type: Inject,
118
- args: [AppCheckService]
119
- }] }];
120
- } });
121
-
122
- function FirebaseOptionsTokenFactory(configService) {
123
- return configService.get('firebase.options');
124
- }
125
- function FirebaseNameOrConfigTokenFactory(configService) {
126
- return configService.get('firebase.name', null);
127
- }
128
- function EnablePersistenceTokenFactory(configService) {
129
- return configService.get('firebase.firestore.enablePersistence', false);
130
- }
131
- function PersistenceSettingsTokenFactory(configService) {
132
- return configService.get('firebase.firestore.persistenceSettings', null);
133
- }
134
- function FirestoreSettingsTokenFactory(configService) {
135
- return configService.get('firebase.firestore.settings', null);
136
- }
137
- function FunctionsRegionFactory(configService) {
138
- return configService.get('firebase.functions.region', configService.get('firebase.region', null));
139
- }
140
- function FunctionsOriginFactory(configService) {
141
- return configService.get('firebase.functions.origin', configService.get('firebase.origin', null));
142
- }
143
- function FunctionsNewOriginBehaviorFactory(configService) {
144
- return configService.get('firebase.functions.newOriginBehavior');
145
- }
146
- function InstrumentationEnabledFactory(configService) {
147
- return configService.get('firebase.performance.instrumentationEnabled');
148
- }
149
- function DataCollectionEnabledFactory(configService) {
150
- return configService.get('firebase.performance.dataCollectionEnabled');
151
- }
152
- function VapidKeyFactory(configService) {
153
- return configService.get('firebase.messaging.vapid', configService.get('firebase.vapid'));
154
- }
155
- function AnalyticsEnabledFactory(configService) {
156
- return configService.get('firebase.analytics.enabled', null);
157
- }
158
- function GetAnalyticsAppName(config) {
159
- return config.get('appName');
160
- }
161
- function UseFirestoreEmulatorFactory(configService) {
162
- return configService.get('firebase.emulator.firestore', null);
163
- }
164
- function UseFunctionsEmulatorFactory(configService) {
165
- return configService.get('firebase.emulator.functions', null);
166
- }
167
- function UseAuthEmulatorFactory(configService) {
168
- return configService.get('firebase.emulator.auth', null);
169
- }
170
- function AuthTenantIdFactory(configService) {
171
- return configService.get('firebase.auth.tenantId', null);
172
- }
173
- function AuthLanguageCodeFactory(configService) {
174
- return configService.get('firebase.auth.languageCode', null);
175
- }
176
- function AuthUseDeviceLanguageFactory(configService) {
177
- return configService.get('firebase.auth.useDeviceLanguage', null);
178
- }
179
- function AuthPersistenceFactory(configService) {
180
- return configService.get('firebase.auth.persistence', null);
181
- }
182
- function AuthSettingsFactory(configService) {
183
- return configService.get('firebase.auth.settings', null);
184
- }
185
- function AppCheckEnabledFactory(configService) {
186
- return configService.get('firebase.appCheck.enabled', null);
187
- }
188
- function AppCheckSiteKeyFactory(configService) {
189
- return configService.get('firebase.appCheck.siteKey', null);
190
- }
191
- function AppIsTokenAutoRefreshEnabledFactory(configService) {
192
- return configService.get('firebase.appCheck.isTokenAutoRefreshEnabled', null);
193
- }
194
- function StorageBucketFactory(configService) {
195
- return configService.get('firebase.storage.bucket', configService.get('firebase.storageBucket', null));
196
- }
197
- function StorageMaxUploadRetryTimeFactory(configService) {
198
- return configService.get('firebase.storage.maxUploadRetryTime', null);
199
- }
200
- function StorageMaxOperationRetryTimeFactory(configService) {
201
- return configService.get('firebase.storage.maxOperationRetryTime', null);
202
- }
203
- function ServiceWorkerFactory() {
204
- var _a, _b;
205
- return (_b = (typeof navigator !== 'undefined' && ((_a = navigator.serviceWorker) === null || _a === void 0 ? void 0 : _a.getRegistration()))) !== null && _b !== void 0 ? _b : undefined;
206
- }
207
- const FIREBASE_APP_PROVIDERS = [
208
- {
209
- provide: FIREBASE_OPTIONS,
210
- useFactory: FirebaseOptionsTokenFactory,
211
- deps: [ConfigService]
212
- },
213
- {
214
- provide: FIREBASE_APP_NAME,
215
- useFactory: FirebaseNameOrConfigTokenFactory,
216
- deps: [ConfigService]
217
- },
218
- {
219
- provide: FirebaseApp,
220
- useFactory: ɵfirebaseAppFactory,
221
- deps: [
222
- FIREBASE_OPTIONS,
223
- NgZone,
224
- [new Optional(), FIREBASE_APP_NAME]
225
- ]
226
- }
227
- ];
228
- const FIREBASE_FIRESTORE_PROVIDERS = [
229
- {
230
- provide: ENABLE_PERSISTENCE,
231
- useFactory: EnablePersistenceTokenFactory,
232
- deps: [ConfigService]
233
- },
234
- {
235
- provide: PERSISTENCE_SETTINGS,
236
- useFactory: PersistenceSettingsTokenFactory,
237
- deps: [ConfigService]
238
- },
239
- {
240
- provide: SETTINGS,
241
- useFactory: FirestoreSettingsTokenFactory,
242
- deps: [ConfigService]
243
- },
244
- {
245
- provide: USE_EMULATOR,
246
- useFactory: UseFirestoreEmulatorFactory,
247
- deps: [ConfigService]
248
- }
249
- ];
250
- const FIREBASE_FUNCTIONS_PROVIDERS = [
251
- {
252
- provide: REGION,
253
- useFactory: FunctionsRegionFactory,
254
- deps: [ConfigService]
255
- },
256
- {
257
- provide: ORIGIN,
258
- useFactory: FunctionsOriginFactory,
259
- deps: [ConfigService]
260
- },
261
- {
262
- provide: USE_EMULATOR$1,
263
- useFactory: UseFunctionsEmulatorFactory,
264
- deps: [ConfigService]
265
- }
266
- ];
267
- const FIREBASE_MESSAGING_PROVIDERS = [
268
- {
269
- provide: VAPID_KEY,
270
- useFactory: VapidKeyFactory,
271
- deps: [ConfigService]
272
- },
273
- {
274
- provide: SERVICE_WORKER,
275
- useFactory: ServiceWorkerFactory,
276
- deps: []
277
- }
278
- ];
279
- const FIREBASE_PERFORMANCE_PROVIDERS = [
280
- {
281
- provide: INSTRUMENTATION_ENABLED,
282
- useFactory: InstrumentationEnabledFactory,
283
- deps: [ConfigService]
284
- },
285
- {
286
- provide: DATA_COLLECTION_ENABLED,
287
- useFactory: DataCollectionEnabledFactory,
288
- deps: [ConfigService]
289
- }
290
- ];
291
- const FIREBASE_ANALYTICS_PROVIDERS = [
292
- {
293
- provide: COLLECTION_ENABLED,
294
- useFactory: AnalyticsEnabledFactory,
295
- deps: [ConfigService]
296
- },
297
- {
298
- provide: APP_NAME,
299
- useFactory: GetAnalyticsAppName,
300
- deps: [ConfigService]
301
- }
302
- ];
303
- const FIREBASE_AUTH_PROVIDERS = [
304
- {
305
- provide: USE_EMULATOR$2,
306
- useFactory: UseAuthEmulatorFactory,
307
- deps: [ConfigService]
308
- },
309
- {
310
- provide: TENANT_ID,
311
- useFactory: AuthTenantIdFactory,
312
- deps: [ConfigService]
313
- },
314
- {
315
- provide: LANGUAGE_CODE,
316
- useFactory: AuthLanguageCodeFactory,
317
- deps: [ConfigService]
318
- },
319
- {
320
- provide: USE_DEVICE_LANGUAGE,
321
- useFactory: AuthUseDeviceLanguageFactory,
322
- deps: [ConfigService]
323
- },
324
- {
325
- provide: PERSISTENCE,
326
- useFactory: AuthPersistenceFactory,
327
- deps: [ConfigService]
328
- },
329
- {
330
- provide: SETTINGS$1,
331
- useFactory: AuthSettingsFactory,
332
- deps: [ConfigService]
333
- }
334
- ];
335
- const FIREBASE_APP_CHECK_PROVIDERS = [
336
- {
337
- provide: APP_CHECK_ENABLED,
338
- useFactory: AppCheckEnabledFactory,
339
- deps: [ConfigService]
340
- },
341
- {
342
- provide: APP_CHECK_IS_TOKEN_AUTO_REFRESH_ENABLED,
343
- useFactory: AppIsTokenAutoRefreshEnabledFactory,
344
- deps: [ConfigService]
345
- },
346
- {
347
- provide: APP_CHECK_SITE_KEY,
348
- useFactory: AppCheckSiteKeyFactory,
349
- deps: [ConfigService]
350
- },
351
- AppCheckService,
352
- ];
353
- const FIREBASE_STORAGE_PROVIDERS = [
354
- {
355
- provide: BUCKET,
356
- useFactory: StorageBucketFactory,
357
- deps: [ConfigService]
358
- },
359
- {
360
- provide: MAX_UPLOAD_RETRY_TIME,
361
- useFactory: StorageMaxUploadRetryTimeFactory,
362
- deps: [ConfigService]
363
- },
364
- {
365
- provide: MAX_OPERATION_RETRY_TIME,
366
- useFactory: StorageMaxOperationRetryTimeFactory,
367
- deps: [ConfigService]
368
- }
369
- ];
370
- const FIREBASE_PROVIDERS = [
371
- FIREBASE_APP_PROVIDERS,
372
- FIREBASE_FIRESTORE_PROVIDERS,
373
- FIREBASE_FUNCTIONS_PROVIDERS,
374
- FIREBASE_MESSAGING_PROVIDERS,
375
- FIREBASE_PERFORMANCE_PROVIDERS,
376
- FIREBASE_ANALYTICS_PROVIDERS,
377
- FIREBASE_AUTH_PROVIDERS,
378
- FIREBASE_APP_CHECK_PROVIDERS,
379
- FIREBASE_STORAGE_PROVIDERS
380
- ];
381
-
382
- class RxapFirebaseMessagingService {
383
- constructor(messaging, requestPermissionImminently = false) {
384
- this.messaging = messaging;
385
- this.requestPermissionImminently = requestPermissionImminently;
386
- this.token$ = new ReplaySubject(1);
387
- this.messaging.messages
388
- .pipe(tap((message) => this.showNotification(message.notification.title, message.notification.body)))
389
- .subscribe();
390
- if (this.requestPermissionImminently) {
391
- this.requestPermission();
392
- }
393
- }
394
- requestPermission() {
395
- console.log('request notification permission');
396
- this.messaging.requestPermission
397
- .pipe(mergeMapTo(this.messaging.tokenChanges))
398
- .subscribe((token) => {
399
- console.info('cloud messaging permission is granted');
400
- this.token$.next(token);
401
- }, () => console.error('cloud messaging permission is denied'));
402
- }
403
- showNotification(title, body) {
404
- // Let's check if the browser supports notifications
405
- if (!('Notification' in window)) {
406
- alert('This browser does not support desktop notification');
407
- }
408
- // Let's check whether notification permissions have already been granted
409
- else if (Notification.permission === 'granted') {
410
- // If it's okay let's create a notification
411
- new Notification(title, { body });
412
- }
413
- else {
414
- console.warn('Notification permission is not granted');
415
- }
416
- }
417
- }
418
- RxapFirebaseMessagingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: RxapFirebaseMessagingService, deps: [{ token: AngularFireMessaging }, { token: RXAP_REQUEST_CLOUD_MESSAGING_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
419
- RxapFirebaseMessagingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: RxapFirebaseMessagingService, providedIn: 'root' });
420
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: RxapFirebaseMessagingService, decorators: [{
421
- type: Injectable,
422
- args: [{ providedIn: 'root' }]
423
- }], ctorParameters: function () {
424
- return [{ type: i1$1.AngularFireMessaging, decorators: [{
425
- type: Inject,
426
- args: [AngularFireMessaging]
427
- }] }, { type: undefined, decorators: [{
428
- type: Optional
429
- }, {
430
- type: Inject,
431
- args: [RXAP_REQUEST_CLOUD_MESSAGING_TOKEN]
432
- }] }];
433
- } });
434
-
435
- const USE_STORAGE_EMULATOR = new InjectionToken('rxap/firebase/use-storage-emulator');
436
- class RxapAngularFireStorageModule {
437
- constructor(storage, useEmulator) {
438
- this.storage = storage;
439
- if (useEmulator) {
440
- this.storage.storage.useEmulator(...useEmulator);
441
- }
442
- }
443
- }
444
- RxapAngularFireStorageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: RxapAngularFireStorageModule, deps: [{ token: i1$2.AngularFireStorage }, { token: USE_STORAGE_EMULATOR, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
445
- RxapAngularFireStorageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: RxapAngularFireStorageModule });
446
- RxapAngularFireStorageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: RxapAngularFireStorageModule });
447
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: RxapAngularFireStorageModule, decorators: [{
448
- type: NgModule,
449
- args: [{}]
450
- }], ctorParameters: function () {
451
- return [{ type: i1$2.AngularFireStorage }, { type: undefined, decorators: [{
452
- type: Optional
453
- }, {
454
- type: Inject,
455
- args: [USE_STORAGE_EMULATOR]
456
- }] }];
457
- } });
458
-
459
- class FirebaseAppCheckHttpInterceptor {
460
- constructor(appCheck, urlPattern, enabled) {
461
- this.appCheck = appCheck;
462
- this.enabled = enabled;
463
- this.urlPattern = [];
464
- this.urlPattern = coerceArray(urlPattern);
465
- }
466
- intercept(req, next) {
467
- if (this.enabled && this.isMatch(req)) {
468
- return from(getToken(this.appCheck)).pipe(map(response => response.token), switchMap(token => next.handle(req.clone({
469
- setHeaders: {
470
- 'X-Firebase-AppCheck': token
471
- }
472
- }))));
473
- }
474
- return next.handle(req);
475
- }
476
- isMatch(req) {
477
- return this.urlPattern.some(pattern => req.url.match(pattern));
478
- }
479
- }
480
- FirebaseAppCheckHttpInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: FirebaseAppCheckHttpInterceptor, deps: [{ token: i1$3.AppCheck }, { token: FIREBASE_APP_CHECK_HTTP_INTERCEPTOR_URL_PATTERN }, { token: APP_CHECK_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
481
- FirebaseAppCheckHttpInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: FirebaseAppCheckHttpInterceptor });
482
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: FirebaseAppCheckHttpInterceptor, decorators: [{
483
- type: Injectable
484
- }], ctorParameters: function () {
485
- return [{ type: i1$3.AppCheck }, { type: undefined, decorators: [{
486
- type: Inject,
487
- args: [FIREBASE_APP_CHECK_HTTP_INTERCEPTOR_URL_PATTERN]
488
- }] }, { type: undefined, decorators: [{
489
- type: Optional
490
- }, {
491
- type: Inject,
492
- args: [APP_CHECK_ENABLED]
493
- }] }];
494
- } });
495
- const FIREBASE_APP_CHECK_HTTP_INTERCEPTOR = {
496
- provide: HTTP_INTERCEPTORS,
497
- useClass: FirebaseAppCheckHttpInterceptor,
498
- multi: true
499
- };
500
-
501
- /**
502
- * Generated bundle index. Do not edit.
503
- */
504
-
505
- export { APP_CHECK_ENABLED, APP_CHECK_IS_TOKEN_AUTO_REFRESH_ENABLED, APP_CHECK_SITE_KEY, AnalyticsEnabledFactory, AppCheckEnabledFactory, AppCheckService, AppCheckSiteKeyFactory, AppIsTokenAutoRefreshEnabledFactory, AuthLanguageCodeFactory, AuthPersistenceFactory, AuthSettingsFactory, AuthTenantIdFactory, AuthUseDeviceLanguageFactory, DataCollectionEnabledFactory, EnablePersistenceTokenFactory, FIREBASE_ANALYTICS_PROVIDERS, FIREBASE_APP_CHECK_HTTP_INTERCEPTOR, FIREBASE_APP_CHECK_HTTP_INTERCEPTOR_URL_PATTERN, FIREBASE_APP_CHECK_PROVIDERS, FIREBASE_APP_PROVIDERS, FIREBASE_AUTH_PROVIDERS, FIREBASE_FIRESTORE_PROVIDERS, FIREBASE_FUNCTIONS_PROVIDERS, FIREBASE_MESSAGING_PROVIDERS, FIREBASE_PERFORMANCE_PROVIDERS, FIREBASE_PROVIDERS, FIREBASE_STORAGE_PROVIDERS, FirebaseAppCheckHttpInterceptor, FirebaseNameOrConfigTokenFactory, FirebaseOptionsTokenFactory, FirestoreSettingsTokenFactory, FunctionsNewOriginBehaviorFactory, FunctionsOriginFactory, FunctionsRegionFactory, GetAnalyticsAppName, InstrumentationEnabledFactory, PersistenceSettingsTokenFactory, RXAP_REQUEST_CLOUD_MESSAGING_TOKEN, RxapAngularFireAppCheckModule, RxapAngularFireStorageModule, RxapFirebaseMessagingService, ServiceWorkerFactory, StorageBucketFactory, StorageMaxOperationRetryTimeFactory, StorageMaxUploadRetryTimeFactory, USE_STORAGE_EMULATOR, UseAuthEmulatorFactory, UseFirestoreEmulatorFactory, UseFunctionsEmulatorFactory, VapidKeyFactory };
506
- //# sourceMappingURL=rxap-firebase.mjs.map
507
- //# sourceMappingURL=rxap-firebase.mjs.map