@infrab4a/connect-angular 3.5.3 → 3.6.0-beta.10
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 +385 -216
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/services/cart.service.js +114 -11
- package/fesm2015/infrab4a-connect-angular.js +123 -20
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/package.json +1 -1
- package/services/cart.service.d.ts +5 -2
|
@@ -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('ts-custom-error'), require('@angular/fire/firestore'), require('@angular/common/http'), require('@angular/fire')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/fire/auth', '@infrab4a/connect', 'js-cookie', 'ts-custom-error', '@angular/fire/firestore', '@angular/common/http', '@angular/fire'], 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["ts-custom-error"], global.ng.fire.firestore, global.ng.common.http, global.ng.fire));
|
|
5
|
-
})(this, (function (exports, i0, rxjs, operators, i1,
|
|
5
|
+
})(this, (function (exports, i0, rxjs, operators, i1, i3, cookie, tsCustomError, i1$1, i1$2, fire) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
|
|
27
27
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
28
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
29
|
-
var
|
|
29
|
+
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
30
30
|
var cookie__default = /*#__PURE__*/_interopDefaultLegacy(cookie);
|
|
31
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
31
32
|
var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
|
|
32
|
-
var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1$3);
|
|
33
33
|
|
|
34
34
|
/*! *****************************************************************************
|
|
35
35
|
Copyright (c) Microsoft Corporation.
|
|
@@ -430,7 +430,7 @@
|
|
|
430
430
|
this.separateValidCoupons = function (coupons, userEmail) { return coupons
|
|
431
431
|
.map(function (coupon) {
|
|
432
432
|
try {
|
|
433
|
-
if (!(coupon instanceof
|
|
433
|
+
if (!(coupon instanceof i3.Coupon))
|
|
434
434
|
throw new InvalidCouponError('Cupom inválido.');
|
|
435
435
|
if (_this.isValidCoupon(coupon, userEmail))
|
|
436
436
|
return coupon;
|
|
@@ -439,7 +439,7 @@
|
|
|
439
439
|
return error;
|
|
440
440
|
}
|
|
441
441
|
})
|
|
442
|
-
.reduce(function (current, coupon) { return (Object.assign(Object.assign({}, current), (coupon instanceof
|
|
442
|
+
.reduce(function (current, coupon) { return (Object.assign(Object.assign({}, current), (coupon instanceof i3.Coupon
|
|
443
443
|
? { valids: __spreadArray(__spreadArray([], __read(current.valids)), [coupon]) }
|
|
444
444
|
: { invalids: __spreadArray(__spreadArray([], __read(current.invalids)), [coupon]) }))); }, {
|
|
445
445
|
valids: [],
|
|
@@ -450,8 +450,8 @@
|
|
|
450
450
|
var _this = this;
|
|
451
451
|
return rxjs.from(this.couponRepository.find({
|
|
452
452
|
filters: {
|
|
453
|
-
nickname: { operator:
|
|
454
|
-
active: { operator:
|
|
453
|
+
nickname: { operator: i3.Where.EQUALS, value: nickname },
|
|
454
|
+
active: { operator: i3.Where.EQUALS, value: true },
|
|
455
455
|
},
|
|
456
456
|
})).pipe(operators.concatMap(function (coupons) { return _this.checkCouponRules(coupons, checkoutType, plan, checkout, isSubscription); }), operators.concatMap(function (coupon) { return _this.checkCouponUseAndLimit(coupon, userEmail, checkout); }), operators.map(function (coupon) { return _this.isValidCoupon(coupon, userEmail); }), operators.map(function (coupon) { return coupon; }));
|
|
457
457
|
};
|
|
@@ -463,17 +463,17 @@
|
|
|
463
463
|
// Get Primeiro Cupom (o find do repository retorna um array)
|
|
464
464
|
var coupon = coupons.data.shift();
|
|
465
465
|
// Verifica se o cupom é aplicavel na loja
|
|
466
|
-
var isInShop = coupon.shopAvailability ===
|
|
466
|
+
var isInShop = coupon.shopAvailability === i3.Shops.ALL || coupon.shopAvailability === this.defaultShop;
|
|
467
467
|
// Cupon não aplicavel a loja retorna erro
|
|
468
468
|
if (!isInShop)
|
|
469
469
|
return rxjs.throwError('Cupom inválido para loja.');
|
|
470
470
|
// Verifica se o coupon é aplicado no checkout que está sendo realizado
|
|
471
|
-
var isCheckoutType = coupon.checkoutType ===
|
|
471
|
+
var isCheckoutType = coupon.checkoutType === i3.CheckoutTypes.ALL || coupon.checkoutType === checkoutType;
|
|
472
472
|
// Cupon não aplicavel ao checkout retorna erro
|
|
473
473
|
if (!isCheckoutType)
|
|
474
474
|
return rxjs.throwError('Cupom inválido. Erro de checkout.');
|
|
475
475
|
// Verifica se o cupom é ou pode ser aplicado para subscription
|
|
476
|
-
if (checkoutType ===
|
|
476
|
+
if (checkoutType === i3.CheckoutTypes.ALL || checkoutType === i3.CheckoutTypes.SUBSCRIPTION) {
|
|
477
477
|
// Se o cupom tiver um plano associado, verifica se é o mesmo plano do checkout da assinatura
|
|
478
478
|
if (coupon.plan && coupon.plan.toUpperCase() !== plan.toUpperCase())
|
|
479
479
|
return rxjs.throwError('Cupom inválido para sua assinatura.');
|
|
@@ -532,9 +532,9 @@
|
|
|
532
532
|
CouponService.prototype.calcDiscountSubscription = function (coupon, checkout) {
|
|
533
533
|
//
|
|
534
534
|
var discount = 0;
|
|
535
|
-
if (coupon.type ===
|
|
535
|
+
if (coupon.type === i3.CouponTypes.ABSOLUTE)
|
|
536
536
|
discount = coupon.discount;
|
|
537
|
-
else if (coupon.type ===
|
|
537
|
+
else if (coupon.type === i3.CouponTypes.PERCENTAGE)
|
|
538
538
|
discount = checkout.subscriptionPlan.recurrencePrice * (coupon.discount / 100);
|
|
539
539
|
return rxjs.of(discount);
|
|
540
540
|
};
|
|
@@ -547,8 +547,8 @@
|
|
|
547
547
|
discount = 0;
|
|
548
548
|
_d = coupon.type;
|
|
549
549
|
switch (_d) {
|
|
550
|
-
case
|
|
551
|
-
case
|
|
550
|
+
case i3.CouponTypes.ABSOLUTE: return [3 /*break*/, 1];
|
|
551
|
+
case i3.CouponTypes.PERCENTAGE: return [3 /*break*/, 2];
|
|
552
552
|
}
|
|
553
553
|
return [3 /*break*/, 4];
|
|
554
554
|
case 1:
|
|
@@ -643,20 +643,20 @@
|
|
|
643
643
|
});
|
|
644
644
|
};
|
|
645
645
|
CouponService.prototype.userValidationAndSubscriptionStatus = function (coupon, user) {
|
|
646
|
-
if (coupon.exclusivityType ===
|
|
646
|
+
if (coupon.exclusivityType === i3.Exclusivities.ALL_USERS)
|
|
647
647
|
return true;
|
|
648
648
|
// Verifica se o email do usuário é coorporativo
|
|
649
|
-
if (!this.emailIsFromCollaborator(user.email) && coupon.exclusivityType ===
|
|
649
|
+
if (!this.emailIsFromCollaborator(user.email) && coupon.exclusivityType === i3.Exclusivities.COLLABORATORS)
|
|
650
650
|
throw new InvalidCouponError('Você não é colaborador.');
|
|
651
651
|
// Verifica se o email do usuário é associado ao cupom de uso por usuario
|
|
652
|
-
if (coupon.exclusivityType ===
|
|
652
|
+
if (coupon.exclusivityType === i3.Exclusivities.SPECIFIC_USER && coupon.userExclusiveEmail !== user.email)
|
|
653
653
|
throw new InvalidCouponError('Cupom não é válido para este usuário.');
|
|
654
654
|
switch (coupon.exclusivityType) {
|
|
655
|
-
case
|
|
655
|
+
case i3.Exclusivities.ACTIVE_SUBSCRIBER:
|
|
656
656
|
return user.isSubscriber ? true : false;
|
|
657
|
-
case
|
|
657
|
+
case i3.Exclusivities.INACTIVE_SUBSCRIBER:
|
|
658
658
|
return user.isSubscriber ? false : true;
|
|
659
|
-
case
|
|
659
|
+
case i3.Exclusivities.NON_SUBSCRIBER:
|
|
660
660
|
return user.isSubscriber ? false : true;
|
|
661
661
|
}
|
|
662
662
|
return true;
|
|
@@ -700,7 +700,7 @@
|
|
|
700
700
|
return [{ type: undefined, decorators: [{
|
|
701
701
|
type: i0.Inject,
|
|
702
702
|
args: ['CouponRepository']
|
|
703
|
-
}] }, { type:
|
|
703
|
+
}] }, { type: i3__namespace.Shops, decorators: [{
|
|
704
704
|
type: i0.Inject,
|
|
705
705
|
args: [DEFAULT_SHOP]
|
|
706
706
|
}] }, { type: undefined, decorators: [{
|
|
@@ -725,19 +725,19 @@
|
|
|
725
725
|
}
|
|
726
726
|
CheckoutService.prototype.getCheckout = function (checkoutData) {
|
|
727
727
|
var checkoutId = cookie__default["default"].get('checkoutId');
|
|
728
|
-
if (!
|
|
728
|
+
if (!i3.isNil(checkoutId))
|
|
729
729
|
return rxjs.from(this.checkoutRepository.get({ id: checkoutId }));
|
|
730
730
|
return rxjs.from(this.createCheckout(checkoutData));
|
|
731
731
|
};
|
|
732
732
|
CheckoutService.prototype.getUserByCheckout = function (checkoutId) {
|
|
733
733
|
var _this = this;
|
|
734
|
-
return rxjs.from(this.checkoutRepository.get({ id: checkoutId })).pipe(operators.concatMap(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.concatMap(function (user) { return rxjs.of(user) || rxjs.throwError(function () { return new
|
|
734
|
+
return rxjs.from(this.checkoutRepository.get({ id: checkoutId })).pipe(operators.concatMap(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.concatMap(function (user) { return rxjs.of(user) || rxjs.throwError(function () { return new i3.NotFoundError('User is not found'); }); }));
|
|
735
735
|
};
|
|
736
736
|
CheckoutService.prototype.updateCheckoutLineItems = function (checkout) {
|
|
737
|
-
return rxjs.from(this.checkoutRepository.update(
|
|
737
|
+
return rxjs.from(this.checkoutRepository.update(i3.Checkout.toInstance({ id: checkout.id, lineItems: checkout.lineItems })));
|
|
738
738
|
};
|
|
739
739
|
CheckoutService.prototype.updateCheckoutUser = function (checkout) {
|
|
740
|
-
return rxjs.from(this.checkoutRepository.update(
|
|
740
|
+
return rxjs.from(this.checkoutRepository.update(i3.Checkout.toInstance({ id: checkout.id, user: checkout.user })));
|
|
741
741
|
};
|
|
742
742
|
CheckoutService.prototype.clearCheckoutFromSession = function () {
|
|
743
743
|
cookie__default["default"].remove('checkoutId');
|
|
@@ -757,7 +757,7 @@
|
|
|
757
757
|
return this.getCheckout().pipe(operators.concatMap(function (checkout) {
|
|
758
758
|
var _a;
|
|
759
759
|
return _this.couponService
|
|
760
|
-
.checkCoupon(nickname, (_a = checkout.user) === null || _a === void 0 ? void 0 : _a.email,
|
|
760
|
+
.checkCoupon(nickname, (_a = checkout.user) === null || _a === void 0 ? void 0 : _a.email, i3.CheckoutTypes.ECOMMERCE, checkout.user.subscriptionPlan, checkout, false)
|
|
761
761
|
.pipe();
|
|
762
762
|
}));
|
|
763
763
|
};
|
|
@@ -766,7 +766,7 @@
|
|
|
766
766
|
var checkout;
|
|
767
767
|
return __generator(this, function (_b) {
|
|
768
768
|
switch (_b.label) {
|
|
769
|
-
case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() },
|
|
769
|
+
case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() }, i3.Checkout.toInstance(i3.pick(checkoutData, ['user', 'shop'])).toPlain()), { shop: (checkoutData === null || checkoutData === void 0 ? void 0 : checkoutData.shop) || this.defaultShop }))];
|
|
770
770
|
case 1:
|
|
771
771
|
checkout = _b.sent();
|
|
772
772
|
cookie__default["default"].set('checkoutId', checkout.id);
|
|
@@ -791,21 +791,22 @@
|
|
|
791
791
|
}] }, { type: undefined, decorators: [{
|
|
792
792
|
type: i0.Inject,
|
|
793
793
|
args: ['UserRepository']
|
|
794
|
-
}] }, { type:
|
|
794
|
+
}] }, { type: i3__namespace.Shops, decorators: [{
|
|
795
795
|
type: i0.Inject,
|
|
796
796
|
args: [DEFAULT_SHOP]
|
|
797
797
|
}] }];
|
|
798
798
|
} });
|
|
799
799
|
|
|
800
800
|
var CartService = /** @class */ (function () {
|
|
801
|
-
function CartService(authService, checkoutService, defaultShop, productRepository) {
|
|
801
|
+
function CartService(authService, checkoutService, defaultShop, productRepository, buy2WinRepository) {
|
|
802
802
|
var _this = this;
|
|
803
803
|
this.authService = authService;
|
|
804
804
|
this.checkoutService = checkoutService;
|
|
805
805
|
this.defaultShop = defaultShop;
|
|
806
806
|
this.productRepository = productRepository;
|
|
807
|
+
this.buy2WinRepository = buy2WinRepository;
|
|
807
808
|
this.cartSubject = new rxjs.Subject();
|
|
808
|
-
this.updateLineItemInCart = function (lineItem, quantity, checkout) { return (
|
|
809
|
+
this.updateLineItemInCart = function (lineItem, quantity, checkout) { return (i3.isNil(checkout) ? _this.checkoutService.getCheckout() : rxjs.of(checkout)).pipe(operators.concatMap(function (checkoutLoaded) {
|
|
809
810
|
var _a;
|
|
810
811
|
var items = [];
|
|
811
812
|
var index = (_a = checkoutLoaded.lineItems) === null || _a === void 0 ? void 0 : _a.map(function (checkoutItem) { return checkoutItem.sku; }).indexOf(lineItem.sku);
|
|
@@ -815,15 +816,16 @@
|
|
|
815
816
|
}
|
|
816
817
|
else
|
|
817
818
|
checkoutLoaded.lineItems = items.concat(checkoutLoaded.lineItems ? checkoutLoaded.lineItems.concat([lineItem]) : [lineItem]);
|
|
818
|
-
return
|
|
819
|
-
|
|
820
|
-
|
|
819
|
+
return rxjs.of(checkoutLoaded);
|
|
820
|
+
// return this.checkoutService
|
|
821
|
+
// .updateCheckoutLineItems(checkoutLoaded)
|
|
822
|
+
// .pipe(map((updatedCheckout) => this.generateCartObject(updatedCheckout.lineItems)))
|
|
821
823
|
})); };
|
|
822
824
|
this.generateCartObject = function (items) {
|
|
823
825
|
var cart = {};
|
|
824
826
|
items === null || items === void 0 ? void 0 : items.forEach(function (item) {
|
|
825
827
|
var _a;
|
|
826
|
-
return (cart[item.sku] =
|
|
828
|
+
return (cart[item.sku] = i3.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) })));
|
|
827
829
|
});
|
|
828
830
|
return cart;
|
|
829
831
|
};
|
|
@@ -849,7 +851,7 @@
|
|
|
849
851
|
});
|
|
850
852
|
return [2 /*return*/, {
|
|
851
853
|
checkout: checkout,
|
|
852
|
-
lineItem:
|
|
854
|
+
lineItem: i3.LineItem.toInstance({
|
|
853
855
|
id: id,
|
|
854
856
|
name: name !== null && name !== void 0 ? name : product.name,
|
|
855
857
|
EAN: EAN !== null && EAN !== void 0 ? EAN : product.EAN,
|
|
@@ -897,17 +899,27 @@
|
|
|
897
899
|
}); }); }), operators.mergeMap(function (_h) {
|
|
898
900
|
var checkout = _h.checkout, lineItem = _h.lineItem;
|
|
899
901
|
return _this.updateLineItemInCart(lineItem, quantity || 1, checkout);
|
|
900
|
-
}), operators.
|
|
902
|
+
}), operators.concatMap(function (updatedCheckout) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_h) {
|
|
903
|
+
switch (_h.label) {
|
|
904
|
+
case 0: return [4 /*yield*/, this.checkGifts(updatedCheckout)];
|
|
905
|
+
case 1: return [2 /*return*/, _h.sent()];
|
|
906
|
+
}
|
|
907
|
+
}); }); }), operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(checkout); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
901
908
|
};
|
|
902
909
|
CartService.prototype.decreaseItem = function (item) {
|
|
903
910
|
var _this = this;
|
|
904
911
|
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
905
912
|
var _a;
|
|
906
913
|
var checkoutItem = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.sku === item.sku; });
|
|
907
|
-
if (!
|
|
914
|
+
if (!i3.isNil(checkoutItem))
|
|
908
915
|
checkoutItem.quantity -= checkoutItem.quantity > 1 ? 1 : 0;
|
|
909
916
|
return checkout;
|
|
910
|
-
}), operators.concatMap(function (
|
|
917
|
+
}), operators.concatMap(function (updatedCheckout) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_h) {
|
|
918
|
+
switch (_h.label) {
|
|
919
|
+
case 0: return [4 /*yield*/, this.checkGifts(updatedCheckout)];
|
|
920
|
+
case 1: return [2 /*return*/, _h.sent()];
|
|
921
|
+
}
|
|
922
|
+
}); }); }), operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(checkout); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
911
923
|
};
|
|
912
924
|
CartService.prototype.getCart = function (checkout) {
|
|
913
925
|
var _this = this;
|
|
@@ -931,14 +943,15 @@
|
|
|
931
943
|
};
|
|
932
944
|
CartService.prototype.updateUserCart = function (user) {
|
|
933
945
|
var _this = this;
|
|
934
|
-
return this.checkoutService.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(
|
|
946
|
+
return this.checkoutService.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(i3.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { user: user }))); }), operators.concatMap(function (checkout) { return __awaiter(_this, void 0, void 0, function () {
|
|
935
947
|
var _a, _b, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
936
948
|
var _this = this;
|
|
937
949
|
return __generator(this, function (_s) {
|
|
938
950
|
switch (_s.label) {
|
|
939
951
|
case 0:
|
|
940
|
-
_j = (_h = this.checkoutService)
|
|
941
|
-
|
|
952
|
+
_j = (_h = this.checkoutService)
|
|
953
|
+
.updateCheckoutLineItems;
|
|
954
|
+
_l = (_k = i3.Checkout).toInstance;
|
|
942
955
|
_o = (_m = Object).assign;
|
|
943
956
|
_p = [Object.assign({}, checkout.toPlain())];
|
|
944
957
|
_q = {};
|
|
@@ -955,7 +968,8 @@
|
|
|
955
968
|
case 2:
|
|
956
969
|
_r = [];
|
|
957
970
|
_s.label = 3;
|
|
958
|
-
case 3: return [2 /*return*/, _j.apply(_h, [_l.apply(_k, [_o.apply(_m, _p.concat([(_q.lineItems = _r, _q)]))])])
|
|
971
|
+
case 3: return [2 /*return*/, _j.apply(_h, [_l.apply(_k, [_o.apply(_m, _p.concat([(_q.lineItems = _r, _q)]))])])
|
|
972
|
+
.toPromise()];
|
|
959
973
|
}
|
|
960
974
|
});
|
|
961
975
|
}); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
@@ -971,19 +985,174 @@
|
|
|
971
985
|
var _this = this;
|
|
972
986
|
return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
|
|
973
987
|
};
|
|
988
|
+
CartService.prototype.checkGifts = function (checkout) {
|
|
989
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
990
|
+
var campaigns, notGiftItems, cartTotal, elegibleCampaigns, _loop_1, campaigns_1, campaigns_1_1, campaign, campaingnProducts, elegibleCampaigns_1, elegibleCampaigns_1_1, campaign, elegibleProducts, _h, _j, product, productData, e_1_1, e_2_1, gifts;
|
|
991
|
+
var e_3, _k, e_2, _l, e_1, _m;
|
|
992
|
+
return __generator(this, function (_o) {
|
|
993
|
+
switch (_o.label) {
|
|
994
|
+
case 0: return [4 /*yield*/, this.buy2WinRepository
|
|
995
|
+
.find({
|
|
996
|
+
filters: {
|
|
997
|
+
active: { operator: i3.Where.EQUALS, value: true },
|
|
998
|
+
shop: { operator: i3.Where.EQUALS, value: this.defaultShop },
|
|
999
|
+
},
|
|
1000
|
+
})
|
|
1001
|
+
.then(function (data) { return data.data; })];
|
|
1002
|
+
case 1:
|
|
1003
|
+
campaigns = _o.sent();
|
|
1004
|
+
if (!campaigns.length)
|
|
1005
|
+
checkout;
|
|
1006
|
+
notGiftItems = checkout.lineItems.filter(function (item) { return !item.isGift; });
|
|
1007
|
+
cartTotal = notGiftItems.reduce(function (a, b) { return a + b.pricePaid * b.quantity; }, 0);
|
|
1008
|
+
elegibleCampaigns = [];
|
|
1009
|
+
_loop_1 = function (campaign) {
|
|
1010
|
+
// problemas: datas, valorcart e valor cartMin, filtros no código
|
|
1011
|
+
var today = new Date();
|
|
1012
|
+
if (!(campaign.startDate <= today) && !(campaign.endDate >= today))
|
|
1013
|
+
return "continue";
|
|
1014
|
+
// Passo 2: Verificar se a campanha é por categorias
|
|
1015
|
+
if (campaign.activeCategory) {
|
|
1016
|
+
var categoriesCampaing_1 = campaign.categories.map(function (c) { return c.id; });
|
|
1017
|
+
var filterProductsCategories = checkout.lineItems.filter(function (l) {
|
|
1018
|
+
var _a;
|
|
1019
|
+
if (!l.categories || !((_a = l.categories) === null || _a === void 0 ? void 0 : _a.length))
|
|
1020
|
+
return true;
|
|
1021
|
+
return l.categories.some(function (c) { return categoriesCampaing_1.some(function (cat) { return cat == c; }); });
|
|
1022
|
+
});
|
|
1023
|
+
if (filterProductsCategories.length) {
|
|
1024
|
+
var cartTotalCategories = filterProductsCategories.reduce(function (a, b) { return a + b.pricePaid * b.quantity; }, 0);
|
|
1025
|
+
if (cartTotalCategories >= campaign.cartValueMin)
|
|
1026
|
+
elegibleCampaigns.push(campaign);
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
else {
|
|
1030
|
+
if (campaign.cartValue && campaign.cartValue > 0) {
|
|
1031
|
+
if (campaign.cartValue <= cartTotal)
|
|
1032
|
+
elegibleCampaigns.push(campaign);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
};
|
|
1036
|
+
try {
|
|
1037
|
+
for (campaigns_1 = __values(campaigns), campaigns_1_1 = campaigns_1.next(); !campaigns_1_1.done; campaigns_1_1 = campaigns_1.next()) {
|
|
1038
|
+
campaign = campaigns_1_1.value;
|
|
1039
|
+
_loop_1(campaign);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1043
|
+
finally {
|
|
1044
|
+
try {
|
|
1045
|
+
if (campaigns_1_1 && !campaigns_1_1.done && (_k = campaigns_1.return)) _k.call(campaigns_1);
|
|
1046
|
+
}
|
|
1047
|
+
finally { if (e_3) throw e_3.error; }
|
|
1048
|
+
}
|
|
1049
|
+
if (!elegibleCampaigns.length)
|
|
1050
|
+
return [2 /*return*/, checkout];
|
|
1051
|
+
campaingnProducts = [];
|
|
1052
|
+
_o.label = 2;
|
|
1053
|
+
case 2:
|
|
1054
|
+
_o.trys.push([2, 14, 15, 16]);
|
|
1055
|
+
elegibleCampaigns_1 = __values(elegibleCampaigns), elegibleCampaigns_1_1 = elegibleCampaigns_1.next();
|
|
1056
|
+
_o.label = 3;
|
|
1057
|
+
case 3:
|
|
1058
|
+
if (!!elegibleCampaigns_1_1.done) return [3 /*break*/, 13];
|
|
1059
|
+
campaign = elegibleCampaigns_1_1.value;
|
|
1060
|
+
elegibleProducts = [];
|
|
1061
|
+
_o.label = 4;
|
|
1062
|
+
case 4:
|
|
1063
|
+
_o.trys.push([4, 9, 10, 11]);
|
|
1064
|
+
_h = (e_1 = void 0, __values(campaign.products)), _j = _h.next();
|
|
1065
|
+
_o.label = 5;
|
|
1066
|
+
case 5:
|
|
1067
|
+
if (!!_j.done) return [3 /*break*/, 8];
|
|
1068
|
+
product = _j.value;
|
|
1069
|
+
return [4 /*yield*/, this.productRepository.get({ sku: product })];
|
|
1070
|
+
case 6:
|
|
1071
|
+
productData = _o.sent();
|
|
1072
|
+
if (!productData)
|
|
1073
|
+
return [3 /*break*/, 7];
|
|
1074
|
+
elegibleProducts.push(productData);
|
|
1075
|
+
_o.label = 7;
|
|
1076
|
+
case 7:
|
|
1077
|
+
_j = _h.next();
|
|
1078
|
+
return [3 /*break*/, 5];
|
|
1079
|
+
case 8: return [3 /*break*/, 11];
|
|
1080
|
+
case 9:
|
|
1081
|
+
e_1_1 = _o.sent();
|
|
1082
|
+
e_1 = { error: e_1_1 };
|
|
1083
|
+
return [3 /*break*/, 11];
|
|
1084
|
+
case 10:
|
|
1085
|
+
try {
|
|
1086
|
+
if (_j && !_j.done && (_m = _h.return)) _m.call(_h);
|
|
1087
|
+
}
|
|
1088
|
+
finally { if (e_1) throw e_1.error; }
|
|
1089
|
+
return [7 /*endfinally*/];
|
|
1090
|
+
case 11:
|
|
1091
|
+
campaingnProducts.push(elegibleProducts);
|
|
1092
|
+
_o.label = 12;
|
|
1093
|
+
case 12:
|
|
1094
|
+
elegibleCampaigns_1_1 = elegibleCampaigns_1.next();
|
|
1095
|
+
return [3 /*break*/, 3];
|
|
1096
|
+
case 13: return [3 /*break*/, 16];
|
|
1097
|
+
case 14:
|
|
1098
|
+
e_2_1 = _o.sent();
|
|
1099
|
+
e_2 = { error: e_2_1 };
|
|
1100
|
+
return [3 /*break*/, 16];
|
|
1101
|
+
case 15:
|
|
1102
|
+
try {
|
|
1103
|
+
if (elegibleCampaigns_1_1 && !elegibleCampaigns_1_1.done && (_l = elegibleCampaigns_1.return)) _l.call(elegibleCampaigns_1);
|
|
1104
|
+
}
|
|
1105
|
+
finally { if (e_2) throw e_2.error; }
|
|
1106
|
+
return [7 /*endfinally*/];
|
|
1107
|
+
case 16:
|
|
1108
|
+
if (!campaingnProducts.length)
|
|
1109
|
+
return [2 /*return*/, checkout];
|
|
1110
|
+
gifts = this.giftToLineItems(campaingnProducts);
|
|
1111
|
+
checkout.lineItems = notGiftItems.concat(gifts);
|
|
1112
|
+
return [2 /*return*/, checkout];
|
|
1113
|
+
}
|
|
1114
|
+
});
|
|
1115
|
+
});
|
|
1116
|
+
};
|
|
1117
|
+
CartService.prototype.giftToLineItems = function (items) {
|
|
1118
|
+
return items.map(function (item) {
|
|
1119
|
+
var _a;
|
|
1120
|
+
var brand = item.brand, categories = item.categories, id = item.id, name = item.name, price = item.price, sku = item.sku, slug = item.slug, stock = item.stock, weight = item.weight, EAN = item.EAN;
|
|
1121
|
+
var image = ((_a = item === null || item === void 0 ? void 0 : item.miniatures) === null || _a === void 0 ? void 0 : _a.length) ? item.miniatures[0] : item.images[0];
|
|
1122
|
+
return i3.LineItem.toInstance({
|
|
1123
|
+
brand: brand,
|
|
1124
|
+
categories: categories,
|
|
1125
|
+
id: id.toString(),
|
|
1126
|
+
name: name,
|
|
1127
|
+
price: price,
|
|
1128
|
+
sku: sku,
|
|
1129
|
+
slug: slug,
|
|
1130
|
+
stock: stock,
|
|
1131
|
+
weight: weight,
|
|
1132
|
+
EAN: EAN,
|
|
1133
|
+
image: image,
|
|
1134
|
+
pricePaid: 0,
|
|
1135
|
+
quantity: 1,
|
|
1136
|
+
isGift: true,
|
|
1137
|
+
});
|
|
1138
|
+
});
|
|
1139
|
+
};
|
|
974
1140
|
return CartService;
|
|
975
1141
|
}());
|
|
976
|
-
CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1142
|
+
CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'Buy2WinFirestoreRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
977
1143
|
CartService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService });
|
|
978
1144
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, decorators: [{
|
|
979
1145
|
type: i0.Injectable
|
|
980
1146
|
}], ctorParameters: function () {
|
|
981
|
-
return [{ type: AuthService }, { type: CheckoutService }, { type:
|
|
1147
|
+
return [{ type: AuthService }, { type: CheckoutService }, { type: i3__namespace.Shops, decorators: [{
|
|
982
1148
|
type: i0.Inject,
|
|
983
1149
|
args: [DEFAULT_SHOP]
|
|
984
1150
|
}] }, { type: undefined, decorators: [{
|
|
985
1151
|
type: i0.Inject,
|
|
986
1152
|
args: ['ProductRepository']
|
|
1153
|
+
}] }, { type: i3__namespace.Buy2WinFirestoreRepository, decorators: [{
|
|
1154
|
+
type: i0.Inject,
|
|
1155
|
+
args: ['Buy2WinFirestoreRepository']
|
|
987
1156
|
}] }];
|
|
988
1157
|
} });
|
|
989
1158
|
|
|
@@ -995,7 +1164,7 @@
|
|
|
995
1164
|
}
|
|
996
1165
|
CheckoutSubscriptionService.prototype.getCheckoutSubscription = function (checkoutData) {
|
|
997
1166
|
var checkoutId = cookie__default["default"].get('checkoutSubscriptionId');
|
|
998
|
-
if (!
|
|
1167
|
+
if (!i3.isNil(checkoutId))
|
|
999
1168
|
return rxjs.from(this.checkoutSubscriptionRepository.get({ id: checkoutId }));
|
|
1000
1169
|
return rxjs.from(this.createCheckoutSubscription(checkoutData));
|
|
1001
1170
|
};
|
|
@@ -1004,7 +1173,7 @@
|
|
|
1004
1173
|
var checkout;
|
|
1005
1174
|
return __generator(this, function (_a) {
|
|
1006
1175
|
switch (_a.label) {
|
|
1007
|
-
case 0: return [4 /*yield*/, this.checkoutSubscriptionRepository.create(Object.assign({ createdAt: new Date() },
|
|
1176
|
+
case 0: return [4 /*yield*/, this.checkoutSubscriptionRepository.create(Object.assign({ createdAt: new Date() }, i3.CheckoutSubscription.toInstance(i3.pick(checkoutData, ['user', 'shop'])).toPlain()))];
|
|
1008
1177
|
case 1:
|
|
1009
1178
|
checkout = _a.sent();
|
|
1010
1179
|
cookie__default["default"].set('checkoutSubscriptionId', checkout.id);
|
|
@@ -1019,7 +1188,7 @@
|
|
|
1019
1188
|
};
|
|
1020
1189
|
CheckoutSubscriptionService.prototype.checkCoupon = function (nickname, userEmail) {
|
|
1021
1190
|
var _this = this;
|
|
1022
|
-
return this.getCheckoutSubscription().pipe(operators.concatMap(function (checkout) { return _this.couponService.checkCoupon(nickname, userEmail,
|
|
1191
|
+
return this.getCheckoutSubscription().pipe(operators.concatMap(function (checkout) { return _this.couponService.checkCoupon(nickname, userEmail, i3.CheckoutTypes.SUBSCRIPTION, checkout.subscriptionPlan.name, null, true).pipe(); }));
|
|
1023
1192
|
};
|
|
1024
1193
|
CheckoutSubscriptionService.prototype.calcDiscountSubscription = function (coupon) {
|
|
1025
1194
|
var _this = this;
|
|
@@ -1050,8 +1219,8 @@
|
|
|
1050
1219
|
this.buildCategoryGroupWithRequiredData = function (group) {
|
|
1051
1220
|
var _a, _b;
|
|
1052
1221
|
return ({
|
|
1053
|
-
category:
|
|
1054
|
-
products: ((_b = group === null || group === void 0 ? void 0 : group.products) === null || _b === void 0 ? void 0 : _b.map(function (product) { return
|
|
1222
|
+
category: i3.Category.toInstance(i3.pick(((_a = group === null || group === void 0 ? void 0 : group.category) === null || _a === void 0 ? void 0 : _a.toPlain()) || {}, ['id', 'name', 'slug', 'conditions'])),
|
|
1223
|
+
products: ((_b = group === null || group === void 0 ? void 0 : group.products) === null || _b === void 0 ? void 0 : _b.map(function (product) { return i3.Product.toInstance(i3.pick((product === null || product === void 0 ? void 0 : product.toPlain()) || {}, [
|
|
1055
1224
|
'id',
|
|
1056
1225
|
'price',
|
|
1057
1226
|
'reviews',
|
|
@@ -1072,9 +1241,9 @@
|
|
|
1072
1241
|
}
|
|
1073
1242
|
Object.defineProperty(HomeShopService.prototype, "homeId", {
|
|
1074
1243
|
get: function () {
|
|
1075
|
-
if (this.defaultShop ===
|
|
1244
|
+
if (this.defaultShop === i3.Shops.GLAMSHOP)
|
|
1076
1245
|
return 'glamshop';
|
|
1077
|
-
if (this.defaultShop ===
|
|
1246
|
+
if (this.defaultShop === i3.Shops.MENSMARKET)
|
|
1078
1247
|
return 'mens_market';
|
|
1079
1248
|
return null;
|
|
1080
1249
|
},
|
|
@@ -1120,7 +1289,7 @@
|
|
|
1120
1289
|
HomeShopService.prototype.getVerticalProducts = function () {
|
|
1121
1290
|
var _this = this;
|
|
1122
1291
|
return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.forkJoin(home.verticalCarousels.filter(Boolean).map(function (id) { return rxjs.from(_this.categoryRepository.get({ id: id })).pipe(operators.concatMap(function (category) { return rxjs.from(_this.productRepository.find({
|
|
1123
|
-
filters: { categories: { operator:
|
|
1292
|
+
filters: { categories: { operator: i3.Where.IN, value: [category.id] } },
|
|
1124
1293
|
limits: { limit: 12 },
|
|
1125
1294
|
})).pipe(operators.map(function (products) { return ({ category: category, products: products }); })); }), operators.map(function (_c) {
|
|
1126
1295
|
var category = _c.category, products = _c.products;
|
|
@@ -1132,14 +1301,14 @@
|
|
|
1132
1301
|
return rxjs.of(this.homeConfiguration).pipe(operators.concatMap(function (home) { return home
|
|
1133
1302
|
? rxjs.of(home)
|
|
1134
1303
|
: !_this.homeId
|
|
1135
|
-
? rxjs.throwError(new
|
|
1304
|
+
? rxjs.throwError(new i3.RequiredArgumentError(['homeId']))
|
|
1136
1305
|
: rxjs.from(_this.homeRepository.get({ id: _this.homeId })).pipe(operators.tap(function (homeLoaded) { return (_this.homeConfiguration = homeLoaded); })); }));
|
|
1137
1306
|
};
|
|
1138
1307
|
HomeShopService.prototype.saveHomeData = function (homeData) {
|
|
1139
1308
|
var _this = this;
|
|
1140
1309
|
var data = {
|
|
1141
1310
|
createdAt: new Date(),
|
|
1142
|
-
expiresAt:
|
|
1311
|
+
expiresAt: i3.add(new Date(), { hours: 1 }),
|
|
1143
1312
|
data: homeData,
|
|
1144
1313
|
};
|
|
1145
1314
|
return rxjs.from(this.homeRepository.update({
|
|
@@ -1163,7 +1332,7 @@
|
|
|
1163
1332
|
}] }, { type: undefined, decorators: [{
|
|
1164
1333
|
type: i0.Inject,
|
|
1165
1334
|
args: ['ProductRepository']
|
|
1166
|
-
}] }, { type:
|
|
1335
|
+
}] }, { type: i3__namespace.Shops, decorators: [{
|
|
1167
1336
|
type: i0.Inject,
|
|
1168
1337
|
args: [DEFAULT_SHOP]
|
|
1169
1338
|
}] }];
|
|
@@ -1180,18 +1349,18 @@
|
|
|
1180
1349
|
this.angularFirestore
|
|
1181
1350
|
.doc(this.orderRepository.collectionName + "/" + id)
|
|
1182
1351
|
.valueChanges()
|
|
1183
|
-
.pipe(operators.map(function (doc) { return
|
|
1352
|
+
.pipe(operators.map(function (doc) { return i3.Order.toInstance(doc); }))
|
|
1184
1353
|
.subscribe(function (doc) { return _this.orderSubject.next(doc); });
|
|
1185
1354
|
return this.orderSubject;
|
|
1186
1355
|
};
|
|
1187
1356
|
return OrderService;
|
|
1188
1357
|
}());
|
|
1189
|
-
OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, deps: [{ token: i1__namespace$
|
|
1358
|
+
OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, deps: [{ token: i1__namespace$1.AngularFirestore }, { token: 'OrderRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1190
1359
|
OrderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService });
|
|
1191
1360
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, decorators: [{
|
|
1192
1361
|
type: i0.Injectable
|
|
1193
1362
|
}], ctorParameters: function () {
|
|
1194
|
-
return [{ type: i1__namespace$
|
|
1363
|
+
return [{ type: i1__namespace$1.AngularFirestore }, { type: i3__namespace.OrderFirestoreRepository, decorators: [{
|
|
1195
1364
|
type: i0.Inject,
|
|
1196
1365
|
args: ['OrderRepository']
|
|
1197
1366
|
}] }];
|
|
@@ -1231,7 +1400,7 @@
|
|
|
1231
1400
|
return s;
|
|
1232
1401
|
});
|
|
1233
1402
|
}
|
|
1234
|
-
if (shop ==
|
|
1403
|
+
if (shop == i3.Shops.GLAMSHOP)
|
|
1235
1404
|
return shippingMethods;
|
|
1236
1405
|
if (_this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
|
|
1237
1406
|
shippingMethods = shippingMethods.map(function (s) {
|
|
@@ -1252,7 +1421,7 @@
|
|
|
1252
1421
|
ShippingService.prototype.isFreeShippingBySubscription = function (shop, subscriptionPlan) {
|
|
1253
1422
|
if (!subscriptionPlan)
|
|
1254
1423
|
return false;
|
|
1255
|
-
if (shop ==
|
|
1424
|
+
if (shop == i3.Shops.MENSMARKET && subscriptionPlan == 'SELECT') {
|
|
1256
1425
|
return true;
|
|
1257
1426
|
}
|
|
1258
1427
|
return false;
|
|
@@ -1260,7 +1429,7 @@
|
|
|
1260
1429
|
ShippingService.prototype.isHalfShippingBySubscription = function (shop, subscriptionPlan) {
|
|
1261
1430
|
if (!subscriptionPlan)
|
|
1262
1431
|
return false;
|
|
1263
|
-
if (shop ==
|
|
1432
|
+
if (shop == i3.Shops.MENSMARKET && subscriptionPlan == 'PRIME') {
|
|
1264
1433
|
return true;
|
|
1265
1434
|
}
|
|
1266
1435
|
return false;
|
|
@@ -1279,12 +1448,12 @@
|
|
|
1279
1448
|
};
|
|
1280
1449
|
return ShippingService;
|
|
1281
1450
|
}());
|
|
1282
|
-
ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$
|
|
1451
|
+
ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$2.HttpClient }, { token: BACKEND_URL }, { token: HomeShopService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1283
1452
|
ShippingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService });
|
|
1284
1453
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, decorators: [{
|
|
1285
1454
|
type: i0.Injectable
|
|
1286
1455
|
}], ctorParameters: function () {
|
|
1287
|
-
return [{ type: i1__namespace$
|
|
1456
|
+
return [{ type: i1__namespace$2.HttpClient }, { type: undefined, decorators: [{
|
|
1288
1457
|
type: i0.Inject,
|
|
1289
1458
|
args: [BACKEND_URL]
|
|
1290
1459
|
}] }, { type: HomeShopService }];
|
|
@@ -1310,42 +1479,42 @@
|
|
|
1310
1479
|
{
|
|
1311
1480
|
provide: 'Authentication',
|
|
1312
1481
|
useFactory: function (authenticationService, userRepository) {
|
|
1313
|
-
return new
|
|
1482
|
+
return new i3.Authentication(authenticationService, userRepository);
|
|
1314
1483
|
},
|
|
1315
1484
|
deps: ['AuthenticationService', 'UserRepository'],
|
|
1316
1485
|
},
|
|
1317
1486
|
{
|
|
1318
1487
|
provide: 'AuthenticationService',
|
|
1319
1488
|
useFactory: function (angularFireAuth) {
|
|
1320
|
-
return new
|
|
1489
|
+
return new i3.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
1321
1490
|
},
|
|
1322
1491
|
deps: [i1.AngularFireAuth],
|
|
1323
1492
|
},
|
|
1324
1493
|
{
|
|
1325
1494
|
provide: 'Register',
|
|
1326
1495
|
useFactory: function (registerService, userRepository) {
|
|
1327
|
-
return new
|
|
1496
|
+
return new i3.Register(registerService, userRepository);
|
|
1328
1497
|
},
|
|
1329
1498
|
deps: ['RegisterService', 'UserRepository'],
|
|
1330
1499
|
},
|
|
1331
1500
|
{
|
|
1332
1501
|
provide: 'RegisterService',
|
|
1333
1502
|
useFactory: function (angularFireAuth) {
|
|
1334
|
-
return new
|
|
1503
|
+
return new i3.RegisterFirebaseAuthService(angularFireAuth);
|
|
1335
1504
|
},
|
|
1336
1505
|
deps: [i1.AngularFireAuth],
|
|
1337
1506
|
},
|
|
1338
1507
|
{
|
|
1339
1508
|
provide: 'SignOut',
|
|
1340
1509
|
useFactory: function (authenticationService) {
|
|
1341
|
-
return new
|
|
1510
|
+
return new i3.SignOut(authenticationService);
|
|
1342
1511
|
},
|
|
1343
1512
|
deps: ['AuthenticationService'],
|
|
1344
1513
|
},
|
|
1345
1514
|
{
|
|
1346
1515
|
provide: 'RecoveryPassword',
|
|
1347
1516
|
useFactory: function (authenticationService) {
|
|
1348
|
-
return new
|
|
1517
|
+
return new i3.RecoveryPassword(authenticationService);
|
|
1349
1518
|
},
|
|
1350
1519
|
deps: ['AuthenticationService'],
|
|
1351
1520
|
},
|
|
@@ -1358,42 +1527,42 @@
|
|
|
1358
1527
|
{
|
|
1359
1528
|
provide: 'Authentication',
|
|
1360
1529
|
useFactory: function (authenticationService, userRepository) {
|
|
1361
|
-
return new
|
|
1530
|
+
return new i3.Authentication(authenticationService, userRepository);
|
|
1362
1531
|
},
|
|
1363
1532
|
deps: ['AuthenticationService', 'UserRepository'],
|
|
1364
1533
|
},
|
|
1365
1534
|
{
|
|
1366
1535
|
provide: 'AuthenticationService',
|
|
1367
1536
|
useFactory: function (angularFireAuth) {
|
|
1368
|
-
return new
|
|
1537
|
+
return new i3.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
1369
1538
|
},
|
|
1370
1539
|
deps: [i1.AngularFireAuth],
|
|
1371
1540
|
},
|
|
1372
1541
|
{
|
|
1373
1542
|
provide: 'Register',
|
|
1374
1543
|
useFactory: function (registerService, userRepository) {
|
|
1375
|
-
return new
|
|
1544
|
+
return new i3.Register(registerService, userRepository);
|
|
1376
1545
|
},
|
|
1377
1546
|
deps: ['RegisterService', 'UserRepository'],
|
|
1378
1547
|
},
|
|
1379
1548
|
{
|
|
1380
1549
|
provide: 'RegisterService',
|
|
1381
1550
|
useFactory: function (angularFireAuth) {
|
|
1382
|
-
return new
|
|
1551
|
+
return new i3.RegisterFirebaseAuthService(angularFireAuth);
|
|
1383
1552
|
},
|
|
1384
1553
|
deps: [i1.AngularFireAuth],
|
|
1385
1554
|
},
|
|
1386
1555
|
{
|
|
1387
1556
|
provide: 'SignOut',
|
|
1388
1557
|
useFactory: function (authenticationService) {
|
|
1389
|
-
return new
|
|
1558
|
+
return new i3.SignOut(authenticationService);
|
|
1390
1559
|
},
|
|
1391
1560
|
deps: ['AuthenticationService'],
|
|
1392
1561
|
},
|
|
1393
1562
|
{
|
|
1394
1563
|
provide: 'RecoveryPassword',
|
|
1395
1564
|
useFactory: function (authenticationService) {
|
|
1396
|
-
return new
|
|
1565
|
+
return new i3.RecoveryPassword(authenticationService);
|
|
1397
1566
|
},
|
|
1398
1567
|
deps: ['AuthenticationService'],
|
|
1399
1568
|
},
|
|
@@ -1416,9 +1585,9 @@
|
|
|
1416
1585
|
AngularElasticSeachModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule });
|
|
1417
1586
|
AngularElasticSeachModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, providers: [
|
|
1418
1587
|
{
|
|
1419
|
-
provide:
|
|
1588
|
+
provide: i3.ProductsIndex,
|
|
1420
1589
|
useFactory: function (configuration) {
|
|
1421
|
-
return new
|
|
1590
|
+
return new i3.ProductsIndex(new i3.AxiosAdapter(configuration));
|
|
1422
1591
|
},
|
|
1423
1592
|
deps: [ES_CONFIG],
|
|
1424
1593
|
},
|
|
@@ -1428,9 +1597,9 @@
|
|
|
1428
1597
|
args: [{
|
|
1429
1598
|
providers: [
|
|
1430
1599
|
{
|
|
1431
|
-
provide:
|
|
1600
|
+
provide: i3.ProductsIndex,
|
|
1432
1601
|
useFactory: function (configuration) {
|
|
1433
|
-
return new
|
|
1602
|
+
return new i3.ProductsIndex(new i3.AxiosAdapter(configuration));
|
|
1434
1603
|
},
|
|
1435
1604
|
deps: [ES_CONFIG],
|
|
1436
1605
|
},
|
|
@@ -1459,161 +1628,161 @@
|
|
|
1459
1628
|
{
|
|
1460
1629
|
provide: 'BeautyProfileRepository',
|
|
1461
1630
|
useFactory: function (firestore, userRepository) {
|
|
1462
|
-
return new
|
|
1631
|
+
return new i3.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
1463
1632
|
},
|
|
1464
|
-
deps: [i1$
|
|
1633
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1465
1634
|
},
|
|
1466
1635
|
{
|
|
1467
1636
|
provide: 'Buy2WinRepository',
|
|
1468
1637
|
useFactory: function (firestore) {
|
|
1469
|
-
return new
|
|
1638
|
+
return new i3.Buy2WinFirestoreRepository(firestore.firestore);
|
|
1470
1639
|
},
|
|
1471
|
-
deps: [i1$
|
|
1640
|
+
deps: [i1$1.AngularFirestore],
|
|
1472
1641
|
},
|
|
1473
1642
|
{
|
|
1474
|
-
provide:
|
|
1643
|
+
provide: i3.CategoryFirestoreRepository,
|
|
1475
1644
|
useFactory: function (firestore) {
|
|
1476
|
-
return new
|
|
1645
|
+
return new i3.CategoryFirestoreRepository(firestore.firestore);
|
|
1477
1646
|
},
|
|
1478
|
-
deps: [i1$
|
|
1647
|
+
deps: [i1$1.AngularFirestore],
|
|
1479
1648
|
},
|
|
1480
1649
|
{
|
|
1481
1650
|
provide: 'CheckoutRepository',
|
|
1482
1651
|
useFactory: function (firestore) {
|
|
1483
|
-
return new
|
|
1652
|
+
return new i3.CheckoutFirestoreRepository(firestore.firestore);
|
|
1484
1653
|
},
|
|
1485
|
-
deps: [i1$
|
|
1654
|
+
deps: [i1$1.AngularFirestore],
|
|
1486
1655
|
},
|
|
1487
1656
|
{
|
|
1488
1657
|
provide: 'CheckoutSubscriptionRepository',
|
|
1489
1658
|
useFactory: function (firestore) {
|
|
1490
|
-
return new
|
|
1659
|
+
return new i3.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
1491
1660
|
},
|
|
1492
|
-
deps: [i1$
|
|
1661
|
+
deps: [i1$1.AngularFirestore],
|
|
1493
1662
|
},
|
|
1494
1663
|
{
|
|
1495
1664
|
provide: 'CouponRepository',
|
|
1496
1665
|
useFactory: function (firestore) {
|
|
1497
|
-
return new
|
|
1666
|
+
return new i3.CouponFirestoreRepository(firestore.firestore);
|
|
1498
1667
|
},
|
|
1499
|
-
deps: [i1$
|
|
1668
|
+
deps: [i1$1.AngularFirestore],
|
|
1500
1669
|
},
|
|
1501
1670
|
{
|
|
1502
1671
|
provide: 'EditionRepository',
|
|
1503
1672
|
useFactory: function (firestore, subscriptionRepository) {
|
|
1504
|
-
return new
|
|
1673
|
+
return new i3.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1505
1674
|
},
|
|
1506
|
-
deps: [i1$
|
|
1675
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1507
1676
|
},
|
|
1508
1677
|
{
|
|
1509
1678
|
provide: 'HomeRepository',
|
|
1510
1679
|
useFactory: function (firestore) {
|
|
1511
|
-
return new
|
|
1680
|
+
return new i3.HomeFirestoreRepository(firestore.firestore);
|
|
1512
1681
|
},
|
|
1513
|
-
deps: [i1$
|
|
1682
|
+
deps: [i1$1.AngularFirestore],
|
|
1514
1683
|
},
|
|
1515
1684
|
{
|
|
1516
1685
|
provide: 'LeadRepository',
|
|
1517
1686
|
useFactory: function (firestore) {
|
|
1518
|
-
return new
|
|
1687
|
+
return new i3.LeadFirestoreRepository(firestore.firestore);
|
|
1519
1688
|
},
|
|
1520
|
-
deps: [i1$
|
|
1689
|
+
deps: [i1$1.AngularFirestore],
|
|
1521
1690
|
},
|
|
1522
1691
|
{
|
|
1523
1692
|
provide: 'LegacyOrderRepository',
|
|
1524
1693
|
useFactory: function (firestore) {
|
|
1525
|
-
return new
|
|
1694
|
+
return new i3.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
1526
1695
|
},
|
|
1527
|
-
deps: [i1$
|
|
1696
|
+
deps: [i1$1.AngularFirestore],
|
|
1528
1697
|
},
|
|
1529
1698
|
{
|
|
1530
1699
|
provide: 'ShopMenuRepository',
|
|
1531
1700
|
useFactory: function (firestore) {
|
|
1532
|
-
return new
|
|
1701
|
+
return new i3.ShopMenuFirestoreRepository(firestore.firestore);
|
|
1533
1702
|
},
|
|
1534
|
-
deps: [i1$
|
|
1703
|
+
deps: [i1$1.AngularFirestore],
|
|
1535
1704
|
},
|
|
1536
1705
|
{
|
|
1537
1706
|
provide: 'OrderRepository',
|
|
1538
1707
|
useFactory: function (firestore) {
|
|
1539
|
-
return new
|
|
1708
|
+
return new i3.OrderFirestoreRepository(firestore.firestore);
|
|
1540
1709
|
},
|
|
1541
|
-
deps: [i1$
|
|
1710
|
+
deps: [i1$1.AngularFirestore],
|
|
1542
1711
|
},
|
|
1543
1712
|
{
|
|
1544
1713
|
provide: 'PaymentRepository',
|
|
1545
1714
|
useFactory: function (firestore) {
|
|
1546
|
-
return new
|
|
1715
|
+
return new i3.PaymentFirestoreRepository(firestore.firestore);
|
|
1547
1716
|
},
|
|
1548
|
-
deps: [i1$
|
|
1717
|
+
deps: [i1$1.AngularFirestore],
|
|
1549
1718
|
},
|
|
1550
1719
|
{
|
|
1551
|
-
provide:
|
|
1720
|
+
provide: i3.ProductFirestoreRepository,
|
|
1552
1721
|
useFactory: function (firestore) {
|
|
1553
|
-
return new
|
|
1722
|
+
return new i3.ProductFirestoreRepository(firestore.firestore);
|
|
1554
1723
|
},
|
|
1555
|
-
deps: [i1$
|
|
1724
|
+
deps: [i1$1.AngularFirestore],
|
|
1556
1725
|
},
|
|
1557
1726
|
{
|
|
1558
1727
|
provide: 'SubscriptionPaymentRepository',
|
|
1559
1728
|
useFactory: function (firestore, subscriptionRepository) {
|
|
1560
|
-
return new
|
|
1729
|
+
return new i3.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1561
1730
|
},
|
|
1562
|
-
deps: [i1$
|
|
1731
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1563
1732
|
},
|
|
1564
1733
|
{
|
|
1565
1734
|
provide: 'SubscriptionPlanRepository',
|
|
1566
1735
|
useFactory: function (firestore) {
|
|
1567
|
-
return new
|
|
1736
|
+
return new i3.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
1568
1737
|
},
|
|
1569
|
-
deps: [i1$
|
|
1738
|
+
deps: [i1$1.AngularFirestore],
|
|
1570
1739
|
},
|
|
1571
1740
|
{
|
|
1572
1741
|
provide: 'SubscriptionProductRepository',
|
|
1573
1742
|
useFactory: function (firestore) {
|
|
1574
|
-
return new
|
|
1743
|
+
return new i3.SubscriptionProductFirestoreRepository(firestore.firestore);
|
|
1575
1744
|
},
|
|
1576
|
-
deps: [i1$
|
|
1745
|
+
deps: [i1$1.AngularFirestore],
|
|
1577
1746
|
},
|
|
1578
1747
|
{
|
|
1579
1748
|
provide: 'SubscriptionRepository',
|
|
1580
1749
|
useFactory: function (firestore) {
|
|
1581
|
-
return new
|
|
1750
|
+
return new i3.SubscriptionFirestoreRepository(firestore.firestore);
|
|
1582
1751
|
},
|
|
1583
|
-
deps: [i1$
|
|
1752
|
+
deps: [i1$1.AngularFirestore],
|
|
1584
1753
|
},
|
|
1585
1754
|
{
|
|
1586
1755
|
provide: 'UserRepository',
|
|
1587
1756
|
useFactory: function (firestore) {
|
|
1588
|
-
return new
|
|
1757
|
+
return new i3.UserFirestoreRepository(firestore.firestore);
|
|
1589
1758
|
},
|
|
1590
|
-
deps: [i1$
|
|
1759
|
+
deps: [i1$1.AngularFirestore],
|
|
1591
1760
|
},
|
|
1592
1761
|
{
|
|
1593
1762
|
provide: 'UserAddressRepository',
|
|
1594
1763
|
useFactory: function (firestore, userRepository) {
|
|
1595
|
-
return new
|
|
1764
|
+
return new i3.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
1596
1765
|
},
|
|
1597
|
-
deps: [i1$
|
|
1766
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1598
1767
|
},
|
|
1599
1768
|
{
|
|
1600
1769
|
provide: 'UserPaymentMethodRepository',
|
|
1601
1770
|
useFactory: function (firestore, userRepository) {
|
|
1602
|
-
return new
|
|
1771
|
+
return new i3.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
|
|
1603
1772
|
},
|
|
1604
|
-
deps: [i1$
|
|
1773
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1605
1774
|
},
|
|
1606
1775
|
{
|
|
1607
|
-
provide:
|
|
1776
|
+
provide: i3.ProductVariantFirestoreRepository,
|
|
1608
1777
|
useFactory: function (firestore, productRepository) {
|
|
1609
|
-
return new
|
|
1778
|
+
return new i3.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
1610
1779
|
},
|
|
1611
|
-
deps: [i1$
|
|
1780
|
+
deps: [i1$1.AngularFirestore, i3.ProductFirestoreRepository],
|
|
1612
1781
|
},
|
|
1613
1782
|
{
|
|
1614
1783
|
provide: i0.APP_INITIALIZER,
|
|
1615
1784
|
useFactory: function (firestore) { return function () { return firestore.firestore.settings({ ignoreUndefinedProperties: true }); }; },
|
|
1616
|
-
deps: [i1$
|
|
1785
|
+
deps: [i1$1.AngularFirestore],
|
|
1617
1786
|
multi: true,
|
|
1618
1787
|
},
|
|
1619
1788
|
], imports: [[fire.AngularFireModule, AngularElasticSeachModule]] });
|
|
@@ -1625,161 +1794,161 @@
|
|
|
1625
1794
|
{
|
|
1626
1795
|
provide: 'BeautyProfileRepository',
|
|
1627
1796
|
useFactory: function (firestore, userRepository) {
|
|
1628
|
-
return new
|
|
1797
|
+
return new i3.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
1629
1798
|
},
|
|
1630
|
-
deps: [i1$
|
|
1799
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1631
1800
|
},
|
|
1632
1801
|
{
|
|
1633
1802
|
provide: 'Buy2WinRepository',
|
|
1634
1803
|
useFactory: function (firestore) {
|
|
1635
|
-
return new
|
|
1804
|
+
return new i3.Buy2WinFirestoreRepository(firestore.firestore);
|
|
1636
1805
|
},
|
|
1637
|
-
deps: [i1$
|
|
1806
|
+
deps: [i1$1.AngularFirestore],
|
|
1638
1807
|
},
|
|
1639
1808
|
{
|
|
1640
|
-
provide:
|
|
1809
|
+
provide: i3.CategoryFirestoreRepository,
|
|
1641
1810
|
useFactory: function (firestore) {
|
|
1642
|
-
return new
|
|
1811
|
+
return new i3.CategoryFirestoreRepository(firestore.firestore);
|
|
1643
1812
|
},
|
|
1644
|
-
deps: [i1$
|
|
1813
|
+
deps: [i1$1.AngularFirestore],
|
|
1645
1814
|
},
|
|
1646
1815
|
{
|
|
1647
1816
|
provide: 'CheckoutRepository',
|
|
1648
1817
|
useFactory: function (firestore) {
|
|
1649
|
-
return new
|
|
1818
|
+
return new i3.CheckoutFirestoreRepository(firestore.firestore);
|
|
1650
1819
|
},
|
|
1651
|
-
deps: [i1$
|
|
1820
|
+
deps: [i1$1.AngularFirestore],
|
|
1652
1821
|
},
|
|
1653
1822
|
{
|
|
1654
1823
|
provide: 'CheckoutSubscriptionRepository',
|
|
1655
1824
|
useFactory: function (firestore) {
|
|
1656
|
-
return new
|
|
1825
|
+
return new i3.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
1657
1826
|
},
|
|
1658
|
-
deps: [i1$
|
|
1827
|
+
deps: [i1$1.AngularFirestore],
|
|
1659
1828
|
},
|
|
1660
1829
|
{
|
|
1661
1830
|
provide: 'CouponRepository',
|
|
1662
1831
|
useFactory: function (firestore) {
|
|
1663
|
-
return new
|
|
1832
|
+
return new i3.CouponFirestoreRepository(firestore.firestore);
|
|
1664
1833
|
},
|
|
1665
|
-
deps: [i1$
|
|
1834
|
+
deps: [i1$1.AngularFirestore],
|
|
1666
1835
|
},
|
|
1667
1836
|
{
|
|
1668
1837
|
provide: 'EditionRepository',
|
|
1669
1838
|
useFactory: function (firestore, subscriptionRepository) {
|
|
1670
|
-
return new
|
|
1839
|
+
return new i3.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1671
1840
|
},
|
|
1672
|
-
deps: [i1$
|
|
1841
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1673
1842
|
},
|
|
1674
1843
|
{
|
|
1675
1844
|
provide: 'HomeRepository',
|
|
1676
1845
|
useFactory: function (firestore) {
|
|
1677
|
-
return new
|
|
1846
|
+
return new i3.HomeFirestoreRepository(firestore.firestore);
|
|
1678
1847
|
},
|
|
1679
|
-
deps: [i1$
|
|
1848
|
+
deps: [i1$1.AngularFirestore],
|
|
1680
1849
|
},
|
|
1681
1850
|
{
|
|
1682
1851
|
provide: 'LeadRepository',
|
|
1683
1852
|
useFactory: function (firestore) {
|
|
1684
|
-
return new
|
|
1853
|
+
return new i3.LeadFirestoreRepository(firestore.firestore);
|
|
1685
1854
|
},
|
|
1686
|
-
deps: [i1$
|
|
1855
|
+
deps: [i1$1.AngularFirestore],
|
|
1687
1856
|
},
|
|
1688
1857
|
{
|
|
1689
1858
|
provide: 'LegacyOrderRepository',
|
|
1690
1859
|
useFactory: function (firestore) {
|
|
1691
|
-
return new
|
|
1860
|
+
return new i3.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
1692
1861
|
},
|
|
1693
|
-
deps: [i1$
|
|
1862
|
+
deps: [i1$1.AngularFirestore],
|
|
1694
1863
|
},
|
|
1695
1864
|
{
|
|
1696
1865
|
provide: 'ShopMenuRepository',
|
|
1697
1866
|
useFactory: function (firestore) {
|
|
1698
|
-
return new
|
|
1867
|
+
return new i3.ShopMenuFirestoreRepository(firestore.firestore);
|
|
1699
1868
|
},
|
|
1700
|
-
deps: [i1$
|
|
1869
|
+
deps: [i1$1.AngularFirestore],
|
|
1701
1870
|
},
|
|
1702
1871
|
{
|
|
1703
1872
|
provide: 'OrderRepository',
|
|
1704
1873
|
useFactory: function (firestore) {
|
|
1705
|
-
return new
|
|
1874
|
+
return new i3.OrderFirestoreRepository(firestore.firestore);
|
|
1706
1875
|
},
|
|
1707
|
-
deps: [i1$
|
|
1876
|
+
deps: [i1$1.AngularFirestore],
|
|
1708
1877
|
},
|
|
1709
1878
|
{
|
|
1710
1879
|
provide: 'PaymentRepository',
|
|
1711
1880
|
useFactory: function (firestore) {
|
|
1712
|
-
return new
|
|
1881
|
+
return new i3.PaymentFirestoreRepository(firestore.firestore);
|
|
1713
1882
|
},
|
|
1714
|
-
deps: [i1$
|
|
1883
|
+
deps: [i1$1.AngularFirestore],
|
|
1715
1884
|
},
|
|
1716
1885
|
{
|
|
1717
|
-
provide:
|
|
1886
|
+
provide: i3.ProductFirestoreRepository,
|
|
1718
1887
|
useFactory: function (firestore) {
|
|
1719
|
-
return new
|
|
1888
|
+
return new i3.ProductFirestoreRepository(firestore.firestore);
|
|
1720
1889
|
},
|
|
1721
|
-
deps: [i1$
|
|
1890
|
+
deps: [i1$1.AngularFirestore],
|
|
1722
1891
|
},
|
|
1723
1892
|
{
|
|
1724
1893
|
provide: 'SubscriptionPaymentRepository',
|
|
1725
1894
|
useFactory: function (firestore, subscriptionRepository) {
|
|
1726
|
-
return new
|
|
1895
|
+
return new i3.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1727
1896
|
},
|
|
1728
|
-
deps: [i1$
|
|
1897
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1729
1898
|
},
|
|
1730
1899
|
{
|
|
1731
1900
|
provide: 'SubscriptionPlanRepository',
|
|
1732
1901
|
useFactory: function (firestore) {
|
|
1733
|
-
return new
|
|
1902
|
+
return new i3.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
1734
1903
|
},
|
|
1735
|
-
deps: [i1$
|
|
1904
|
+
deps: [i1$1.AngularFirestore],
|
|
1736
1905
|
},
|
|
1737
1906
|
{
|
|
1738
1907
|
provide: 'SubscriptionProductRepository',
|
|
1739
1908
|
useFactory: function (firestore) {
|
|
1740
|
-
return new
|
|
1909
|
+
return new i3.SubscriptionProductFirestoreRepository(firestore.firestore);
|
|
1741
1910
|
},
|
|
1742
|
-
deps: [i1$
|
|
1911
|
+
deps: [i1$1.AngularFirestore],
|
|
1743
1912
|
},
|
|
1744
1913
|
{
|
|
1745
1914
|
provide: 'SubscriptionRepository',
|
|
1746
1915
|
useFactory: function (firestore) {
|
|
1747
|
-
return new
|
|
1916
|
+
return new i3.SubscriptionFirestoreRepository(firestore.firestore);
|
|
1748
1917
|
},
|
|
1749
|
-
deps: [i1$
|
|
1918
|
+
deps: [i1$1.AngularFirestore],
|
|
1750
1919
|
},
|
|
1751
1920
|
{
|
|
1752
1921
|
provide: 'UserRepository',
|
|
1753
1922
|
useFactory: function (firestore) {
|
|
1754
|
-
return new
|
|
1923
|
+
return new i3.UserFirestoreRepository(firestore.firestore);
|
|
1755
1924
|
},
|
|
1756
|
-
deps: [i1$
|
|
1925
|
+
deps: [i1$1.AngularFirestore],
|
|
1757
1926
|
},
|
|
1758
1927
|
{
|
|
1759
1928
|
provide: 'UserAddressRepository',
|
|
1760
1929
|
useFactory: function (firestore, userRepository) {
|
|
1761
|
-
return new
|
|
1930
|
+
return new i3.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
1762
1931
|
},
|
|
1763
|
-
deps: [i1$
|
|
1932
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1764
1933
|
},
|
|
1765
1934
|
{
|
|
1766
1935
|
provide: 'UserPaymentMethodRepository',
|
|
1767
1936
|
useFactory: function (firestore, userRepository) {
|
|
1768
|
-
return new
|
|
1937
|
+
return new i3.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
|
|
1769
1938
|
},
|
|
1770
|
-
deps: [i1$
|
|
1939
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1771
1940
|
},
|
|
1772
1941
|
{
|
|
1773
|
-
provide:
|
|
1942
|
+
provide: i3.ProductVariantFirestoreRepository,
|
|
1774
1943
|
useFactory: function (firestore, productRepository) {
|
|
1775
|
-
return new
|
|
1944
|
+
return new i3.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
1776
1945
|
},
|
|
1777
|
-
deps: [i1$
|
|
1946
|
+
deps: [i1$1.AngularFirestore, i3.ProductFirestoreRepository],
|
|
1778
1947
|
},
|
|
1779
1948
|
{
|
|
1780
1949
|
provide: i0.APP_INITIALIZER,
|
|
1781
1950
|
useFactory: function (firestore) { return function () { return firestore.firestore.settings({ ignoreUndefinedProperties: true }); }; },
|
|
1782
|
-
deps: [i1$
|
|
1951
|
+
deps: [i1$1.AngularFirestore],
|
|
1783
1952
|
multi: true,
|
|
1784
1953
|
},
|
|
1785
1954
|
],
|
|
@@ -1802,69 +1971,69 @@
|
|
|
1802
1971
|
AngularHasuraGraphQLModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule, providers: [
|
|
1803
1972
|
{
|
|
1804
1973
|
provide: 'CategoryRepository',
|
|
1805
|
-
useExisting:
|
|
1974
|
+
useExisting: i3.CategoryHasuraGraphQLRepository,
|
|
1806
1975
|
},
|
|
1807
1976
|
{
|
|
1808
|
-
provide:
|
|
1977
|
+
provide: i3.CategoryHasuraGraphQLRepository,
|
|
1809
1978
|
useFactory: function (options, productRepository, categoryFilterRepository) {
|
|
1810
|
-
return new
|
|
1979
|
+
return new i3.CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository, categoryFilterRepository);
|
|
1811
1980
|
},
|
|
1812
|
-
deps: [HASURA_OPTIONS,
|
|
1981
|
+
deps: [HASURA_OPTIONS, i3.ProductHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
|
|
1813
1982
|
},
|
|
1814
1983
|
{
|
|
1815
1984
|
provide: 'ProductRepository',
|
|
1816
|
-
useExisting:
|
|
1985
|
+
useExisting: i3.ProductHasuraGraphQLRepository,
|
|
1817
1986
|
},
|
|
1818
1987
|
{
|
|
1819
|
-
provide:
|
|
1988
|
+
provide: i3.ProductHasuraGraphQLRepository,
|
|
1820
1989
|
useFactory: function (options) {
|
|
1821
|
-
return new
|
|
1990
|
+
return new i3.ProductHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1822
1991
|
},
|
|
1823
1992
|
deps: [HASURA_OPTIONS],
|
|
1824
1993
|
},
|
|
1825
1994
|
{
|
|
1826
1995
|
provide: 'VariantRepository',
|
|
1827
|
-
useExisting:
|
|
1996
|
+
useExisting: i3.VariantHasuraGraphQLRepository,
|
|
1828
1997
|
},
|
|
1829
1998
|
{
|
|
1830
|
-
provide:
|
|
1999
|
+
provide: i3.VariantHasuraGraphQLRepository,
|
|
1831
2000
|
useFactory: function (options) {
|
|
1832
|
-
return new
|
|
2001
|
+
return new i3.VariantHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1833
2002
|
},
|
|
1834
2003
|
deps: [HASURA_OPTIONS],
|
|
1835
2004
|
},
|
|
1836
2005
|
{
|
|
1837
2006
|
provide: 'CategoryFilterRepository',
|
|
1838
|
-
useExisting:
|
|
2007
|
+
useExisting: i3.CategoryFilterHasuraGraphQLRepository,
|
|
1839
2008
|
},
|
|
1840
2009
|
{
|
|
1841
|
-
provide:
|
|
2010
|
+
provide: i3.CategoryFilterHasuraGraphQLRepository,
|
|
1842
2011
|
useFactory: function (options) {
|
|
1843
|
-
return new
|
|
2012
|
+
return new i3.CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1844
2013
|
},
|
|
1845
2014
|
deps: [HASURA_OPTIONS],
|
|
1846
2015
|
},
|
|
1847
2016
|
{
|
|
1848
2017
|
provide: 'FilterOptionRepository',
|
|
1849
|
-
useExisting:
|
|
2018
|
+
useExisting: i3.FilterOptionHasuraGraphQLRepository,
|
|
1850
2019
|
},
|
|
1851
2020
|
{
|
|
1852
|
-
provide:
|
|
2021
|
+
provide: i3.FilterOptionHasuraGraphQLRepository,
|
|
1853
2022
|
useFactory: function (options) {
|
|
1854
|
-
return new
|
|
2023
|
+
return new i3.FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1855
2024
|
},
|
|
1856
2025
|
deps: [HASURA_OPTIONS],
|
|
1857
2026
|
},
|
|
1858
2027
|
{
|
|
1859
2028
|
provide: 'FilterRepository',
|
|
1860
|
-
useExisting:
|
|
2029
|
+
useExisting: i3.FilterHasuraGraphQLRepository,
|
|
1861
2030
|
},
|
|
1862
2031
|
{
|
|
1863
|
-
provide:
|
|
2032
|
+
provide: i3.FilterHasuraGraphQLRepository,
|
|
1864
2033
|
useFactory: function (options, filterOptionRepository, categoryFilterRepository) {
|
|
1865
|
-
return new
|
|
2034
|
+
return new i3.FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository, categoryFilterRepository);
|
|
1866
2035
|
},
|
|
1867
|
-
deps: [HASURA_OPTIONS,
|
|
2036
|
+
deps: [HASURA_OPTIONS, i3.FilterOptionHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
|
|
1868
2037
|
},
|
|
1869
2038
|
] });
|
|
1870
2039
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule, decorators: [{
|
|
@@ -1873,69 +2042,69 @@
|
|
|
1873
2042
|
providers: [
|
|
1874
2043
|
{
|
|
1875
2044
|
provide: 'CategoryRepository',
|
|
1876
|
-
useExisting:
|
|
2045
|
+
useExisting: i3.CategoryHasuraGraphQLRepository,
|
|
1877
2046
|
},
|
|
1878
2047
|
{
|
|
1879
|
-
provide:
|
|
2048
|
+
provide: i3.CategoryHasuraGraphQLRepository,
|
|
1880
2049
|
useFactory: function (options, productRepository, categoryFilterRepository) {
|
|
1881
|
-
return new
|
|
2050
|
+
return new i3.CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository, categoryFilterRepository);
|
|
1882
2051
|
},
|
|
1883
|
-
deps: [HASURA_OPTIONS,
|
|
2052
|
+
deps: [HASURA_OPTIONS, i3.ProductHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
|
|
1884
2053
|
},
|
|
1885
2054
|
{
|
|
1886
2055
|
provide: 'ProductRepository',
|
|
1887
|
-
useExisting:
|
|
2056
|
+
useExisting: i3.ProductHasuraGraphQLRepository,
|
|
1888
2057
|
},
|
|
1889
2058
|
{
|
|
1890
|
-
provide:
|
|
2059
|
+
provide: i3.ProductHasuraGraphQLRepository,
|
|
1891
2060
|
useFactory: function (options) {
|
|
1892
|
-
return new
|
|
2061
|
+
return new i3.ProductHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1893
2062
|
},
|
|
1894
2063
|
deps: [HASURA_OPTIONS],
|
|
1895
2064
|
},
|
|
1896
2065
|
{
|
|
1897
2066
|
provide: 'VariantRepository',
|
|
1898
|
-
useExisting:
|
|
2067
|
+
useExisting: i3.VariantHasuraGraphQLRepository,
|
|
1899
2068
|
},
|
|
1900
2069
|
{
|
|
1901
|
-
provide:
|
|
2070
|
+
provide: i3.VariantHasuraGraphQLRepository,
|
|
1902
2071
|
useFactory: function (options) {
|
|
1903
|
-
return new
|
|
2072
|
+
return new i3.VariantHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1904
2073
|
},
|
|
1905
2074
|
deps: [HASURA_OPTIONS],
|
|
1906
2075
|
},
|
|
1907
2076
|
{
|
|
1908
2077
|
provide: 'CategoryFilterRepository',
|
|
1909
|
-
useExisting:
|
|
2078
|
+
useExisting: i3.CategoryFilterHasuraGraphQLRepository,
|
|
1910
2079
|
},
|
|
1911
2080
|
{
|
|
1912
|
-
provide:
|
|
2081
|
+
provide: i3.CategoryFilterHasuraGraphQLRepository,
|
|
1913
2082
|
useFactory: function (options) {
|
|
1914
|
-
return new
|
|
2083
|
+
return new i3.CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1915
2084
|
},
|
|
1916
2085
|
deps: [HASURA_OPTIONS],
|
|
1917
2086
|
},
|
|
1918
2087
|
{
|
|
1919
2088
|
provide: 'FilterOptionRepository',
|
|
1920
|
-
useExisting:
|
|
2089
|
+
useExisting: i3.FilterOptionHasuraGraphQLRepository,
|
|
1921
2090
|
},
|
|
1922
2091
|
{
|
|
1923
|
-
provide:
|
|
2092
|
+
provide: i3.FilterOptionHasuraGraphQLRepository,
|
|
1924
2093
|
useFactory: function (options) {
|
|
1925
|
-
return new
|
|
2094
|
+
return new i3.FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1926
2095
|
},
|
|
1927
2096
|
deps: [HASURA_OPTIONS],
|
|
1928
2097
|
},
|
|
1929
2098
|
{
|
|
1930
2099
|
provide: 'FilterRepository',
|
|
1931
|
-
useExisting:
|
|
2100
|
+
useExisting: i3.FilterHasuraGraphQLRepository,
|
|
1932
2101
|
},
|
|
1933
2102
|
{
|
|
1934
|
-
provide:
|
|
2103
|
+
provide: i3.FilterHasuraGraphQLRepository,
|
|
1935
2104
|
useFactory: function (options, filterOptionRepository, categoryFilterRepository) {
|
|
1936
|
-
return new
|
|
2105
|
+
return new i3.FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository, categoryFilterRepository);
|
|
1937
2106
|
},
|
|
1938
|
-
deps: [HASURA_OPTIONS,
|
|
2107
|
+
deps: [HASURA_OPTIONS, i3.FilterOptionHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
|
|
1939
2108
|
},
|
|
1940
2109
|
],
|
|
1941
2110
|
}]
|
|
@@ -1947,7 +2116,7 @@
|
|
|
1947
2116
|
AngularConnectModule.initializeApp = function (defaultShop, options, nameOrConfig) {
|
|
1948
2117
|
return {
|
|
1949
2118
|
ngModule: AngularConnectModule,
|
|
1950
|
-
providers: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((
|
|
2119
|
+
providers: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((i3.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_OPTIONS, useValue: options === null || options === void 0 ? void 0 : options.firebase }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [{ provide: ES_CONFIG, useValue: options.elasticSearch }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [{ provide: HASURA_OPTIONS, useValue: options.hasura }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.backendUrl) ? [] : [{ provide: BACKEND_URL, useValue: options.backendUrl }]))),
|
|
1951
2120
|
};
|
|
1952
2121
|
};
|
|
1953
2122
|
return AngularConnectModule;
|