@infrab4a/connect-angular 0.13.0-beta.2 → 0.13.0-beta.4
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.
- package/bundles/infrab4a-connect-angular.umd.js +45 -28
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/lib/angular-connect.module.js +5 -4
- package/esm2015/lib/angular-firebase-auth.module.js +4 -2
- package/esm2015/lib/angular-firestore.module.js +4 -2
- package/esm2015/lib/factories/firebase-auth.factory.js +3 -0
- package/esm2015/lib/providers/firebase-auth.provider.js +13 -0
- package/esm2015/lib/providers/firebase-firestore.provider.js +5 -1
- package/esm2015/lib/providers/index.js +2 -1
- package/esm2015/lib/services/auth.service.js +5 -5
- package/esm2015/lib/services/order.service.js +5 -5
- package/fesm2015/infrab4a-connect-angular.js +40 -22
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/lib/angular-connect.module.d.ts +3 -2
- package/lib/factories/firebase-auth.factory.d.ts +2 -0
- package/lib/providers/firebase-auth.provider.d.ts +9 -0
- package/lib/providers/firebase-firestore.provider.d.ts +1 -0
- package/lib/providers/index.d.ts +1 -0
- package/lib/services/auth.service.d.ts +2 -2
- package/lib/services/order.service.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a["connect-angular"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.
|
|
5
|
-
})(this, (function (exports, i0, rxjs, operators,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('firebase'), require('@infrab4a/connect'), require('js-cookie'), require('firebase/app')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', 'firebase', '@infrab4a/connect', 'js-cookie', 'firebase/app'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a["connect-angular"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.firebase, global["@infrab4a/connect"], global["js-cookie"], global.firebase$1));
|
|
5
|
+
})(this, (function (exports, i0, rxjs, operators, firebase, i2, cookie, firebase$1) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -25,11 +25,9 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
|
-
var
|
|
28
|
+
var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
|
|
29
29
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
30
30
|
var cookie__default = /*#__PURE__*/_interopDefaultLegacy(cookie);
|
|
31
|
-
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
32
|
-
var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
|
|
33
31
|
var firebase__default$1 = /*#__PURE__*/_interopDefaultLegacy(firebase$1);
|
|
34
32
|
|
|
35
33
|
/*! *****************************************************************************
|
|
@@ -350,6 +348,20 @@
|
|
|
350
348
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
351
349
|
}
|
|
352
350
|
|
|
351
|
+
var FirebaseAuthFactory = function () { return firebase__default["default"].auth(); };
|
|
352
|
+
|
|
353
|
+
var ConnectAngularFirebaseAuth = /** @class */ (function () {
|
|
354
|
+
function ConnectAngularFirebaseAuth() {
|
|
355
|
+
this.onAuthStateChanged = firebase__default["default"].auth().onAuthStateChanged;
|
|
356
|
+
this.currentUser = firebase__default["default"].auth().currentUser;
|
|
357
|
+
}
|
|
358
|
+
return ConnectAngularFirebaseAuth;
|
|
359
|
+
}());
|
|
360
|
+
var FirebaseAuthProvider = {
|
|
361
|
+
provide: ConnectAngularFirebaseAuth,
|
|
362
|
+
useFactory: FirebaseAuthFactory,
|
|
363
|
+
};
|
|
364
|
+
|
|
353
365
|
var fromCallback = function (cb, zone) { return new rxjs.Observable(function (subscriber) { return ({ unsubscribe: zone.runOutsideAngular(function () { return cb(subscriber); }) }); }); };
|
|
354
366
|
var AuthService = /** @class */ (function () {
|
|
355
367
|
function AuthService(firebaseAuth, userRepository, zone) {
|
|
@@ -383,12 +395,12 @@
|
|
|
383
395
|
};
|
|
384
396
|
return AuthService;
|
|
385
397
|
}());
|
|
386
|
-
AuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, deps: [{ token:
|
|
398
|
+
AuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, deps: [{ token: ConnectAngularFirebaseAuth }, { token: 'UserRepository' }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
387
399
|
AuthService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService });
|
|
388
400
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, decorators: [{
|
|
389
401
|
type: i0.Injectable
|
|
390
402
|
}], ctorParameters: function () {
|
|
391
|
-
return [{ type:
|
|
403
|
+
return [{ type: ConnectAngularFirebaseAuth }, { type: undefined, decorators: [{
|
|
392
404
|
type: i0.Inject,
|
|
393
405
|
args: ['UserRepository']
|
|
394
406
|
}] }, { type: i0__namespace.NgZone }];
|
|
@@ -742,6 +754,19 @@
|
|
|
742
754
|
}] }];
|
|
743
755
|
} });
|
|
744
756
|
|
|
757
|
+
var FirebaseFirestoreFactory = function () { return firebase__default["default"].firestore(); };
|
|
758
|
+
|
|
759
|
+
var ConnectAngularFirebaseFirestore = /** @class */ (function () {
|
|
760
|
+
function ConnectAngularFirebaseFirestore() {
|
|
761
|
+
this.doc = firebase__default["default"].firestore().doc;
|
|
762
|
+
}
|
|
763
|
+
return ConnectAngularFirebaseFirestore;
|
|
764
|
+
}());
|
|
765
|
+
var FirebaseFirestoreProvider = {
|
|
766
|
+
provide: ConnectAngularFirebaseFirestore,
|
|
767
|
+
useFactory: FirebaseFirestoreFactory,
|
|
768
|
+
};
|
|
769
|
+
|
|
745
770
|
var OrderService = /** @class */ (function () {
|
|
746
771
|
function OrderService(firebaseFirestore, orderRepository) {
|
|
747
772
|
this.firebaseFirestore = firebaseFirestore;
|
|
@@ -758,12 +783,12 @@
|
|
|
758
783
|
};
|
|
759
784
|
return OrderService;
|
|
760
785
|
}());
|
|
761
|
-
OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, deps: [{ token:
|
|
786
|
+
OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, deps: [{ token: ConnectAngularFirebaseFirestore }, { token: 'OrderRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
762
787
|
OrderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService });
|
|
763
788
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, decorators: [{
|
|
764
789
|
type: i0.Injectable
|
|
765
790
|
}], ctorParameters: function () {
|
|
766
|
-
return [{ type:
|
|
791
|
+
return [{ type: ConnectAngularFirebaseFirestore }, { type: i2__namespace.OrderFirestoreRepository, decorators: [{
|
|
767
792
|
type: i0.Inject,
|
|
768
793
|
args: ['OrderRepository']
|
|
769
794
|
}] }];
|
|
@@ -773,8 +798,8 @@
|
|
|
773
798
|
var name = ((i2.isString(nameOrConfig) && nameOrConfig) || '[DEFAULT]').toString();
|
|
774
799
|
var config = ((i2.isObject(nameOrConfig) && nameOrConfig) || {});
|
|
775
800
|
config.name = config.name || name;
|
|
776
|
-
var existingApp = firebase__default["default"].apps.filter(function (firebaseApp) { return firebaseApp && firebaseApp.name === config.name; })[0];
|
|
777
|
-
var app = existingApp || zone.runOutsideAngular(function () { return firebase__default["default"].initializeApp(options, config); });
|
|
801
|
+
var existingApp = firebase__default$1["default"].apps.filter(function (firebaseApp) { return firebaseApp && firebaseApp.name === config.name; })[0];
|
|
802
|
+
var app = existingApp || zone.runOutsideAngular(function () { return firebase__default$1["default"].initializeApp(options, config); });
|
|
778
803
|
try {
|
|
779
804
|
if (JSON.stringify(options) !== JSON.stringify(app.options)) {
|
|
780
805
|
console.error('error', app.name + " Firebase App already initialized with different options : '.'\n }");
|
|
@@ -797,18 +822,6 @@
|
|
|
797
822
|
deps: [FIREBASE_OPTIONS, i0.NgZone, [new i0.Optional(), FIREBASE_APP_NAME]],
|
|
798
823
|
};
|
|
799
824
|
|
|
800
|
-
var FirebaseFirestoreFactory = function () { return firebase__default$1["default"].firestore(); };
|
|
801
|
-
|
|
802
|
-
var ConnectAngularFirebaseFirestore = /** @class */ (function () {
|
|
803
|
-
function ConnectAngularFirebaseFirestore() {
|
|
804
|
-
}
|
|
805
|
-
return ConnectAngularFirebaseFirestore;
|
|
806
|
-
}());
|
|
807
|
-
var FirebaseFirestoreProvider = {
|
|
808
|
-
provide: ConnectAngularFirebaseFirestore,
|
|
809
|
-
useFactory: FirebaseFirestoreFactory,
|
|
810
|
-
};
|
|
811
|
-
|
|
812
825
|
var AngularFirebaseAuthModule = /** @class */ (function () {
|
|
813
826
|
function AngularFirebaseAuthModule() {
|
|
814
827
|
}
|
|
@@ -827,6 +840,7 @@
|
|
|
827
840
|
AngularFirebaseAuthModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule });
|
|
828
841
|
AngularFirebaseAuthModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, providers: [
|
|
829
842
|
FirebaseAppProvider,
|
|
843
|
+
FirebaseAuthProvider,
|
|
830
844
|
{
|
|
831
845
|
provide: 'Authentication',
|
|
832
846
|
useFactory: function (authenticationService, userRepository) {
|
|
@@ -868,6 +882,7 @@
|
|
|
868
882
|
args: [{
|
|
869
883
|
providers: [
|
|
870
884
|
FirebaseAppProvider,
|
|
885
|
+
FirebaseAuthProvider,
|
|
871
886
|
{
|
|
872
887
|
provide: 'Authentication',
|
|
873
888
|
useFactory: function (authenticationService, userRepository) {
|
|
@@ -925,6 +940,7 @@
|
|
|
925
940
|
AngularFirestoreModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule });
|
|
926
941
|
AngularFirestoreModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, providers: [
|
|
927
942
|
FirebaseAppProvider,
|
|
943
|
+
FirebaseFirestoreProvider,
|
|
928
944
|
{
|
|
929
945
|
provide: 'BeautyProfileRepository',
|
|
930
946
|
useFactory: function (app, userRepository) {
|
|
@@ -1085,6 +1101,7 @@
|
|
|
1085
1101
|
args: [{
|
|
1086
1102
|
providers: [
|
|
1087
1103
|
FirebaseAppProvider,
|
|
1104
|
+
FirebaseFirestoreProvider,
|
|
1088
1105
|
{
|
|
1089
1106
|
provide: 'BeautyProfileRepository',
|
|
1090
1107
|
useFactory: function (app, userRepository) {
|
|
@@ -1255,7 +1272,7 @@
|
|
|
1255
1272
|
return AngularConnectModule;
|
|
1256
1273
|
}());
|
|
1257
1274
|
AngularConnectModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1258
|
-
AngularConnectModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, imports: [AngularFirestoreModule] });
|
|
1275
|
+
AngularConnectModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, imports: [AngularFirebaseAuthModule, AngularFirestoreModule] });
|
|
1259
1276
|
AngularConnectModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, providers: [
|
|
1260
1277
|
AuthService,
|
|
1261
1278
|
CartService,
|
|
@@ -1264,11 +1281,11 @@
|
|
|
1264
1281
|
CouponService,
|
|
1265
1282
|
OrderService,
|
|
1266
1283
|
FirebaseAppProvider,
|
|
1267
|
-
], imports: [[AngularFirestoreModule]] });
|
|
1284
|
+
], imports: [[AngularFirebaseAuthModule, AngularFirestoreModule]] });
|
|
1268
1285
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, decorators: [{
|
|
1269
1286
|
type: i0.NgModule,
|
|
1270
1287
|
args: [{
|
|
1271
|
-
imports: [AngularFirestoreModule],
|
|
1288
|
+
imports: [AngularFirebaseAuthModule, AngularFirestoreModule],
|
|
1272
1289
|
providers: [
|
|
1273
1290
|
AuthService,
|
|
1274
1291
|
CartService,
|