@infrab4a/connect-angular 0.5.0-beta.4 → 0.5.0-beta.6
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 +79 -69
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/lib/angular-connect.module.js +7 -4
- package/esm2015/lib/consts/default-shop.const.js +2 -0
- package/esm2015/lib/consts/index.js +2 -0
- package/esm2015/lib/services/cart.service.js +13 -7
- package/esm2015/lib/services/checkout.service.js +11 -5
- package/esm2015/lib/services/types/required-checkout-data.type.js +1 -1
- package/fesm2015/infrab4a-connect-angular.js +22 -10
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/lib/angular-connect.module.d.ts +2 -1
- package/lib/consts/default-shop.const.d.ts +1 -0
- package/lib/consts/index.d.ts +1 -0
- package/lib/services/cart.service.d.ts +2 -1
- package/lib/services/checkout.service.d.ts +3 -2
- package/lib/services/types/required-checkout-data.type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/fire/auth'), require('@infrab4a/connect'), require('js-cookie'), require('@angular/fire'), require('@angular/fire/firestore')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/fire/auth', '@infrab4a/connect', 'js-cookie', '@angular/fire', '@angular/fire/firestore'], factory) :
|
|
4
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.ng.fire.auth, global["@infrab4a/connect"], global["js-cookie"], global.ng.fire, global.ng.fire.firestore));
|
|
5
|
-
})(this, (function (exports, i0, rxjs, operators, i1,
|
|
5
|
+
})(this, (function (exports, i0, rxjs, operators, i1, i1$1, cookie, fire, firestore) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
28
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
29
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
29
30
|
var cookie__default = /*#__PURE__*/_interopDefaultLegacy(cookie);
|
|
30
31
|
|
|
31
32
|
var AuthService = /** @class */ (function () {
|
|
@@ -53,6 +54,8 @@
|
|
|
53
54
|
}] }];
|
|
54
55
|
} });
|
|
55
56
|
|
|
57
|
+
var DEFAULT_SHOP = 'DEFAULT_SHOP';
|
|
58
|
+
|
|
56
59
|
/*! *****************************************************************************
|
|
57
60
|
Copyright (c) Microsoft Corporation.
|
|
58
61
|
|
|
@@ -372,29 +375,30 @@
|
|
|
372
375
|
}
|
|
373
376
|
|
|
374
377
|
var CheckoutService = /** @class */ (function () {
|
|
375
|
-
function CheckoutService(checkoutRepository, userRepository) {
|
|
378
|
+
function CheckoutService(checkoutRepository, userRepository, defaultShop) {
|
|
376
379
|
this.checkoutRepository = checkoutRepository;
|
|
377
380
|
this.userRepository = userRepository;
|
|
381
|
+
this.defaultShop = defaultShop;
|
|
378
382
|
}
|
|
379
383
|
CheckoutService.prototype.getCheckout = function (checkoutData) {
|
|
380
384
|
var checkoutId = cookie__default["default"].get('checkoutId');
|
|
381
|
-
if (!
|
|
385
|
+
if (!i1$1.isNil(checkoutId))
|
|
382
386
|
return rxjs.from(this.checkoutRepository.get({ id: checkoutId }));
|
|
383
387
|
return rxjs.from(this.createCheckout(checkoutData));
|
|
384
388
|
};
|
|
385
389
|
CheckoutService.prototype.getUserByCheckout = function (checkoutId) {
|
|
386
390
|
var _this = this;
|
|
387
|
-
return rxjs.from(this.checkoutRepository.get({ id: checkoutId })).pipe(operators.mergeMap(function (checkout) { var _a; return ((_a = checkout === null || checkout === void 0 ? void 0 : checkout.user) === null || _a === void 0 ? void 0 : _a.id) ? rxjs.of(checkout.user) : rxjs.from(_this.userRepository.get({ id: checkout.user.id })); }), operators.mergeMap(function (user) { return rxjs.of(user) || rxjs.throwError(function () { return new
|
|
391
|
+
return rxjs.from(this.checkoutRepository.get({ id: checkoutId })).pipe(operators.mergeMap(function (checkout) { var _a; return ((_a = checkout === null || checkout === void 0 ? void 0 : checkout.user) === null || _a === void 0 ? void 0 : _a.id) ? rxjs.of(checkout.user) : rxjs.from(_this.userRepository.get({ id: checkout.user.id })); }), operators.mergeMap(function (user) { return rxjs.of(user) || rxjs.throwError(function () { return new i1$1.NotFoundError('User is not found'); }); }));
|
|
388
392
|
};
|
|
389
393
|
CheckoutService.prototype.updateCheckoutLineItems = function (checkout) {
|
|
390
|
-
return rxjs.from(this.checkoutRepository.update(
|
|
394
|
+
return rxjs.from(this.checkoutRepository.update(i1$1.Checkout.toInstance({ id: checkout.id, lineItems: checkout.lineItems })));
|
|
391
395
|
};
|
|
392
396
|
CheckoutService.prototype.createCheckout = function (checkoutData) {
|
|
393
397
|
return __awaiter(this, void 0, void 0, function () {
|
|
394
398
|
var checkout;
|
|
395
399
|
return __generator(this, function (_b) {
|
|
396
400
|
switch (_b.label) {
|
|
397
|
-
case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign({ createdAt: new Date() },
|
|
401
|
+
case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() }, i1$1.Checkout.toInstance(checkoutData).toPlain()), { shop: checkoutData.shop || this.defaultShop }))];
|
|
398
402
|
case 1:
|
|
399
403
|
checkout = _b.sent();
|
|
400
404
|
cookie__default["default"].set('checkoutId', checkout.id);
|
|
@@ -405,7 +409,7 @@
|
|
|
405
409
|
};
|
|
406
410
|
return CheckoutService;
|
|
407
411
|
}());
|
|
408
|
-
CheckoutService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CheckoutService, deps: [{ token: 'CheckoutRepository' }, { token: 'UserRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
412
|
+
CheckoutService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CheckoutService, deps: [{ token: 'CheckoutRepository' }, { token: 'UserRepository' }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
409
413
|
CheckoutService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CheckoutService });
|
|
410
414
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CheckoutService, decorators: [{
|
|
411
415
|
type: i0.Injectable
|
|
@@ -416,14 +420,18 @@
|
|
|
416
420
|
}] }, { type: undefined, decorators: [{
|
|
417
421
|
type: i0.Inject,
|
|
418
422
|
args: ['UserRepository']
|
|
423
|
+
}] }, { type: i1__namespace$1.Shops, decorators: [{
|
|
424
|
+
type: i0.Inject,
|
|
425
|
+
args: [DEFAULT_SHOP]
|
|
419
426
|
}] }];
|
|
420
427
|
} });
|
|
421
428
|
|
|
422
429
|
var CartService = /** @class */ (function () {
|
|
423
|
-
function CartService(authService, checkoutService) {
|
|
430
|
+
function CartService(authService, checkoutService, defaultShop) {
|
|
424
431
|
var _this = this;
|
|
425
432
|
this.authService = authService;
|
|
426
433
|
this.checkoutService = checkoutService;
|
|
434
|
+
this.defaultShop = defaultShop;
|
|
427
435
|
this.updateLineItemInCart = function (lineItem, quantity) { return _this.checkoutService.getCheckout().pipe(operators.mergeMap(function (checkoutLoaded) {
|
|
428
436
|
var _a;
|
|
429
437
|
var items = [];
|
|
@@ -441,7 +449,7 @@
|
|
|
441
449
|
var cart = {};
|
|
442
450
|
items === null || items === void 0 ? void 0 : items.forEach(function (item) {
|
|
443
451
|
var _a;
|
|
444
|
-
return (cart[item.sku] =
|
|
452
|
+
return (cart[item.sku] = i1$1.LineItem.toInstance(Object.assign(Object.assign({}, (cart[item.sku] || item)), { quantity: (((_a = cart[item.sku]) === null || _a === void 0 ? void 0 : _a.quantity) || 0) + (item.quantity ? item.quantity : 1) })));
|
|
445
453
|
});
|
|
446
454
|
return cart;
|
|
447
455
|
};
|
|
@@ -451,10 +459,10 @@
|
|
|
451
459
|
if (_this.checkMaxStock(item))
|
|
452
460
|
throw new Error('Desculpe! Temos apenas ' + ((_a = item.stock) === null || _a === void 0 ? void 0 : _a.quantity) + ' em estoque.');
|
|
453
461
|
var image = item.image || ((_b = item.images) === null || _b === void 0 ? void 0 : _b.shift());
|
|
454
|
-
var pricePaid = _this.getProductPrice({ product: item, shop: checkout.shop, isSubscriber: isSubscriber });
|
|
462
|
+
var pricePaid = _this.getProductPrice({ product: item, shop: checkout.shop || _this.defaultShop, isSubscriber: isSubscriber });
|
|
455
463
|
var id = item.id, name = item.name, brand = item.brand, slug = item.slug, stock = item.stock, price = item.price, weight = item.weight, categories = item.categories, sku = item.sku;
|
|
456
464
|
var isGift = item.isGift || null;
|
|
457
|
-
return
|
|
465
|
+
return i1$1.LineItem.toInstance({
|
|
458
466
|
id: id,
|
|
459
467
|
name: name,
|
|
460
468
|
brand: brand,
|
|
@@ -485,7 +493,7 @@
|
|
|
485
493
|
CartService.prototype.addItem = function (item, quantity, checkoutData) {
|
|
486
494
|
var _this = this;
|
|
487
495
|
if (quantity === void 0) { quantity = 1; }
|
|
488
|
-
return rxjs.of(checkoutData).pipe(operators.mergeMap(function (checkout) { return (
|
|
496
|
+
return rxjs.of(checkoutData).pipe(operators.mergeMap(function (checkout) { return (i1$1.isEmpty(checkout === null || checkout === void 0 ? void 0 : checkout.id) ? _this.checkoutService.getCheckout(checkoutData) : rxjs.of(checkout)); }), operators.mergeMap(function (checkout) {
|
|
489
497
|
var _a;
|
|
490
498
|
quantity = quantity || 1;
|
|
491
499
|
return rxjs.of((_a = checkout.user) === null || _a === void 0 ? void 0 : _a.isSubscriber).pipe(operators.mergeMap(function (isSubscriber) { return isSubscriber
|
|
@@ -500,7 +508,7 @@
|
|
|
500
508
|
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
501
509
|
var _a;
|
|
502
510
|
var checkoutItem = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.sku === item.sku; });
|
|
503
|
-
if (!
|
|
511
|
+
if (!i1$1.isNil(checkoutItem))
|
|
504
512
|
checkoutItem.quantity -= checkoutItem.quantity > 1 ? 1 : 0;
|
|
505
513
|
return checkout;
|
|
506
514
|
}), operators.mergeMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(checkout); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }));
|
|
@@ -511,13 +519,13 @@
|
|
|
511
519
|
};
|
|
512
520
|
CartService.prototype.getDiscount = function (coupon) {
|
|
513
521
|
switch (coupon.type) {
|
|
514
|
-
case
|
|
522
|
+
case i1$1.CouponTypes.FINANCIAL:
|
|
515
523
|
return this.getFinancialDiscount(coupon);
|
|
516
|
-
case
|
|
524
|
+
case i1$1.CouponTypes.PRODUCT:
|
|
517
525
|
return function (subTotalPrice) { return subTotalPrice; };
|
|
518
|
-
case
|
|
526
|
+
case i1$1.CouponTypes.GIFTCARD:
|
|
519
527
|
return this.getFinancialDiscount(coupon);
|
|
520
|
-
case
|
|
528
|
+
case i1$1.CouponTypes.VOUCHER:
|
|
521
529
|
return function (subTotalPrice) { return subTotalPrice; };
|
|
522
530
|
}
|
|
523
531
|
};
|
|
@@ -533,22 +541,27 @@
|
|
|
533
541
|
};
|
|
534
542
|
CartService.prototype.getFinancialDiscount = function (coupon) {
|
|
535
543
|
return function (subTotalPrice) {
|
|
536
|
-
if (
|
|
544
|
+
if (i1$1.FinancialCoupon.isFinancialCoupon(coupon))
|
|
537
545
|
switch (coupon.subtype) {
|
|
538
|
-
case
|
|
546
|
+
case i1$1.CouponSubtypes.ABSOLUTE:
|
|
539
547
|
return subTotalPrice - coupon.discount * 100;
|
|
540
|
-
case
|
|
548
|
+
case i1$1.CouponSubtypes.PERCENTAGE:
|
|
541
549
|
return subTotalPrice * (1 - coupon.discount / 100);
|
|
542
550
|
}
|
|
543
551
|
};
|
|
544
552
|
};
|
|
545
553
|
return CartService;
|
|
546
554
|
}());
|
|
547
|
-
CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
555
|
+
CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
548
556
|
CartService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CartService });
|
|
549
557
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CartService, decorators: [{
|
|
550
558
|
type: i0.Injectable
|
|
551
|
-
}], ctorParameters: function () {
|
|
559
|
+
}], ctorParameters: function () {
|
|
560
|
+
return [{ type: AuthService }, { type: CheckoutService }, { type: i1__namespace$1.Shops, decorators: [{
|
|
561
|
+
type: i0.Inject,
|
|
562
|
+
args: [DEFAULT_SHOP]
|
|
563
|
+
}] }];
|
|
564
|
+
} });
|
|
552
565
|
|
|
553
566
|
var AngularFirebaseAuthModule = /** @class */ (function () {
|
|
554
567
|
function AngularFirebaseAuthModule() {
|
|
@@ -570,21 +583,21 @@
|
|
|
570
583
|
{
|
|
571
584
|
provide: 'Authentication',
|
|
572
585
|
useFactory: function (authenticationService, userRepository) {
|
|
573
|
-
return new
|
|
586
|
+
return new i1$1.Authentication(authenticationService, userRepository);
|
|
574
587
|
},
|
|
575
588
|
deps: ['AuthenticationService', 'UserRepository'],
|
|
576
589
|
},
|
|
577
590
|
{
|
|
578
591
|
provide: 'AuthenticationService',
|
|
579
592
|
useFactory: function (angularFireAuth) {
|
|
580
|
-
return new
|
|
593
|
+
return new i1$1.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
581
594
|
},
|
|
582
595
|
deps: [i1.AngularFireAuth],
|
|
583
596
|
},
|
|
584
597
|
{
|
|
585
598
|
provide: 'SignOut',
|
|
586
599
|
useFactory: function (authenticationService) {
|
|
587
|
-
return new
|
|
600
|
+
return new i1$1.SignOut(authenticationService);
|
|
588
601
|
},
|
|
589
602
|
deps: ['AuthenticationService'],
|
|
590
603
|
},
|
|
@@ -597,21 +610,21 @@
|
|
|
597
610
|
{
|
|
598
611
|
provide: 'Authentication',
|
|
599
612
|
useFactory: function (authenticationService, userRepository) {
|
|
600
|
-
return new
|
|
613
|
+
return new i1$1.Authentication(authenticationService, userRepository);
|
|
601
614
|
},
|
|
602
615
|
deps: ['AuthenticationService', 'UserRepository'],
|
|
603
616
|
},
|
|
604
617
|
{
|
|
605
618
|
provide: 'AuthenticationService',
|
|
606
619
|
useFactory: function (angularFireAuth) {
|
|
607
|
-
return new
|
|
620
|
+
return new i1$1.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
608
621
|
},
|
|
609
622
|
deps: [i1.AngularFireAuth],
|
|
610
623
|
},
|
|
611
624
|
{
|
|
612
625
|
provide: 'SignOut',
|
|
613
626
|
useFactory: function (authenticationService) {
|
|
614
|
-
return new
|
|
627
|
+
return new i1$1.SignOut(authenticationService);
|
|
615
628
|
},
|
|
616
629
|
deps: ['AuthenticationService'],
|
|
617
630
|
},
|
|
@@ -639,126 +652,126 @@
|
|
|
639
652
|
{
|
|
640
653
|
provide: 'BeautyProfileRepository',
|
|
641
654
|
useFactory: function (firestore, userRepository) {
|
|
642
|
-
return new
|
|
655
|
+
return new i1$1.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
643
656
|
},
|
|
644
657
|
deps: [firestore.AngularFirestore, 'UserRepository'],
|
|
645
658
|
},
|
|
646
659
|
{
|
|
647
660
|
provide: 'Buy2WinRepository',
|
|
648
661
|
useFactory: function (firestore) {
|
|
649
|
-
return new
|
|
662
|
+
return new i1$1.Buy2WinFirestoreRepository(firestore.firestore);
|
|
650
663
|
},
|
|
651
664
|
deps: [firestore.AngularFirestore],
|
|
652
665
|
},
|
|
653
666
|
{
|
|
654
667
|
provide: 'CategoryRepository',
|
|
655
668
|
useFactory: function (firestore) {
|
|
656
|
-
return new
|
|
669
|
+
return new i1$1.CategoryFirestoreRepository(firestore.firestore);
|
|
657
670
|
},
|
|
658
671
|
deps: [firestore.AngularFirestore],
|
|
659
672
|
},
|
|
660
673
|
{
|
|
661
674
|
provide: 'CheckoutRepository',
|
|
662
675
|
useFactory: function (firestore) {
|
|
663
|
-
return new
|
|
676
|
+
return new i1$1.CheckoutFirestoreRepository(firestore.firestore);
|
|
664
677
|
},
|
|
665
678
|
deps: [firestore.AngularFirestore],
|
|
666
679
|
},
|
|
667
680
|
{
|
|
668
681
|
provide: 'CheckoutSubscriptionRepository',
|
|
669
682
|
useFactory: function (firestore) {
|
|
670
|
-
return new
|
|
683
|
+
return new i1$1.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
671
684
|
},
|
|
672
685
|
deps: [firestore.AngularFirestore],
|
|
673
686
|
},
|
|
674
687
|
{
|
|
675
688
|
provide: 'CouponRepository',
|
|
676
689
|
useFactory: function (firestore) {
|
|
677
|
-
return new
|
|
690
|
+
return new i1$1.CouponFirestoreRepository(firestore.firestore);
|
|
678
691
|
},
|
|
679
692
|
deps: [firestore.AngularFirestore],
|
|
680
693
|
},
|
|
681
694
|
{
|
|
682
695
|
provide: 'EditionRepository',
|
|
683
696
|
useFactory: function (firestore, subscriptionRepository) {
|
|
684
|
-
return new
|
|
697
|
+
return new i1$1.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
685
698
|
},
|
|
686
699
|
deps: [firestore.AngularFirestore, 'SubscriptionRepository'],
|
|
687
700
|
},
|
|
688
701
|
{
|
|
689
702
|
provide: 'HomeRepository',
|
|
690
703
|
useFactory: function (firestore) {
|
|
691
|
-
return new
|
|
704
|
+
return new i1$1.HomeFirestoreRepository(firestore.firestore);
|
|
692
705
|
},
|
|
693
706
|
deps: [firestore.AngularFirestore],
|
|
694
707
|
},
|
|
695
708
|
{
|
|
696
709
|
provide: 'ShopMenuRepository',
|
|
697
710
|
useFactory: function (firestore) {
|
|
698
|
-
return new
|
|
711
|
+
return new i1$1.ShopMenuFirestoreRepository(firestore.firestore);
|
|
699
712
|
},
|
|
700
713
|
deps: [firestore.AngularFirestore],
|
|
701
714
|
},
|
|
702
715
|
{
|
|
703
716
|
provide: 'OrderRepository',
|
|
704
717
|
useFactory: function (firestore) {
|
|
705
|
-
return new
|
|
718
|
+
return new i1$1.OrderFirestoreRepository(firestore.firestore);
|
|
706
719
|
},
|
|
707
720
|
deps: [firestore.AngularFirestore],
|
|
708
721
|
},
|
|
709
722
|
{
|
|
710
723
|
provide: 'PaymentRepository',
|
|
711
724
|
useFactory: function (firestore) {
|
|
712
|
-
return new
|
|
725
|
+
return new i1$1.PaymentFirestoreRepository(firestore.firestore);
|
|
713
726
|
},
|
|
714
727
|
deps: [firestore.AngularFirestore],
|
|
715
728
|
},
|
|
716
729
|
{
|
|
717
730
|
provide: 'ProductRepository',
|
|
718
731
|
useFactory: function (firestore) {
|
|
719
|
-
return new
|
|
732
|
+
return new i1$1.ProductFirestoreRepository(firestore.firestore);
|
|
720
733
|
},
|
|
721
734
|
deps: [firestore.AngularFirestore],
|
|
722
735
|
},
|
|
723
736
|
{
|
|
724
737
|
provide: 'SubscriptionPaymentRepository',
|
|
725
738
|
useFactory: function (firestore, subscriptionRepository) {
|
|
726
|
-
return new
|
|
739
|
+
return new i1$1.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
727
740
|
},
|
|
728
741
|
deps: [firestore.AngularFirestore, 'SubscriptionRepository'],
|
|
729
742
|
},
|
|
730
743
|
{
|
|
731
744
|
provide: 'SubscriptionPlanRepository',
|
|
732
745
|
useFactory: function (firestore) {
|
|
733
|
-
return new
|
|
746
|
+
return new i1$1.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
734
747
|
},
|
|
735
748
|
deps: [firestore.AngularFirestore],
|
|
736
749
|
},
|
|
737
750
|
{
|
|
738
751
|
provide: 'SubscriptionRepository',
|
|
739
752
|
useFactory: function (firestore) {
|
|
740
|
-
return new
|
|
753
|
+
return new i1$1.SubscriptionFirestoreRepository(firestore.firestore);
|
|
741
754
|
},
|
|
742
755
|
deps: [firestore.AngularFirestore],
|
|
743
756
|
},
|
|
744
757
|
{
|
|
745
758
|
provide: 'UserRepository',
|
|
746
759
|
useFactory: function (firestore) {
|
|
747
|
-
return new
|
|
760
|
+
return new i1$1.UserFirestoreRepository(firestore.firestore);
|
|
748
761
|
},
|
|
749
762
|
deps: [firestore.AngularFirestore],
|
|
750
763
|
},
|
|
751
764
|
{
|
|
752
765
|
provide: 'UserAddressRepository',
|
|
753
766
|
useFactory: function (firestore, userRepository) {
|
|
754
|
-
return new
|
|
767
|
+
return new i1$1.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
755
768
|
},
|
|
756
769
|
deps: [firestore.AngularFirestore, 'UserRepository'],
|
|
757
770
|
},
|
|
758
771
|
{
|
|
759
772
|
provide: 'VariantRepository',
|
|
760
773
|
useFactory: function (firestore, productRepository) {
|
|
761
|
-
return new
|
|
774
|
+
return new i1$1.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
762
775
|
},
|
|
763
776
|
deps: [firestore.AngularFirestore, 'ProductRepository'],
|
|
764
777
|
},
|
|
@@ -771,126 +784,126 @@
|
|
|
771
784
|
{
|
|
772
785
|
provide: 'BeautyProfileRepository',
|
|
773
786
|
useFactory: function (firestore, userRepository) {
|
|
774
|
-
return new
|
|
787
|
+
return new i1$1.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
775
788
|
},
|
|
776
789
|
deps: [firestore.AngularFirestore, 'UserRepository'],
|
|
777
790
|
},
|
|
778
791
|
{
|
|
779
792
|
provide: 'Buy2WinRepository',
|
|
780
793
|
useFactory: function (firestore) {
|
|
781
|
-
return new
|
|
794
|
+
return new i1$1.Buy2WinFirestoreRepository(firestore.firestore);
|
|
782
795
|
},
|
|
783
796
|
deps: [firestore.AngularFirestore],
|
|
784
797
|
},
|
|
785
798
|
{
|
|
786
799
|
provide: 'CategoryRepository',
|
|
787
800
|
useFactory: function (firestore) {
|
|
788
|
-
return new
|
|
801
|
+
return new i1$1.CategoryFirestoreRepository(firestore.firestore);
|
|
789
802
|
},
|
|
790
803
|
deps: [firestore.AngularFirestore],
|
|
791
804
|
},
|
|
792
805
|
{
|
|
793
806
|
provide: 'CheckoutRepository',
|
|
794
807
|
useFactory: function (firestore) {
|
|
795
|
-
return new
|
|
808
|
+
return new i1$1.CheckoutFirestoreRepository(firestore.firestore);
|
|
796
809
|
},
|
|
797
810
|
deps: [firestore.AngularFirestore],
|
|
798
811
|
},
|
|
799
812
|
{
|
|
800
813
|
provide: 'CheckoutSubscriptionRepository',
|
|
801
814
|
useFactory: function (firestore) {
|
|
802
|
-
return new
|
|
815
|
+
return new i1$1.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
803
816
|
},
|
|
804
817
|
deps: [firestore.AngularFirestore],
|
|
805
818
|
},
|
|
806
819
|
{
|
|
807
820
|
provide: 'CouponRepository',
|
|
808
821
|
useFactory: function (firestore) {
|
|
809
|
-
return new
|
|
822
|
+
return new i1$1.CouponFirestoreRepository(firestore.firestore);
|
|
810
823
|
},
|
|
811
824
|
deps: [firestore.AngularFirestore],
|
|
812
825
|
},
|
|
813
826
|
{
|
|
814
827
|
provide: 'EditionRepository',
|
|
815
828
|
useFactory: function (firestore, subscriptionRepository) {
|
|
816
|
-
return new
|
|
829
|
+
return new i1$1.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
817
830
|
},
|
|
818
831
|
deps: [firestore.AngularFirestore, 'SubscriptionRepository'],
|
|
819
832
|
},
|
|
820
833
|
{
|
|
821
834
|
provide: 'HomeRepository',
|
|
822
835
|
useFactory: function (firestore) {
|
|
823
|
-
return new
|
|
836
|
+
return new i1$1.HomeFirestoreRepository(firestore.firestore);
|
|
824
837
|
},
|
|
825
838
|
deps: [firestore.AngularFirestore],
|
|
826
839
|
},
|
|
827
840
|
{
|
|
828
841
|
provide: 'ShopMenuRepository',
|
|
829
842
|
useFactory: function (firestore) {
|
|
830
|
-
return new
|
|
843
|
+
return new i1$1.ShopMenuFirestoreRepository(firestore.firestore);
|
|
831
844
|
},
|
|
832
845
|
deps: [firestore.AngularFirestore],
|
|
833
846
|
},
|
|
834
847
|
{
|
|
835
848
|
provide: 'OrderRepository',
|
|
836
849
|
useFactory: function (firestore) {
|
|
837
|
-
return new
|
|
850
|
+
return new i1$1.OrderFirestoreRepository(firestore.firestore);
|
|
838
851
|
},
|
|
839
852
|
deps: [firestore.AngularFirestore],
|
|
840
853
|
},
|
|
841
854
|
{
|
|
842
855
|
provide: 'PaymentRepository',
|
|
843
856
|
useFactory: function (firestore) {
|
|
844
|
-
return new
|
|
857
|
+
return new i1$1.PaymentFirestoreRepository(firestore.firestore);
|
|
845
858
|
},
|
|
846
859
|
deps: [firestore.AngularFirestore],
|
|
847
860
|
},
|
|
848
861
|
{
|
|
849
862
|
provide: 'ProductRepository',
|
|
850
863
|
useFactory: function (firestore) {
|
|
851
|
-
return new
|
|
864
|
+
return new i1$1.ProductFirestoreRepository(firestore.firestore);
|
|
852
865
|
},
|
|
853
866
|
deps: [firestore.AngularFirestore],
|
|
854
867
|
},
|
|
855
868
|
{
|
|
856
869
|
provide: 'SubscriptionPaymentRepository',
|
|
857
870
|
useFactory: function (firestore, subscriptionRepository) {
|
|
858
|
-
return new
|
|
871
|
+
return new i1$1.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
859
872
|
},
|
|
860
873
|
deps: [firestore.AngularFirestore, 'SubscriptionRepository'],
|
|
861
874
|
},
|
|
862
875
|
{
|
|
863
876
|
provide: 'SubscriptionPlanRepository',
|
|
864
877
|
useFactory: function (firestore) {
|
|
865
|
-
return new
|
|
878
|
+
return new i1$1.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
866
879
|
},
|
|
867
880
|
deps: [firestore.AngularFirestore],
|
|
868
881
|
},
|
|
869
882
|
{
|
|
870
883
|
provide: 'SubscriptionRepository',
|
|
871
884
|
useFactory: function (firestore) {
|
|
872
|
-
return new
|
|
885
|
+
return new i1$1.SubscriptionFirestoreRepository(firestore.firestore);
|
|
873
886
|
},
|
|
874
887
|
deps: [firestore.AngularFirestore],
|
|
875
888
|
},
|
|
876
889
|
{
|
|
877
890
|
provide: 'UserRepository',
|
|
878
891
|
useFactory: function (firestore) {
|
|
879
|
-
return new
|
|
892
|
+
return new i1$1.UserFirestoreRepository(firestore.firestore);
|
|
880
893
|
},
|
|
881
894
|
deps: [firestore.AngularFirestore],
|
|
882
895
|
},
|
|
883
896
|
{
|
|
884
897
|
provide: 'UserAddressRepository',
|
|
885
898
|
useFactory: function (firestore, userRepository) {
|
|
886
|
-
return new
|
|
899
|
+
return new i1$1.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
887
900
|
},
|
|
888
901
|
deps: [firestore.AngularFirestore, 'UserRepository'],
|
|
889
902
|
},
|
|
890
903
|
{
|
|
891
904
|
provide: 'VariantRepository',
|
|
892
905
|
useFactory: function (firestore, productRepository) {
|
|
893
|
-
return new
|
|
906
|
+
return new i1$1.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
894
907
|
},
|
|
895
908
|
deps: [firestore.AngularFirestore, 'ProductRepository'],
|
|
896
909
|
},
|
|
@@ -901,13 +914,10 @@
|
|
|
901
914
|
var AngularConnectModule = /** @class */ (function () {
|
|
902
915
|
function AngularConnectModule() {
|
|
903
916
|
}
|
|
904
|
-
AngularConnectModule.initializeApp = function (options, nameOrConfig) {
|
|
917
|
+
AngularConnectModule.initializeApp = function (defaultShop, options, nameOrConfig) {
|
|
905
918
|
return {
|
|
906
919
|
ngModule: AngularConnectModule,
|
|
907
|
-
providers: [
|
|
908
|
-
{ provide: fire.FIREBASE_OPTIONS, useValue: options },
|
|
909
|
-
{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
910
|
-
],
|
|
920
|
+
providers: __spreadArray(__spreadArray(__spreadArray([], __read((i1$1.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i1$1.isNil(options) ? [] : [{ provide: fire.FIREBASE_OPTIONS, useValue: options }]))), __read((i1$1.isNil(options) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))),
|
|
911
921
|
};
|
|
912
922
|
};
|
|
913
923
|
return AngularConnectModule;
|