@infrab4a/connect-angular 3.5.3 → 3.6.0-beta.0
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/angular-connect.module.d.ts +0 -1
- package/bundles/infrab4a-connect-angular.umd.js +305 -420
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/consts/index.d.ts +0 -1
- package/esm2015/angular-connect.module.js +3 -6
- package/esm2015/angular-firestore.module.js +31 -3
- package/esm2015/angular-hasura-graphql.module.js +8 -74
- package/esm2015/consts/index.js +1 -2
- package/esm2015/services/coupon.service.js +41 -26
- package/esm2015/services/home-shop.service.js +22 -25
- package/esm2015/services/index.js +3 -4
- package/fesm2015/infrab4a-connect-angular.js +125 -245
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/package.json +2 -2
- package/services/index.d.ts +2 -3
- package/consts/backend-url.const.d.ts +0 -1
- package/esm2015/consts/backend-url.const.js +0 -2
- package/esm2015/services/shipping.service.js +0 -98
- package/esm2015/services/types/shipping-methods.type.js +0 -2
- package/services/shipping.service.d.ts +0 -19
- package/services/types/shipping-methods.type.d.ts +0 -12
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/fire/auth'), require('@infrab4a/connect'), require('js-cookie'), require('ts-custom-error'), require('@angular/fire/firestore'), require('@angular/
|
|
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/
|
|
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.
|
|
5
|
-
})(this, (function (exports, i0, rxjs, operators, i1,
|
|
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/fire')) :
|
|
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/fire'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a["connect-angular"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.ng.fire.auth, global["@infrab4a/connect"], global["js-cookie"], global["ts-custom-error"], global.ng.fire.firestore, global.ng.fire));
|
|
5
|
+
})(this, (function (exports, i0, rxjs, operators, i1, i2, cookie, tsCustomError, i1$1, 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,9 @@
|
|
|
26
26
|
|
|
27
27
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
28
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
29
|
-
var
|
|
29
|
+
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
30
30
|
var cookie__default = /*#__PURE__*/_interopDefaultLegacy(cookie);
|
|
31
|
-
var i1__namespace$
|
|
32
|
-
var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1$3);
|
|
31
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
33
32
|
|
|
34
33
|
/*! *****************************************************************************
|
|
35
34
|
Copyright (c) Microsoft Corporation.
|
|
@@ -390,8 +389,6 @@
|
|
|
390
389
|
}] }];
|
|
391
390
|
} });
|
|
392
391
|
|
|
393
|
-
var BACKEND_URL = 'BACKEND_URL';
|
|
394
|
-
|
|
395
392
|
var DEFAULT_SHOP = 'DEFAULT_SHOP';
|
|
396
393
|
|
|
397
394
|
var ES_CONFIG = 'ES_CONFIG';
|
|
@@ -430,7 +427,7 @@
|
|
|
430
427
|
this.separateValidCoupons = function (coupons, userEmail) { return coupons
|
|
431
428
|
.map(function (coupon) {
|
|
432
429
|
try {
|
|
433
|
-
if (!(coupon instanceof
|
|
430
|
+
if (!(coupon instanceof i2.Coupon))
|
|
434
431
|
throw new InvalidCouponError('Cupom inválido.');
|
|
435
432
|
if (_this.isValidCoupon(coupon, userEmail))
|
|
436
433
|
return coupon;
|
|
@@ -439,7 +436,7 @@
|
|
|
439
436
|
return error;
|
|
440
437
|
}
|
|
441
438
|
})
|
|
442
|
-
.reduce(function (current, coupon) { return (Object.assign(Object.assign({}, current), (coupon instanceof
|
|
439
|
+
.reduce(function (current, coupon) { return (Object.assign(Object.assign({}, current), (coupon instanceof i2.Coupon
|
|
443
440
|
? { valids: __spreadArray(__spreadArray([], __read(current.valids)), [coupon]) }
|
|
444
441
|
: { invalids: __spreadArray(__spreadArray([], __read(current.invalids)), [coupon]) }))); }, {
|
|
445
442
|
valids: [],
|
|
@@ -450,8 +447,8 @@
|
|
|
450
447
|
var _this = this;
|
|
451
448
|
return rxjs.from(this.couponRepository.find({
|
|
452
449
|
filters: {
|
|
453
|
-
nickname: { operator:
|
|
454
|
-
active: { operator:
|
|
450
|
+
nickname: { operator: i2.Where.EQUALS, value: nickname },
|
|
451
|
+
active: { operator: i2.Where.EQUALS, value: true },
|
|
455
452
|
},
|
|
456
453
|
})).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
454
|
};
|
|
@@ -463,17 +460,17 @@
|
|
|
463
460
|
// Get Primeiro Cupom (o find do repository retorna um array)
|
|
464
461
|
var coupon = coupons.data.shift();
|
|
465
462
|
// Verifica se o cupom é aplicavel na loja
|
|
466
|
-
var isInShop = coupon.shopAvailability ===
|
|
463
|
+
var isInShop = coupon.shopAvailability === i2.Shops.ALL || coupon.shopAvailability === this.defaultShop;
|
|
467
464
|
// Cupon não aplicavel a loja retorna erro
|
|
468
465
|
if (!isInShop)
|
|
469
466
|
return rxjs.throwError('Cupom inválido para loja.');
|
|
470
467
|
// Verifica se o coupon é aplicado no checkout que está sendo realizado
|
|
471
|
-
var isCheckoutType = coupon.checkoutType ===
|
|
468
|
+
var isCheckoutType = coupon.checkoutType === i2.CheckoutTypes.ALL || coupon.checkoutType === checkoutType;
|
|
472
469
|
// Cupon não aplicavel ao checkout retorna erro
|
|
473
470
|
if (!isCheckoutType)
|
|
474
471
|
return rxjs.throwError('Cupom inválido. Erro de checkout.');
|
|
475
472
|
// Verifica se o cupom é ou pode ser aplicado para subscription
|
|
476
|
-
if (checkoutType ===
|
|
473
|
+
if (checkoutType === i2.CheckoutTypes.ALL || checkoutType === i2.CheckoutTypes.SUBSCRIPTION) {
|
|
477
474
|
// Se o cupom tiver um plano associado, verifica se é o mesmo plano do checkout da assinatura
|
|
478
475
|
if (coupon.plan && coupon.plan.toUpperCase() !== plan.toUpperCase())
|
|
479
476
|
return rxjs.throwError('Cupom inválido para sua assinatura.');
|
|
@@ -516,11 +513,13 @@
|
|
|
516
513
|
// Verifica o limite de uso geral por usuario
|
|
517
514
|
if (coupon.useLimit && orders.data.length >= coupon.useLimit)
|
|
518
515
|
throw new InvalidCouponError('Limite de uso atingido.');
|
|
519
|
-
|
|
516
|
+
return [4 /*yield*/, this.userValidationAndSubscriptionStatus(coupon, userEmail)];
|
|
517
|
+
case 2:
|
|
518
|
+
validUser = _d.sent();
|
|
520
519
|
if (!validUser)
|
|
521
520
|
throw new InvalidCouponError('Usuário não elegível.');
|
|
522
521
|
return [4 /*yield*/, this.hasProductCategories(coupon, checkout)];
|
|
523
|
-
case
|
|
522
|
+
case 3:
|
|
524
523
|
hasProductCategories = _d.sent();
|
|
525
524
|
if (!hasProductCategories)
|
|
526
525
|
throw 'Seu carrinho não possui produtos elegíveis para desconto.';
|
|
@@ -532,9 +531,9 @@
|
|
|
532
531
|
CouponService.prototype.calcDiscountSubscription = function (coupon, checkout) {
|
|
533
532
|
//
|
|
534
533
|
var discount = 0;
|
|
535
|
-
if (coupon.type ===
|
|
534
|
+
if (coupon.type === i2.CouponTypes.ABSOLUTE)
|
|
536
535
|
discount = coupon.discount;
|
|
537
|
-
else if (coupon.type ===
|
|
536
|
+
else if (coupon.type === i2.CouponTypes.PERCENTAGE)
|
|
538
537
|
discount = checkout.subscriptionPlan.recurrencePrice * (coupon.discount / 100);
|
|
539
538
|
return rxjs.of(discount);
|
|
540
539
|
};
|
|
@@ -547,8 +546,8 @@
|
|
|
547
546
|
discount = 0;
|
|
548
547
|
_d = coupon.type;
|
|
549
548
|
switch (_d) {
|
|
550
|
-
case
|
|
551
|
-
case
|
|
549
|
+
case i2.CouponTypes.ABSOLUTE: return [3 /*break*/, 1];
|
|
550
|
+
case i2.CouponTypes.PERCENTAGE: return [3 /*break*/, 2];
|
|
552
551
|
}
|
|
553
552
|
return [3 /*break*/, 4];
|
|
554
553
|
case 1:
|
|
@@ -583,7 +582,7 @@
|
|
|
583
582
|
lineItensDiscount = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.filter(function (i) {
|
|
584
583
|
var _a;
|
|
585
584
|
if ((_a = i.categories) === null || _a === void 0 ? void 0 : _a.length) {
|
|
586
|
-
return i.categories.some(function (c) { return couponCategories.some(function (cat) { return cat.id == c || cat.firestoreId == c; }); });
|
|
585
|
+
return i.categories.some(function (c) { return couponCategories.some(function (cat) { return (cat.id == c || cat.firestoreId == c); }); });
|
|
587
586
|
}
|
|
588
587
|
return true;
|
|
589
588
|
});
|
|
@@ -635,31 +634,56 @@
|
|
|
635
634
|
var _a;
|
|
636
635
|
if (!i.categories || !((_a = i.categories) === null || _a === void 0 ? void 0 : _a.length))
|
|
637
636
|
return true;
|
|
638
|
-
return i.categories.some(function (c) { return couponCategories.some(function (cat) { return cat.id == c || cat.firestoreId == c; }); });
|
|
637
|
+
return i.categories.some(function (c) { return couponCategories.some(function (cat) { return (cat.id == c || cat.firestoreId == c); }); });
|
|
639
638
|
});
|
|
640
639
|
return [2 /*return*/, hasCategories.length ? true : false];
|
|
641
640
|
}
|
|
642
641
|
});
|
|
643
642
|
});
|
|
644
643
|
};
|
|
645
|
-
CouponService.prototype.userValidationAndSubscriptionStatus = function (coupon,
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
644
|
+
CouponService.prototype.userValidationAndSubscriptionStatus = function (coupon, userEmail) {
|
|
645
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
646
|
+
var couponRuleSubscription, sub, activeSubs;
|
|
647
|
+
return __generator(this, function (_d) {
|
|
648
|
+
switch (_d.label) {
|
|
649
|
+
case 0:
|
|
650
|
+
// Verifica se o email do usuário é coorporativo
|
|
651
|
+
if (!this.emailIsFromCollaborator(userEmail) && coupon.exclusivityType === i2.Exclusivities.COLLABORATORS)
|
|
652
|
+
throw new InvalidCouponError('Você não é colaborador.');
|
|
653
|
+
// Verifica se o email do usuário é associado ao cupom de uso por usuario
|
|
654
|
+
if (coupon.exclusivityType === i2.Exclusivities.SPECIFIC_USER && coupon.userExclusiveEmail !== userEmail)
|
|
655
|
+
throw new InvalidCouponError('Cupom não é válido para este usuário.');
|
|
656
|
+
couponRuleSubscription = coupon.exclusivityType === i2.Exclusivities.ACTIVE_SUBSCRIBER ||
|
|
657
|
+
coupon.exclusivityType === i2.Exclusivities.INACTIVE_SUBSCRIBER ||
|
|
658
|
+
coupon.exclusivityType === i2.Exclusivities.NON_SUBSCRIBER;
|
|
659
|
+
if (!(couponRuleSubscription && userEmail)) return [3 /*break*/, 2];
|
|
660
|
+
return [4 /*yield*/, this.subscriptionRepository
|
|
661
|
+
.find({
|
|
662
|
+
filters: {
|
|
663
|
+
user: {
|
|
664
|
+
email: { operator: i2.Where.EQUALS, value: userEmail },
|
|
665
|
+
},
|
|
666
|
+
},
|
|
667
|
+
})
|
|
668
|
+
.then(function (sub) { return sub.data; })];
|
|
669
|
+
case 1:
|
|
670
|
+
sub = _d.sent();
|
|
671
|
+
activeSubs = sub === null || sub === void 0 ? void 0 : sub.filter(function (s) { return s.status === i2.Status.ACTIVE; });
|
|
672
|
+
switch (coupon.exclusivityType) {
|
|
673
|
+
case i2.Exclusivities.ACTIVE_SUBSCRIBER:
|
|
674
|
+
return [2 /*return*/, activeSubs.length > 0];
|
|
675
|
+
case i2.Exclusivities.INACTIVE_SUBSCRIBER:
|
|
676
|
+
return [2 /*return*/, activeSubs.length === 0];
|
|
677
|
+
case i2.Exclusivities.NON_SUBSCRIBER:
|
|
678
|
+
return [2 /*return*/, sub.length === 0];
|
|
679
|
+
default:
|
|
680
|
+
return [2 /*return*/, false];
|
|
681
|
+
}
|
|
682
|
+
_d.label = 2;
|
|
683
|
+
case 2: return [2 /*return*/, true];
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
});
|
|
663
687
|
};
|
|
664
688
|
CouponService.prototype.getCouponCategoriesId = function (coupon) {
|
|
665
689
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -672,9 +696,7 @@
|
|
|
672
696
|
_d.label = 1;
|
|
673
697
|
case 1:
|
|
674
698
|
if (!(index < coupon.productsCategories.length)) return [3 /*break*/, 4];
|
|
675
|
-
return [4 /*yield*/, this.categoryRepository.get({
|
|
676
|
-
id: coupon.productsCategories[index],
|
|
677
|
-
})];
|
|
699
|
+
return [4 /*yield*/, this.categoryRepository.get({ id: coupon.productsCategories[index] })];
|
|
678
700
|
case 2:
|
|
679
701
|
c = _d.sent();
|
|
680
702
|
couponCategories.push({ id: c.id, firestoreId: c.firestoreId });
|
|
@@ -700,7 +722,7 @@
|
|
|
700
722
|
return [{ type: undefined, decorators: [{
|
|
701
723
|
type: i0.Inject,
|
|
702
724
|
args: ['CouponRepository']
|
|
703
|
-
}] }, { type:
|
|
725
|
+
}] }, { type: i2__namespace.Shops, decorators: [{
|
|
704
726
|
type: i0.Inject,
|
|
705
727
|
args: [DEFAULT_SHOP]
|
|
706
728
|
}] }, { type: undefined, decorators: [{
|
|
@@ -725,19 +747,19 @@
|
|
|
725
747
|
}
|
|
726
748
|
CheckoutService.prototype.getCheckout = function (checkoutData) {
|
|
727
749
|
var checkoutId = cookie__default["default"].get('checkoutId');
|
|
728
|
-
if (!
|
|
750
|
+
if (!i2.isNil(checkoutId))
|
|
729
751
|
return rxjs.from(this.checkoutRepository.get({ id: checkoutId }));
|
|
730
752
|
return rxjs.from(this.createCheckout(checkoutData));
|
|
731
753
|
};
|
|
732
754
|
CheckoutService.prototype.getUserByCheckout = function (checkoutId) {
|
|
733
755
|
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
|
|
756
|
+
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 i2.NotFoundError('User is not found'); }); }));
|
|
735
757
|
};
|
|
736
758
|
CheckoutService.prototype.updateCheckoutLineItems = function (checkout) {
|
|
737
|
-
return rxjs.from(this.checkoutRepository.update(
|
|
759
|
+
return rxjs.from(this.checkoutRepository.update(i2.Checkout.toInstance({ id: checkout.id, lineItems: checkout.lineItems })));
|
|
738
760
|
};
|
|
739
761
|
CheckoutService.prototype.updateCheckoutUser = function (checkout) {
|
|
740
|
-
return rxjs.from(this.checkoutRepository.update(
|
|
762
|
+
return rxjs.from(this.checkoutRepository.update(i2.Checkout.toInstance({ id: checkout.id, user: checkout.user })));
|
|
741
763
|
};
|
|
742
764
|
CheckoutService.prototype.clearCheckoutFromSession = function () {
|
|
743
765
|
cookie__default["default"].remove('checkoutId');
|
|
@@ -757,7 +779,7 @@
|
|
|
757
779
|
return this.getCheckout().pipe(operators.concatMap(function (checkout) {
|
|
758
780
|
var _a;
|
|
759
781
|
return _this.couponService
|
|
760
|
-
.checkCoupon(nickname, (_a = checkout.user) === null || _a === void 0 ? void 0 : _a.email,
|
|
782
|
+
.checkCoupon(nickname, (_a = checkout.user) === null || _a === void 0 ? void 0 : _a.email, i2.CheckoutTypes.ECOMMERCE, checkout.user.subscriptionPlan, checkout, false)
|
|
761
783
|
.pipe();
|
|
762
784
|
}));
|
|
763
785
|
};
|
|
@@ -766,7 +788,7 @@
|
|
|
766
788
|
var checkout;
|
|
767
789
|
return __generator(this, function (_b) {
|
|
768
790
|
switch (_b.label) {
|
|
769
|
-
case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() },
|
|
791
|
+
case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() }, i2.Checkout.toInstance(i2.pick(checkoutData, ['user', 'shop'])).toPlain()), { shop: (checkoutData === null || checkoutData === void 0 ? void 0 : checkoutData.shop) || this.defaultShop }))];
|
|
770
792
|
case 1:
|
|
771
793
|
checkout = _b.sent();
|
|
772
794
|
cookie__default["default"].set('checkoutId', checkout.id);
|
|
@@ -791,7 +813,7 @@
|
|
|
791
813
|
}] }, { type: undefined, decorators: [{
|
|
792
814
|
type: i0.Inject,
|
|
793
815
|
args: ['UserRepository']
|
|
794
|
-
}] }, { type:
|
|
816
|
+
}] }, { type: i2__namespace.Shops, decorators: [{
|
|
795
817
|
type: i0.Inject,
|
|
796
818
|
args: [DEFAULT_SHOP]
|
|
797
819
|
}] }];
|
|
@@ -805,7 +827,7 @@
|
|
|
805
827
|
this.defaultShop = defaultShop;
|
|
806
828
|
this.productRepository = productRepository;
|
|
807
829
|
this.cartSubject = new rxjs.Subject();
|
|
808
|
-
this.updateLineItemInCart = function (lineItem, quantity, checkout) { return (
|
|
830
|
+
this.updateLineItemInCart = function (lineItem, quantity, checkout) { return (i2.isNil(checkout) ? _this.checkoutService.getCheckout() : rxjs.of(checkout)).pipe(operators.concatMap(function (checkoutLoaded) {
|
|
809
831
|
var _a;
|
|
810
832
|
var items = [];
|
|
811
833
|
var index = (_a = checkoutLoaded.lineItems) === null || _a === void 0 ? void 0 : _a.map(function (checkoutItem) { return checkoutItem.sku; }).indexOf(lineItem.sku);
|
|
@@ -823,7 +845,7 @@
|
|
|
823
845
|
var cart = {};
|
|
824
846
|
items === null || items === void 0 ? void 0 : items.forEach(function (item) {
|
|
825
847
|
var _a;
|
|
826
|
-
return (cart[item.sku] =
|
|
848
|
+
return (cart[item.sku] = i2.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
849
|
});
|
|
828
850
|
return cart;
|
|
829
851
|
};
|
|
@@ -849,7 +871,7 @@
|
|
|
849
871
|
});
|
|
850
872
|
return [2 /*return*/, {
|
|
851
873
|
checkout: checkout,
|
|
852
|
-
lineItem:
|
|
874
|
+
lineItem: i2.LineItem.toInstance({
|
|
853
875
|
id: id,
|
|
854
876
|
name: name !== null && name !== void 0 ? name : product.name,
|
|
855
877
|
EAN: EAN !== null && EAN !== void 0 ? EAN : product.EAN,
|
|
@@ -904,7 +926,7 @@
|
|
|
904
926
|
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
905
927
|
var _a;
|
|
906
928
|
var checkoutItem = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.sku === item.sku; });
|
|
907
|
-
if (!
|
|
929
|
+
if (!i2.isNil(checkoutItem))
|
|
908
930
|
checkoutItem.quantity -= checkoutItem.quantity > 1 ? 1 : 0;
|
|
909
931
|
return checkout;
|
|
910
932
|
}), 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); }));
|
|
@@ -931,14 +953,14 @@
|
|
|
931
953
|
};
|
|
932
954
|
CartService.prototype.updateUserCart = function (user) {
|
|
933
955
|
var _this = this;
|
|
934
|
-
return this.checkoutService.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(
|
|
956
|
+
return this.checkoutService.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(i2.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { user: user }))); }), operators.concatMap(function (checkout) { return __awaiter(_this, void 0, void 0, function () {
|
|
935
957
|
var _a, _b, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
936
958
|
var _this = this;
|
|
937
959
|
return __generator(this, function (_s) {
|
|
938
960
|
switch (_s.label) {
|
|
939
961
|
case 0:
|
|
940
962
|
_j = (_h = this.checkoutService).updateCheckoutLineItems;
|
|
941
|
-
_l = (_k =
|
|
963
|
+
_l = (_k = i2.Checkout).toInstance;
|
|
942
964
|
_o = (_m = Object).assign;
|
|
943
965
|
_p = [Object.assign({}, checkout.toPlain())];
|
|
944
966
|
_q = {};
|
|
@@ -978,7 +1000,7 @@
|
|
|
978
1000
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, decorators: [{
|
|
979
1001
|
type: i0.Injectable
|
|
980
1002
|
}], ctorParameters: function () {
|
|
981
|
-
return [{ type: AuthService }, { type: CheckoutService }, { type:
|
|
1003
|
+
return [{ type: AuthService }, { type: CheckoutService }, { type: i2__namespace.Shops, decorators: [{
|
|
982
1004
|
type: i0.Inject,
|
|
983
1005
|
args: [DEFAULT_SHOP]
|
|
984
1006
|
}] }, { type: undefined, decorators: [{
|
|
@@ -995,7 +1017,7 @@
|
|
|
995
1017
|
}
|
|
996
1018
|
CheckoutSubscriptionService.prototype.getCheckoutSubscription = function (checkoutData) {
|
|
997
1019
|
var checkoutId = cookie__default["default"].get('checkoutSubscriptionId');
|
|
998
|
-
if (!
|
|
1020
|
+
if (!i2.isNil(checkoutId))
|
|
999
1021
|
return rxjs.from(this.checkoutSubscriptionRepository.get({ id: checkoutId }));
|
|
1000
1022
|
return rxjs.from(this.createCheckoutSubscription(checkoutData));
|
|
1001
1023
|
};
|
|
@@ -1004,7 +1026,7 @@
|
|
|
1004
1026
|
var checkout;
|
|
1005
1027
|
return __generator(this, function (_a) {
|
|
1006
1028
|
switch (_a.label) {
|
|
1007
|
-
case 0: return [4 /*yield*/, this.checkoutSubscriptionRepository.create(Object.assign({ createdAt: new Date() },
|
|
1029
|
+
case 0: return [4 /*yield*/, this.checkoutSubscriptionRepository.create(Object.assign({ createdAt: new Date() }, i2.CheckoutSubscription.toInstance(i2.pick(checkoutData, ['user', 'shop'])).toPlain()))];
|
|
1008
1030
|
case 1:
|
|
1009
1031
|
checkout = _a.sent();
|
|
1010
1032
|
cookie__default["default"].set('checkoutSubscriptionId', checkout.id);
|
|
@@ -1019,7 +1041,7 @@
|
|
|
1019
1041
|
};
|
|
1020
1042
|
CheckoutSubscriptionService.prototype.checkCoupon = function (nickname, userEmail) {
|
|
1021
1043
|
var _this = this;
|
|
1022
|
-
return this.getCheckoutSubscription().pipe(operators.concatMap(function (checkout) { return _this.couponService.checkCoupon(nickname, userEmail,
|
|
1044
|
+
return this.getCheckoutSubscription().pipe(operators.concatMap(function (checkout) { return _this.couponService.checkCoupon(nickname, userEmail, i2.CheckoutTypes.SUBSCRIPTION, checkout.subscriptionPlan.name, null, true).pipe(); }));
|
|
1023
1045
|
};
|
|
1024
1046
|
CheckoutSubscriptionService.prototype.calcDiscountSubscription = function (coupon) {
|
|
1025
1047
|
var _this = this;
|
|
@@ -1041,40 +1063,65 @@
|
|
|
1041
1063
|
}] }, { type: CouponService }];
|
|
1042
1064
|
} });
|
|
1043
1065
|
|
|
1066
|
+
var OrderService = /** @class */ (function () {
|
|
1067
|
+
function OrderService(angularFirestore, orderRepository) {
|
|
1068
|
+
this.angularFirestore = angularFirestore;
|
|
1069
|
+
this.orderRepository = orderRepository;
|
|
1070
|
+
this.orderSubject = new rxjs.Subject();
|
|
1071
|
+
}
|
|
1072
|
+
OrderService.prototype.getOrder = function (id) {
|
|
1073
|
+
var _this = this;
|
|
1074
|
+
this.angularFirestore
|
|
1075
|
+
.doc(this.orderRepository.collectionName + "/" + id)
|
|
1076
|
+
.valueChanges()
|
|
1077
|
+
.pipe(operators.map(function (doc) { return i2.Order.toInstance(doc); }))
|
|
1078
|
+
.subscribe(function (doc) { return _this.orderSubject.next(doc); });
|
|
1079
|
+
return this.orderSubject;
|
|
1080
|
+
};
|
|
1081
|
+
return OrderService;
|
|
1082
|
+
}());
|
|
1083
|
+
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 });
|
|
1084
|
+
OrderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService });
|
|
1085
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, decorators: [{
|
|
1086
|
+
type: i0.Injectable
|
|
1087
|
+
}], ctorParameters: function () {
|
|
1088
|
+
return [{ type: i1__namespace$1.AngularFirestore }, { type: i2__namespace.OrderFirestoreRepository, decorators: [{
|
|
1089
|
+
type: i0.Inject,
|
|
1090
|
+
args: ['OrderRepository']
|
|
1091
|
+
}] }];
|
|
1092
|
+
} });
|
|
1093
|
+
|
|
1044
1094
|
var HomeShopService = /** @class */ (function () {
|
|
1045
1095
|
function HomeShopService(categoryRepository, homeRepository, productRepository, defaultShop) {
|
|
1046
1096
|
this.categoryRepository = categoryRepository;
|
|
1047
1097
|
this.homeRepository = homeRepository;
|
|
1048
1098
|
this.productRepository = productRepository;
|
|
1049
1099
|
this.defaultShop = defaultShop;
|
|
1050
|
-
this.buildCategoryGroupWithRequiredData = function (group) {
|
|
1051
|
-
|
|
1052
|
-
return (
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
])); })) || [],
|
|
1070
|
-
});
|
|
1071
|
-
};
|
|
1100
|
+
this.buildCategoryGroupWithRequiredData = function (group) { return ({
|
|
1101
|
+
category: i2.Category.toInstance(i2.pick(group.category.toPlain(), ['id', 'name', 'slug', 'conditions'])),
|
|
1102
|
+
products: group.products.map(function (product) { return i2.Product.toInstance(i2.pick(product.toPlain(), [
|
|
1103
|
+
'id',
|
|
1104
|
+
'price',
|
|
1105
|
+
'reviews',
|
|
1106
|
+
'hasVariants',
|
|
1107
|
+
'slug',
|
|
1108
|
+
'sku',
|
|
1109
|
+
'stock',
|
|
1110
|
+
'costPrice',
|
|
1111
|
+
'images',
|
|
1112
|
+
'miniatures',
|
|
1113
|
+
'name',
|
|
1114
|
+
'weight',
|
|
1115
|
+
'rate',
|
|
1116
|
+
'type'
|
|
1117
|
+
])); }),
|
|
1118
|
+
}); };
|
|
1072
1119
|
}
|
|
1073
1120
|
Object.defineProperty(HomeShopService.prototype, "homeId", {
|
|
1074
1121
|
get: function () {
|
|
1075
|
-
if (this.defaultShop ===
|
|
1122
|
+
if (this.defaultShop === i2.Shops.GLAMSHOP)
|
|
1076
1123
|
return 'glamshop';
|
|
1077
|
-
if (this.defaultShop ===
|
|
1124
|
+
if (this.defaultShop === i2.Shops.MENSMARKET)
|
|
1078
1125
|
return 'mens_market';
|
|
1079
1126
|
return null;
|
|
1080
1127
|
},
|
|
@@ -1085,8 +1132,8 @@
|
|
|
1085
1132
|
var _this = this;
|
|
1086
1133
|
return this.getHomeConfiguration().pipe(operators.map(function (home) { var _a; return (((_a = home === null || home === void 0 ? void 0 : home.data) === null || _a === void 0 ? void 0 : _a.expiresAt) > new Date() ? home : null); }), operators.concatMap(function (home) { return home
|
|
1087
1134
|
? rxjs.of(home)
|
|
1088
|
-
: rxjs.forkJoin([_this.getDiscoverProducts(), _this.getFeaturedProducts(), _this.getVerticalProducts()]).pipe(operators.map(function (
|
|
1089
|
-
var
|
|
1135
|
+
: rxjs.forkJoin([_this.getDiscoverProducts(), _this.getFeaturedProducts(), _this.getVerticalProducts()]).pipe(operators.map(function (_b) {
|
|
1136
|
+
var _c = __read(_b, 3), discoverProducts = _c[0], featuredProducts = _c[1], verticalProducts = _c[2];
|
|
1090
1137
|
return ({
|
|
1091
1138
|
discoverProducts: discoverProducts,
|
|
1092
1139
|
featuredProducts: featuredProducts,
|
|
@@ -1120,10 +1167,10 @@
|
|
|
1120
1167
|
HomeShopService.prototype.getVerticalProducts = function () {
|
|
1121
1168
|
var _this = this;
|
|
1122
1169
|
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:
|
|
1170
|
+
filters: { categories: { operator: i2.Where.IN, value: [category.id] } },
|
|
1124
1171
|
limits: { limit: 12 },
|
|
1125
|
-
})).pipe(operators.map(function (products) { return ({ category: category, products: products }); })); }), operators.map(function (
|
|
1126
|
-
var category =
|
|
1172
|
+
})).pipe(operators.map(function (products) { return ({ category: category, products: products }); })); }), operators.map(function (_b) {
|
|
1173
|
+
var category = _b.category, products = _b.products;
|
|
1127
1174
|
return ({ category: category, products: products.data });
|
|
1128
1175
|
}), operators.map(_this.buildCategoryGroupWithRequiredData)); })); }));
|
|
1129
1176
|
};
|
|
@@ -1132,14 +1179,14 @@
|
|
|
1132
1179
|
return rxjs.of(this.homeConfiguration).pipe(operators.concatMap(function (home) { return home
|
|
1133
1180
|
? rxjs.of(home)
|
|
1134
1181
|
: !_this.homeId
|
|
1135
|
-
? rxjs.throwError(new
|
|
1182
|
+
? rxjs.throwError(new i2.RequiredArgumentError(['homeId']))
|
|
1136
1183
|
: rxjs.from(_this.homeRepository.get({ id: _this.homeId })).pipe(operators.tap(function (homeLoaded) { return (_this.homeConfiguration = homeLoaded); })); }));
|
|
1137
1184
|
};
|
|
1138
1185
|
HomeShopService.prototype.saveHomeData = function (homeData) {
|
|
1139
1186
|
var _this = this;
|
|
1140
1187
|
var data = {
|
|
1141
1188
|
createdAt: new Date(),
|
|
1142
|
-
expiresAt:
|
|
1189
|
+
expiresAt: i2.add(new Date(), { hours: 1 }),
|
|
1143
1190
|
data: homeData,
|
|
1144
1191
|
};
|
|
1145
1192
|
return rxjs.from(this.homeRepository.update({
|
|
@@ -1163,133 +1210,12 @@
|
|
|
1163
1210
|
}] }, { type: undefined, decorators: [{
|
|
1164
1211
|
type: i0.Inject,
|
|
1165
1212
|
args: ['ProductRepository']
|
|
1166
|
-
}] }, { type:
|
|
1213
|
+
}] }, { type: i2__namespace.Shops, decorators: [{
|
|
1167
1214
|
type: i0.Inject,
|
|
1168
1215
|
args: [DEFAULT_SHOP]
|
|
1169
1216
|
}] }];
|
|
1170
1217
|
} });
|
|
1171
1218
|
|
|
1172
|
-
var OrderService = /** @class */ (function () {
|
|
1173
|
-
function OrderService(angularFirestore, orderRepository) {
|
|
1174
|
-
this.angularFirestore = angularFirestore;
|
|
1175
|
-
this.orderRepository = orderRepository;
|
|
1176
|
-
this.orderSubject = new rxjs.Subject();
|
|
1177
|
-
}
|
|
1178
|
-
OrderService.prototype.getOrder = function (id) {
|
|
1179
|
-
var _this = this;
|
|
1180
|
-
this.angularFirestore
|
|
1181
|
-
.doc(this.orderRepository.collectionName + "/" + id)
|
|
1182
|
-
.valueChanges()
|
|
1183
|
-
.pipe(operators.map(function (doc) { return i1$1.Order.toInstance(doc); }))
|
|
1184
|
-
.subscribe(function (doc) { return _this.orderSubject.next(doc); });
|
|
1185
|
-
return this.orderSubject;
|
|
1186
|
-
};
|
|
1187
|
-
return OrderService;
|
|
1188
|
-
}());
|
|
1189
|
-
OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, deps: [{ token: i1__namespace$2.AngularFirestore }, { token: 'OrderRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1190
|
-
OrderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService });
|
|
1191
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, decorators: [{
|
|
1192
|
-
type: i0.Injectable
|
|
1193
|
-
}], ctorParameters: function () {
|
|
1194
|
-
return [{ type: i1__namespace$2.AngularFirestore }, { type: i1__namespace$1.OrderFirestoreRepository, decorators: [{
|
|
1195
|
-
type: i0.Inject,
|
|
1196
|
-
args: ['OrderRepository']
|
|
1197
|
-
}] }];
|
|
1198
|
-
} });
|
|
1199
|
-
|
|
1200
|
-
var ShippingService = /** @class */ (function () {
|
|
1201
|
-
function ShippingService(http, apiUrl, homeService) {
|
|
1202
|
-
this.http = http;
|
|
1203
|
-
this.apiUrl = apiUrl;
|
|
1204
|
-
this.homeService = homeService;
|
|
1205
|
-
}
|
|
1206
|
-
ShippingService.prototype.getShippingMethods = function (shop, zip, weightGrams, totalPrice, personId, subscriptionPlan) {
|
|
1207
|
-
var _this = this;
|
|
1208
|
-
return rxjs.combineLatest([
|
|
1209
|
-
this.homeService.getHomeData(),
|
|
1210
|
-
this.http.get(this.apiUrl + "open/checkshippingcompany?personId=" + personId + "&postalCode=" + zip + "&weightGrams=" + weightGrams),
|
|
1211
|
-
]).pipe(operators.map(function (_a) {
|
|
1212
|
-
var _b = __read(_a, 2), datas = _b[0], shippingMethodsResponse = _b[1];
|
|
1213
|
-
var shippingMethods = shippingMethodsResponse.result;
|
|
1214
|
-
if (!shippingMethods.length)
|
|
1215
|
-
return [];
|
|
1216
|
-
shippingMethods = shippingMethods.map(function (s) {
|
|
1217
|
-
if (s.ShippingCompanyName == 'Same Day EG')
|
|
1218
|
-
s.ShippingCompanyName = 'Same Day';
|
|
1219
|
-
else
|
|
1220
|
-
return s;
|
|
1221
|
-
});
|
|
1222
|
-
var datasSameDayNotAvaliable = datas.sameDayNotAvaliable;
|
|
1223
|
-
if (_this.isHolidays(datasSameDayNotAvaliable)) {
|
|
1224
|
-
shippingMethods = shippingMethods.filter(function (method) { return method.ShippingCompanyName !== 'Same Day'; });
|
|
1225
|
-
}
|
|
1226
|
-
if (totalPrice >= 200) {
|
|
1227
|
-
shippingMethods = shippingMethods.map(function (s) {
|
|
1228
|
-
if (s.serviceName !== 'Same Day')
|
|
1229
|
-
return Object.assign(Object.assign({}, s), { totalPrice: 0 });
|
|
1230
|
-
else
|
|
1231
|
-
return s;
|
|
1232
|
-
});
|
|
1233
|
-
}
|
|
1234
|
-
if (shop == i1$1.Shops.GLAMSHOP)
|
|
1235
|
-
return shippingMethods;
|
|
1236
|
-
if (_this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
|
|
1237
|
-
shippingMethods = shippingMethods.map(function (s) {
|
|
1238
|
-
if (s.serviceName == 'Same Day')
|
|
1239
|
-
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
1240
|
-
else
|
|
1241
|
-
return Object.assign(Object.assign({}, s), { totalPrice: 0 });
|
|
1242
|
-
});
|
|
1243
|
-
}
|
|
1244
|
-
if (_this.isHalfShippingBySubscription(shop, subscriptionPlan)) {
|
|
1245
|
-
shippingMethods = shippingMethods.map(function (s) {
|
|
1246
|
-
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
1247
|
-
});
|
|
1248
|
-
}
|
|
1249
|
-
return shippingMethods;
|
|
1250
|
-
}));
|
|
1251
|
-
};
|
|
1252
|
-
ShippingService.prototype.isFreeShippingBySubscription = function (shop, subscriptionPlan) {
|
|
1253
|
-
if (!subscriptionPlan)
|
|
1254
|
-
return false;
|
|
1255
|
-
if (shop == i1$1.Shops.MENSMARKET && subscriptionPlan == 'SELECT') {
|
|
1256
|
-
return true;
|
|
1257
|
-
}
|
|
1258
|
-
return false;
|
|
1259
|
-
};
|
|
1260
|
-
ShippingService.prototype.isHalfShippingBySubscription = function (shop, subscriptionPlan) {
|
|
1261
|
-
if (!subscriptionPlan)
|
|
1262
|
-
return false;
|
|
1263
|
-
if (shop == i1$1.Shops.MENSMARKET && subscriptionPlan == 'PRIME') {
|
|
1264
|
-
return true;
|
|
1265
|
-
}
|
|
1266
|
-
return false;
|
|
1267
|
-
};
|
|
1268
|
-
ShippingService.prototype.isHolidays = function (datas) {
|
|
1269
|
-
var today = new Date();
|
|
1270
|
-
for (var key in datas) {
|
|
1271
|
-
var start = new Date(today.getFullYear() + "-" + datas[key].beginDate);
|
|
1272
|
-
var end = new Date(today.getFullYear() + "-" + datas[key].endDate);
|
|
1273
|
-
if (start > end)
|
|
1274
|
-
end = new Date(today.getFullYear() + 1 + "-" + datas[key].endDate);
|
|
1275
|
-
if (today >= start && today <= end)
|
|
1276
|
-
return true;
|
|
1277
|
-
}
|
|
1278
|
-
return false;
|
|
1279
|
-
};
|
|
1280
|
-
return ShippingService;
|
|
1281
|
-
}());
|
|
1282
|
-
ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$3.HttpClient }, { token: BACKEND_URL }, { token: HomeShopService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1283
|
-
ShippingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService });
|
|
1284
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, decorators: [{
|
|
1285
|
-
type: i0.Injectable
|
|
1286
|
-
}], ctorParameters: function () {
|
|
1287
|
-
return [{ type: i1__namespace$3.HttpClient }, { type: undefined, decorators: [{
|
|
1288
|
-
type: i0.Inject,
|
|
1289
|
-
args: [BACKEND_URL]
|
|
1290
|
-
}] }, { type: HomeShopService }];
|
|
1291
|
-
} });
|
|
1292
|
-
|
|
1293
1219
|
var AngularFirebaseAuthModule = /** @class */ (function () {
|
|
1294
1220
|
function AngularFirebaseAuthModule() {
|
|
1295
1221
|
}
|
|
@@ -1310,42 +1236,42 @@
|
|
|
1310
1236
|
{
|
|
1311
1237
|
provide: 'Authentication',
|
|
1312
1238
|
useFactory: function (authenticationService, userRepository) {
|
|
1313
|
-
return new
|
|
1239
|
+
return new i2.Authentication(authenticationService, userRepository);
|
|
1314
1240
|
},
|
|
1315
1241
|
deps: ['AuthenticationService', 'UserRepository'],
|
|
1316
1242
|
},
|
|
1317
1243
|
{
|
|
1318
1244
|
provide: 'AuthenticationService',
|
|
1319
1245
|
useFactory: function (angularFireAuth) {
|
|
1320
|
-
return new
|
|
1246
|
+
return new i2.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
1321
1247
|
},
|
|
1322
1248
|
deps: [i1.AngularFireAuth],
|
|
1323
1249
|
},
|
|
1324
1250
|
{
|
|
1325
1251
|
provide: 'Register',
|
|
1326
1252
|
useFactory: function (registerService, userRepository) {
|
|
1327
|
-
return new
|
|
1253
|
+
return new i2.Register(registerService, userRepository);
|
|
1328
1254
|
},
|
|
1329
1255
|
deps: ['RegisterService', 'UserRepository'],
|
|
1330
1256
|
},
|
|
1331
1257
|
{
|
|
1332
1258
|
provide: 'RegisterService',
|
|
1333
1259
|
useFactory: function (angularFireAuth) {
|
|
1334
|
-
return new
|
|
1260
|
+
return new i2.RegisterFirebaseAuthService(angularFireAuth);
|
|
1335
1261
|
},
|
|
1336
1262
|
deps: [i1.AngularFireAuth],
|
|
1337
1263
|
},
|
|
1338
1264
|
{
|
|
1339
1265
|
provide: 'SignOut',
|
|
1340
1266
|
useFactory: function (authenticationService) {
|
|
1341
|
-
return new
|
|
1267
|
+
return new i2.SignOut(authenticationService);
|
|
1342
1268
|
},
|
|
1343
1269
|
deps: ['AuthenticationService'],
|
|
1344
1270
|
},
|
|
1345
1271
|
{
|
|
1346
1272
|
provide: 'RecoveryPassword',
|
|
1347
1273
|
useFactory: function (authenticationService) {
|
|
1348
|
-
return new
|
|
1274
|
+
return new i2.RecoveryPassword(authenticationService);
|
|
1349
1275
|
},
|
|
1350
1276
|
deps: ['AuthenticationService'],
|
|
1351
1277
|
},
|
|
@@ -1358,42 +1284,42 @@
|
|
|
1358
1284
|
{
|
|
1359
1285
|
provide: 'Authentication',
|
|
1360
1286
|
useFactory: function (authenticationService, userRepository) {
|
|
1361
|
-
return new
|
|
1287
|
+
return new i2.Authentication(authenticationService, userRepository);
|
|
1362
1288
|
},
|
|
1363
1289
|
deps: ['AuthenticationService', 'UserRepository'],
|
|
1364
1290
|
},
|
|
1365
1291
|
{
|
|
1366
1292
|
provide: 'AuthenticationService',
|
|
1367
1293
|
useFactory: function (angularFireAuth) {
|
|
1368
|
-
return new
|
|
1294
|
+
return new i2.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
1369
1295
|
},
|
|
1370
1296
|
deps: [i1.AngularFireAuth],
|
|
1371
1297
|
},
|
|
1372
1298
|
{
|
|
1373
1299
|
provide: 'Register',
|
|
1374
1300
|
useFactory: function (registerService, userRepository) {
|
|
1375
|
-
return new
|
|
1301
|
+
return new i2.Register(registerService, userRepository);
|
|
1376
1302
|
},
|
|
1377
1303
|
deps: ['RegisterService', 'UserRepository'],
|
|
1378
1304
|
},
|
|
1379
1305
|
{
|
|
1380
1306
|
provide: 'RegisterService',
|
|
1381
1307
|
useFactory: function (angularFireAuth) {
|
|
1382
|
-
return new
|
|
1308
|
+
return new i2.RegisterFirebaseAuthService(angularFireAuth);
|
|
1383
1309
|
},
|
|
1384
1310
|
deps: [i1.AngularFireAuth],
|
|
1385
1311
|
},
|
|
1386
1312
|
{
|
|
1387
1313
|
provide: 'SignOut',
|
|
1388
1314
|
useFactory: function (authenticationService) {
|
|
1389
|
-
return new
|
|
1315
|
+
return new i2.SignOut(authenticationService);
|
|
1390
1316
|
},
|
|
1391
1317
|
deps: ['AuthenticationService'],
|
|
1392
1318
|
},
|
|
1393
1319
|
{
|
|
1394
1320
|
provide: 'RecoveryPassword',
|
|
1395
1321
|
useFactory: function (authenticationService) {
|
|
1396
|
-
return new
|
|
1322
|
+
return new i2.RecoveryPassword(authenticationService);
|
|
1397
1323
|
},
|
|
1398
1324
|
deps: ['AuthenticationService'],
|
|
1399
1325
|
},
|
|
@@ -1416,9 +1342,9 @@
|
|
|
1416
1342
|
AngularElasticSeachModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule });
|
|
1417
1343
|
AngularElasticSeachModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, providers: [
|
|
1418
1344
|
{
|
|
1419
|
-
provide:
|
|
1345
|
+
provide: i2.ProductsIndex,
|
|
1420
1346
|
useFactory: function (configuration) {
|
|
1421
|
-
return new
|
|
1347
|
+
return new i2.ProductsIndex(new i2.AxiosAdapter(configuration));
|
|
1422
1348
|
},
|
|
1423
1349
|
deps: [ES_CONFIG],
|
|
1424
1350
|
},
|
|
@@ -1428,9 +1354,9 @@
|
|
|
1428
1354
|
args: [{
|
|
1429
1355
|
providers: [
|
|
1430
1356
|
{
|
|
1431
|
-
provide:
|
|
1357
|
+
provide: i2.ProductsIndex,
|
|
1432
1358
|
useFactory: function (configuration) {
|
|
1433
|
-
return new
|
|
1359
|
+
return new i2.ProductsIndex(new i2.AxiosAdapter(configuration));
|
|
1434
1360
|
},
|
|
1435
1361
|
deps: [ES_CONFIG],
|
|
1436
1362
|
},
|
|
@@ -1459,161 +1385,175 @@
|
|
|
1459
1385
|
{
|
|
1460
1386
|
provide: 'BeautyProfileRepository',
|
|
1461
1387
|
useFactory: function (firestore, userRepository) {
|
|
1462
|
-
return new
|
|
1388
|
+
return new i2.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
1463
1389
|
},
|
|
1464
|
-
deps: [i1$
|
|
1390
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1465
1391
|
},
|
|
1466
1392
|
{
|
|
1467
1393
|
provide: 'Buy2WinRepository',
|
|
1468
1394
|
useFactory: function (firestore) {
|
|
1469
|
-
return new
|
|
1395
|
+
return new i2.Buy2WinFirestoreRepository(firestore.firestore);
|
|
1470
1396
|
},
|
|
1471
|
-
deps: [i1$
|
|
1397
|
+
deps: [i1$1.AngularFirestore],
|
|
1472
1398
|
},
|
|
1473
1399
|
{
|
|
1474
|
-
provide:
|
|
1400
|
+
provide: i2.CategoryFirestoreRepository,
|
|
1475
1401
|
useFactory: function (firestore) {
|
|
1476
|
-
return new
|
|
1402
|
+
return new i2.CategoryFirestoreRepository(firestore.firestore);
|
|
1477
1403
|
},
|
|
1478
|
-
deps: [i1$
|
|
1404
|
+
deps: [i1$1.AngularFirestore],
|
|
1479
1405
|
},
|
|
1480
1406
|
{
|
|
1481
1407
|
provide: 'CheckoutRepository',
|
|
1482
1408
|
useFactory: function (firestore) {
|
|
1483
|
-
return new
|
|
1409
|
+
return new i2.CheckoutFirestoreRepository(firestore.firestore);
|
|
1484
1410
|
},
|
|
1485
|
-
deps: [i1$
|
|
1411
|
+
deps: [i1$1.AngularFirestore],
|
|
1486
1412
|
},
|
|
1487
1413
|
{
|
|
1488
1414
|
provide: 'CheckoutSubscriptionRepository',
|
|
1489
1415
|
useFactory: function (firestore) {
|
|
1490
|
-
return new
|
|
1416
|
+
return new i2.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
1491
1417
|
},
|
|
1492
|
-
deps: [i1$
|
|
1418
|
+
deps: [i1$1.AngularFirestore],
|
|
1493
1419
|
},
|
|
1494
1420
|
{
|
|
1495
1421
|
provide: 'CouponRepository',
|
|
1496
1422
|
useFactory: function (firestore) {
|
|
1497
|
-
return new
|
|
1423
|
+
return new i2.CouponFirestoreRepository(firestore.firestore);
|
|
1424
|
+
},
|
|
1425
|
+
deps: [i1$1.AngularFirestore],
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
provide: 'CampaignHashtagRepository',
|
|
1429
|
+
useFactory: function (firestore) {
|
|
1430
|
+
return new i2.CampaignHashtagFirestoreRepository(firestore.firestore);
|
|
1498
1431
|
},
|
|
1499
|
-
deps: [i1$
|
|
1432
|
+
deps: [i1$1.AngularFirestore],
|
|
1433
|
+
},
|
|
1434
|
+
{
|
|
1435
|
+
provide: 'CampaignDashboardRepository',
|
|
1436
|
+
useFactory: function (firestore) {
|
|
1437
|
+
return new i2.CampaignDashboardFirestoreRepository(firestore.firestore);
|
|
1438
|
+
},
|
|
1439
|
+
deps: [i1$1.AngularFirestore],
|
|
1500
1440
|
},
|
|
1501
1441
|
{
|
|
1502
1442
|
provide: 'EditionRepository',
|
|
1503
1443
|
useFactory: function (firestore, subscriptionRepository) {
|
|
1504
|
-
return new
|
|
1444
|
+
return new i2.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1505
1445
|
},
|
|
1506
|
-
deps: [i1$
|
|
1446
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1507
1447
|
},
|
|
1508
1448
|
{
|
|
1509
1449
|
provide: 'HomeRepository',
|
|
1510
1450
|
useFactory: function (firestore) {
|
|
1511
|
-
return new
|
|
1451
|
+
return new i2.HomeFirestoreRepository(firestore.firestore);
|
|
1512
1452
|
},
|
|
1513
|
-
deps: [i1$
|
|
1453
|
+
deps: [i1$1.AngularFirestore],
|
|
1514
1454
|
},
|
|
1515
1455
|
{
|
|
1516
1456
|
provide: 'LeadRepository',
|
|
1517
1457
|
useFactory: function (firestore) {
|
|
1518
|
-
return new
|
|
1458
|
+
return new i2.LeadFirestoreRepository(firestore.firestore);
|
|
1519
1459
|
},
|
|
1520
|
-
deps: [i1$
|
|
1460
|
+
deps: [i1$1.AngularFirestore],
|
|
1521
1461
|
},
|
|
1522
1462
|
{
|
|
1523
1463
|
provide: 'LegacyOrderRepository',
|
|
1524
1464
|
useFactory: function (firestore) {
|
|
1525
|
-
return new
|
|
1465
|
+
return new i2.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
1526
1466
|
},
|
|
1527
|
-
deps: [i1$
|
|
1467
|
+
deps: [i1$1.AngularFirestore],
|
|
1528
1468
|
},
|
|
1529
1469
|
{
|
|
1530
1470
|
provide: 'ShopMenuRepository',
|
|
1531
1471
|
useFactory: function (firestore) {
|
|
1532
|
-
return new
|
|
1472
|
+
return new i2.ShopMenuFirestoreRepository(firestore.firestore);
|
|
1533
1473
|
},
|
|
1534
|
-
deps: [i1$
|
|
1474
|
+
deps: [i1$1.AngularFirestore],
|
|
1535
1475
|
},
|
|
1536
1476
|
{
|
|
1537
1477
|
provide: 'OrderRepository',
|
|
1538
1478
|
useFactory: function (firestore) {
|
|
1539
|
-
return new
|
|
1479
|
+
return new i2.OrderFirestoreRepository(firestore.firestore);
|
|
1540
1480
|
},
|
|
1541
|
-
deps: [i1$
|
|
1481
|
+
deps: [i1$1.AngularFirestore],
|
|
1542
1482
|
},
|
|
1543
1483
|
{
|
|
1544
1484
|
provide: 'PaymentRepository',
|
|
1545
1485
|
useFactory: function (firestore) {
|
|
1546
|
-
return new
|
|
1486
|
+
return new i2.PaymentFirestoreRepository(firestore.firestore);
|
|
1547
1487
|
},
|
|
1548
|
-
deps: [i1$
|
|
1488
|
+
deps: [i1$1.AngularFirestore],
|
|
1549
1489
|
},
|
|
1550
1490
|
{
|
|
1551
|
-
provide:
|
|
1491
|
+
provide: i2.ProductFirestoreRepository,
|
|
1552
1492
|
useFactory: function (firestore) {
|
|
1553
|
-
return new
|
|
1493
|
+
return new i2.ProductFirestoreRepository(firestore.firestore);
|
|
1554
1494
|
},
|
|
1555
|
-
deps: [i1$
|
|
1495
|
+
deps: [i1$1.AngularFirestore],
|
|
1556
1496
|
},
|
|
1557
1497
|
{
|
|
1558
1498
|
provide: 'SubscriptionPaymentRepository',
|
|
1559
1499
|
useFactory: function (firestore, subscriptionRepository) {
|
|
1560
|
-
return new
|
|
1500
|
+
return new i2.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1561
1501
|
},
|
|
1562
|
-
deps: [i1$
|
|
1502
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1563
1503
|
},
|
|
1564
1504
|
{
|
|
1565
1505
|
provide: 'SubscriptionPlanRepository',
|
|
1566
1506
|
useFactory: function (firestore) {
|
|
1567
|
-
return new
|
|
1507
|
+
return new i2.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
1568
1508
|
},
|
|
1569
|
-
deps: [i1$
|
|
1509
|
+
deps: [i1$1.AngularFirestore],
|
|
1570
1510
|
},
|
|
1571
1511
|
{
|
|
1572
1512
|
provide: 'SubscriptionProductRepository',
|
|
1573
1513
|
useFactory: function (firestore) {
|
|
1574
|
-
return new
|
|
1514
|
+
return new i2.SubscriptionProductFirestoreRepository(firestore.firestore);
|
|
1575
1515
|
},
|
|
1576
|
-
deps: [i1$
|
|
1516
|
+
deps: [i1$1.AngularFirestore],
|
|
1577
1517
|
},
|
|
1578
1518
|
{
|
|
1579
1519
|
provide: 'SubscriptionRepository',
|
|
1580
1520
|
useFactory: function (firestore) {
|
|
1581
|
-
return new
|
|
1521
|
+
return new i2.SubscriptionFirestoreRepository(firestore.firestore);
|
|
1582
1522
|
},
|
|
1583
|
-
deps: [i1$
|
|
1523
|
+
deps: [i1$1.AngularFirestore],
|
|
1584
1524
|
},
|
|
1585
1525
|
{
|
|
1586
1526
|
provide: 'UserRepository',
|
|
1587
1527
|
useFactory: function (firestore) {
|
|
1588
|
-
return new
|
|
1528
|
+
return new i2.UserFirestoreRepository(firestore.firestore);
|
|
1589
1529
|
},
|
|
1590
|
-
deps: [i1$
|
|
1530
|
+
deps: [i1$1.AngularFirestore],
|
|
1591
1531
|
},
|
|
1592
1532
|
{
|
|
1593
1533
|
provide: 'UserAddressRepository',
|
|
1594
1534
|
useFactory: function (firestore, userRepository) {
|
|
1595
|
-
return new
|
|
1535
|
+
return new i2.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
1596
1536
|
},
|
|
1597
|
-
deps: [i1$
|
|
1537
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1598
1538
|
},
|
|
1599
1539
|
{
|
|
1600
1540
|
provide: 'UserPaymentMethodRepository',
|
|
1601
1541
|
useFactory: function (firestore, userRepository) {
|
|
1602
|
-
return new
|
|
1542
|
+
return new i2.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
|
|
1603
1543
|
},
|
|
1604
|
-
deps: [i1$
|
|
1544
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1605
1545
|
},
|
|
1606
1546
|
{
|
|
1607
|
-
provide:
|
|
1547
|
+
provide: i2.ProductVariantFirestoreRepository,
|
|
1608
1548
|
useFactory: function (firestore, productRepository) {
|
|
1609
|
-
return new
|
|
1549
|
+
return new i2.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
1610
1550
|
},
|
|
1611
|
-
deps: [i1$
|
|
1551
|
+
deps: [i1$1.AngularFirestore, i2.ProductFirestoreRepository],
|
|
1612
1552
|
},
|
|
1613
1553
|
{
|
|
1614
1554
|
provide: i0.APP_INITIALIZER,
|
|
1615
1555
|
useFactory: function (firestore) { return function () { return firestore.firestore.settings({ ignoreUndefinedProperties: true }); }; },
|
|
1616
|
-
deps: [i1$
|
|
1556
|
+
deps: [i1$1.AngularFirestore],
|
|
1617
1557
|
multi: true,
|
|
1618
1558
|
},
|
|
1619
1559
|
], imports: [[fire.AngularFireModule, AngularElasticSeachModule]] });
|
|
@@ -1625,161 +1565,175 @@
|
|
|
1625
1565
|
{
|
|
1626
1566
|
provide: 'BeautyProfileRepository',
|
|
1627
1567
|
useFactory: function (firestore, userRepository) {
|
|
1628
|
-
return new
|
|
1568
|
+
return new i2.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
1629
1569
|
},
|
|
1630
|
-
deps: [i1$
|
|
1570
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1631
1571
|
},
|
|
1632
1572
|
{
|
|
1633
1573
|
provide: 'Buy2WinRepository',
|
|
1634
1574
|
useFactory: function (firestore) {
|
|
1635
|
-
return new
|
|
1575
|
+
return new i2.Buy2WinFirestoreRepository(firestore.firestore);
|
|
1636
1576
|
},
|
|
1637
|
-
deps: [i1$
|
|
1577
|
+
deps: [i1$1.AngularFirestore],
|
|
1638
1578
|
},
|
|
1639
1579
|
{
|
|
1640
|
-
provide:
|
|
1580
|
+
provide: i2.CategoryFirestoreRepository,
|
|
1641
1581
|
useFactory: function (firestore) {
|
|
1642
|
-
return new
|
|
1582
|
+
return new i2.CategoryFirestoreRepository(firestore.firestore);
|
|
1643
1583
|
},
|
|
1644
|
-
deps: [i1$
|
|
1584
|
+
deps: [i1$1.AngularFirestore],
|
|
1645
1585
|
},
|
|
1646
1586
|
{
|
|
1647
1587
|
provide: 'CheckoutRepository',
|
|
1648
1588
|
useFactory: function (firestore) {
|
|
1649
|
-
return new
|
|
1589
|
+
return new i2.CheckoutFirestoreRepository(firestore.firestore);
|
|
1650
1590
|
},
|
|
1651
|
-
deps: [i1$
|
|
1591
|
+
deps: [i1$1.AngularFirestore],
|
|
1652
1592
|
},
|
|
1653
1593
|
{
|
|
1654
1594
|
provide: 'CheckoutSubscriptionRepository',
|
|
1655
1595
|
useFactory: function (firestore) {
|
|
1656
|
-
return new
|
|
1596
|
+
return new i2.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
1657
1597
|
},
|
|
1658
|
-
deps: [i1$
|
|
1598
|
+
deps: [i1$1.AngularFirestore],
|
|
1659
1599
|
},
|
|
1660
1600
|
{
|
|
1661
1601
|
provide: 'CouponRepository',
|
|
1662
1602
|
useFactory: function (firestore) {
|
|
1663
|
-
return new
|
|
1603
|
+
return new i2.CouponFirestoreRepository(firestore.firestore);
|
|
1604
|
+
},
|
|
1605
|
+
deps: [i1$1.AngularFirestore],
|
|
1606
|
+
},
|
|
1607
|
+
{
|
|
1608
|
+
provide: 'CampaignHashtagRepository',
|
|
1609
|
+
useFactory: function (firestore) {
|
|
1610
|
+
return new i2.CampaignHashtagFirestoreRepository(firestore.firestore);
|
|
1611
|
+
},
|
|
1612
|
+
deps: [i1$1.AngularFirestore],
|
|
1613
|
+
},
|
|
1614
|
+
{
|
|
1615
|
+
provide: 'CampaignDashboardRepository',
|
|
1616
|
+
useFactory: function (firestore) {
|
|
1617
|
+
return new i2.CampaignDashboardFirestoreRepository(firestore.firestore);
|
|
1664
1618
|
},
|
|
1665
|
-
deps: [i1$
|
|
1619
|
+
deps: [i1$1.AngularFirestore],
|
|
1666
1620
|
},
|
|
1667
1621
|
{
|
|
1668
1622
|
provide: 'EditionRepository',
|
|
1669
1623
|
useFactory: function (firestore, subscriptionRepository) {
|
|
1670
|
-
return new
|
|
1624
|
+
return new i2.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1671
1625
|
},
|
|
1672
|
-
deps: [i1$
|
|
1626
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1673
1627
|
},
|
|
1674
1628
|
{
|
|
1675
1629
|
provide: 'HomeRepository',
|
|
1676
1630
|
useFactory: function (firestore) {
|
|
1677
|
-
return new
|
|
1631
|
+
return new i2.HomeFirestoreRepository(firestore.firestore);
|
|
1678
1632
|
},
|
|
1679
|
-
deps: [i1$
|
|
1633
|
+
deps: [i1$1.AngularFirestore],
|
|
1680
1634
|
},
|
|
1681
1635
|
{
|
|
1682
1636
|
provide: 'LeadRepository',
|
|
1683
1637
|
useFactory: function (firestore) {
|
|
1684
|
-
return new
|
|
1638
|
+
return new i2.LeadFirestoreRepository(firestore.firestore);
|
|
1685
1639
|
},
|
|
1686
|
-
deps: [i1$
|
|
1640
|
+
deps: [i1$1.AngularFirestore],
|
|
1687
1641
|
},
|
|
1688
1642
|
{
|
|
1689
1643
|
provide: 'LegacyOrderRepository',
|
|
1690
1644
|
useFactory: function (firestore) {
|
|
1691
|
-
return new
|
|
1645
|
+
return new i2.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
1692
1646
|
},
|
|
1693
|
-
deps: [i1$
|
|
1647
|
+
deps: [i1$1.AngularFirestore],
|
|
1694
1648
|
},
|
|
1695
1649
|
{
|
|
1696
1650
|
provide: 'ShopMenuRepository',
|
|
1697
1651
|
useFactory: function (firestore) {
|
|
1698
|
-
return new
|
|
1652
|
+
return new i2.ShopMenuFirestoreRepository(firestore.firestore);
|
|
1699
1653
|
},
|
|
1700
|
-
deps: [i1$
|
|
1654
|
+
deps: [i1$1.AngularFirestore],
|
|
1701
1655
|
},
|
|
1702
1656
|
{
|
|
1703
1657
|
provide: 'OrderRepository',
|
|
1704
1658
|
useFactory: function (firestore) {
|
|
1705
|
-
return new
|
|
1659
|
+
return new i2.OrderFirestoreRepository(firestore.firestore);
|
|
1706
1660
|
},
|
|
1707
|
-
deps: [i1$
|
|
1661
|
+
deps: [i1$1.AngularFirestore],
|
|
1708
1662
|
},
|
|
1709
1663
|
{
|
|
1710
1664
|
provide: 'PaymentRepository',
|
|
1711
1665
|
useFactory: function (firestore) {
|
|
1712
|
-
return new
|
|
1666
|
+
return new i2.PaymentFirestoreRepository(firestore.firestore);
|
|
1713
1667
|
},
|
|
1714
|
-
deps: [i1$
|
|
1668
|
+
deps: [i1$1.AngularFirestore],
|
|
1715
1669
|
},
|
|
1716
1670
|
{
|
|
1717
|
-
provide:
|
|
1671
|
+
provide: i2.ProductFirestoreRepository,
|
|
1718
1672
|
useFactory: function (firestore) {
|
|
1719
|
-
return new
|
|
1673
|
+
return new i2.ProductFirestoreRepository(firestore.firestore);
|
|
1720
1674
|
},
|
|
1721
|
-
deps: [i1$
|
|
1675
|
+
deps: [i1$1.AngularFirestore],
|
|
1722
1676
|
},
|
|
1723
1677
|
{
|
|
1724
1678
|
provide: 'SubscriptionPaymentRepository',
|
|
1725
1679
|
useFactory: function (firestore, subscriptionRepository) {
|
|
1726
|
-
return new
|
|
1680
|
+
return new i2.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1727
1681
|
},
|
|
1728
|
-
deps: [i1$
|
|
1682
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1729
1683
|
},
|
|
1730
1684
|
{
|
|
1731
1685
|
provide: 'SubscriptionPlanRepository',
|
|
1732
1686
|
useFactory: function (firestore) {
|
|
1733
|
-
return new
|
|
1687
|
+
return new i2.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
1734
1688
|
},
|
|
1735
|
-
deps: [i1$
|
|
1689
|
+
deps: [i1$1.AngularFirestore],
|
|
1736
1690
|
},
|
|
1737
1691
|
{
|
|
1738
1692
|
provide: 'SubscriptionProductRepository',
|
|
1739
1693
|
useFactory: function (firestore) {
|
|
1740
|
-
return new
|
|
1694
|
+
return new i2.SubscriptionProductFirestoreRepository(firestore.firestore);
|
|
1741
1695
|
},
|
|
1742
|
-
deps: [i1$
|
|
1696
|
+
deps: [i1$1.AngularFirestore],
|
|
1743
1697
|
},
|
|
1744
1698
|
{
|
|
1745
1699
|
provide: 'SubscriptionRepository',
|
|
1746
1700
|
useFactory: function (firestore) {
|
|
1747
|
-
return new
|
|
1701
|
+
return new i2.SubscriptionFirestoreRepository(firestore.firestore);
|
|
1748
1702
|
},
|
|
1749
|
-
deps: [i1$
|
|
1703
|
+
deps: [i1$1.AngularFirestore],
|
|
1750
1704
|
},
|
|
1751
1705
|
{
|
|
1752
1706
|
provide: 'UserRepository',
|
|
1753
1707
|
useFactory: function (firestore) {
|
|
1754
|
-
return new
|
|
1708
|
+
return new i2.UserFirestoreRepository(firestore.firestore);
|
|
1755
1709
|
},
|
|
1756
|
-
deps: [i1$
|
|
1710
|
+
deps: [i1$1.AngularFirestore],
|
|
1757
1711
|
},
|
|
1758
1712
|
{
|
|
1759
1713
|
provide: 'UserAddressRepository',
|
|
1760
1714
|
useFactory: function (firestore, userRepository) {
|
|
1761
|
-
return new
|
|
1715
|
+
return new i2.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
1762
1716
|
},
|
|
1763
|
-
deps: [i1$
|
|
1717
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1764
1718
|
},
|
|
1765
1719
|
{
|
|
1766
1720
|
provide: 'UserPaymentMethodRepository',
|
|
1767
1721
|
useFactory: function (firestore, userRepository) {
|
|
1768
|
-
return new
|
|
1722
|
+
return new i2.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
|
|
1769
1723
|
},
|
|
1770
|
-
deps: [i1$
|
|
1724
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1771
1725
|
},
|
|
1772
1726
|
{
|
|
1773
|
-
provide:
|
|
1727
|
+
provide: i2.ProductVariantFirestoreRepository,
|
|
1774
1728
|
useFactory: function (firestore, productRepository) {
|
|
1775
|
-
return new
|
|
1729
|
+
return new i2.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
1776
1730
|
},
|
|
1777
|
-
deps: [i1$
|
|
1731
|
+
deps: [i1$1.AngularFirestore, i2.ProductFirestoreRepository],
|
|
1778
1732
|
},
|
|
1779
1733
|
{
|
|
1780
1734
|
provide: i0.APP_INITIALIZER,
|
|
1781
1735
|
useFactory: function (firestore) { return function () { return firestore.firestore.settings({ ignoreUndefinedProperties: true }); }; },
|
|
1782
|
-
deps: [i1$
|
|
1736
|
+
deps: [i1$1.AngularFirestore],
|
|
1783
1737
|
multi: true,
|
|
1784
1738
|
},
|
|
1785
1739
|
],
|
|
@@ -1802,70 +1756,37 @@
|
|
|
1802
1756
|
AngularHasuraGraphQLModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule, providers: [
|
|
1803
1757
|
{
|
|
1804
1758
|
provide: 'CategoryRepository',
|
|
1805
|
-
useExisting:
|
|
1759
|
+
useExisting: i2.CategoryHasuraGraphQLRepository,
|
|
1806
1760
|
},
|
|
1807
1761
|
{
|
|
1808
|
-
provide:
|
|
1809
|
-
useFactory: function (options, productRepository
|
|
1810
|
-
return new
|
|
1762
|
+
provide: i2.CategoryHasuraGraphQLRepository,
|
|
1763
|
+
useFactory: function (options, productRepository) {
|
|
1764
|
+
return new i2.CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository);
|
|
1811
1765
|
},
|
|
1812
|
-
deps: [HASURA_OPTIONS,
|
|
1766
|
+
deps: [HASURA_OPTIONS, i2.ProductHasuraGraphQLRepository],
|
|
1813
1767
|
},
|
|
1814
1768
|
{
|
|
1815
1769
|
provide: 'ProductRepository',
|
|
1816
|
-
useExisting:
|
|
1770
|
+
useExisting: i2.ProductHasuraGraphQLRepository,
|
|
1817
1771
|
},
|
|
1818
1772
|
{
|
|
1819
|
-
provide:
|
|
1773
|
+
provide: i2.ProductHasuraGraphQLRepository,
|
|
1820
1774
|
useFactory: function (options) {
|
|
1821
|
-
return new
|
|
1775
|
+
return new i2.ProductHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1822
1776
|
},
|
|
1823
1777
|
deps: [HASURA_OPTIONS],
|
|
1824
1778
|
},
|
|
1825
1779
|
{
|
|
1826
1780
|
provide: 'VariantRepository',
|
|
1827
|
-
useExisting:
|
|
1781
|
+
useExisting: i2.VariantHasuraGraphQLRepository,
|
|
1828
1782
|
},
|
|
1829
1783
|
{
|
|
1830
|
-
provide:
|
|
1784
|
+
provide: i2.VariantHasuraGraphQLRepository,
|
|
1831
1785
|
useFactory: function (options) {
|
|
1832
|
-
return new
|
|
1786
|
+
return new i2.VariantHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1833
1787
|
},
|
|
1834
1788
|
deps: [HASURA_OPTIONS],
|
|
1835
1789
|
},
|
|
1836
|
-
{
|
|
1837
|
-
provide: 'CategoryFilterRepository',
|
|
1838
|
-
useExisting: i1$1.CategoryFilterHasuraGraphQLRepository,
|
|
1839
|
-
},
|
|
1840
|
-
{
|
|
1841
|
-
provide: i1$1.CategoryFilterHasuraGraphQLRepository,
|
|
1842
|
-
useFactory: function (options) {
|
|
1843
|
-
return new i1$1.CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1844
|
-
},
|
|
1845
|
-
deps: [HASURA_OPTIONS],
|
|
1846
|
-
},
|
|
1847
|
-
{
|
|
1848
|
-
provide: 'FilterOptionRepository',
|
|
1849
|
-
useExisting: i1$1.FilterOptionHasuraGraphQLRepository,
|
|
1850
|
-
},
|
|
1851
|
-
{
|
|
1852
|
-
provide: i1$1.FilterOptionHasuraGraphQLRepository,
|
|
1853
|
-
useFactory: function (options) {
|
|
1854
|
-
return new i1$1.FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1855
|
-
},
|
|
1856
|
-
deps: [HASURA_OPTIONS],
|
|
1857
|
-
},
|
|
1858
|
-
{
|
|
1859
|
-
provide: 'FilterRepository',
|
|
1860
|
-
useExisting: i1$1.FilterHasuraGraphQLRepository,
|
|
1861
|
-
},
|
|
1862
|
-
{
|
|
1863
|
-
provide: i1$1.FilterHasuraGraphQLRepository,
|
|
1864
|
-
useFactory: function (options, filterOptionRepository, categoryFilterRepository) {
|
|
1865
|
-
return new i1$1.FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository, categoryFilterRepository);
|
|
1866
|
-
},
|
|
1867
|
-
deps: [HASURA_OPTIONS, i1$1.FilterOptionHasuraGraphQLRepository, i1$1.CategoryFilterHasuraGraphQLRepository],
|
|
1868
|
-
},
|
|
1869
1790
|
] });
|
|
1870
1791
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule, decorators: [{
|
|
1871
1792
|
type: i0.NgModule,
|
|
@@ -1873,70 +1794,37 @@
|
|
|
1873
1794
|
providers: [
|
|
1874
1795
|
{
|
|
1875
1796
|
provide: 'CategoryRepository',
|
|
1876
|
-
useExisting:
|
|
1797
|
+
useExisting: i2.CategoryHasuraGraphQLRepository,
|
|
1877
1798
|
},
|
|
1878
1799
|
{
|
|
1879
|
-
provide:
|
|
1880
|
-
useFactory: function (options, productRepository
|
|
1881
|
-
return new
|
|
1800
|
+
provide: i2.CategoryHasuraGraphQLRepository,
|
|
1801
|
+
useFactory: function (options, productRepository) {
|
|
1802
|
+
return new i2.CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository);
|
|
1882
1803
|
},
|
|
1883
|
-
deps: [HASURA_OPTIONS,
|
|
1804
|
+
deps: [HASURA_OPTIONS, i2.ProductHasuraGraphQLRepository],
|
|
1884
1805
|
},
|
|
1885
1806
|
{
|
|
1886
1807
|
provide: 'ProductRepository',
|
|
1887
|
-
useExisting:
|
|
1808
|
+
useExisting: i2.ProductHasuraGraphQLRepository,
|
|
1888
1809
|
},
|
|
1889
1810
|
{
|
|
1890
|
-
provide:
|
|
1811
|
+
provide: i2.ProductHasuraGraphQLRepository,
|
|
1891
1812
|
useFactory: function (options) {
|
|
1892
|
-
return new
|
|
1813
|
+
return new i2.ProductHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1893
1814
|
},
|
|
1894
1815
|
deps: [HASURA_OPTIONS],
|
|
1895
1816
|
},
|
|
1896
1817
|
{
|
|
1897
1818
|
provide: 'VariantRepository',
|
|
1898
|
-
useExisting:
|
|
1819
|
+
useExisting: i2.VariantHasuraGraphQLRepository,
|
|
1899
1820
|
},
|
|
1900
1821
|
{
|
|
1901
|
-
provide:
|
|
1822
|
+
provide: i2.VariantHasuraGraphQLRepository,
|
|
1902
1823
|
useFactory: function (options) {
|
|
1903
|
-
return new
|
|
1824
|
+
return new i2.VariantHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1904
1825
|
},
|
|
1905
1826
|
deps: [HASURA_OPTIONS],
|
|
1906
1827
|
},
|
|
1907
|
-
{
|
|
1908
|
-
provide: 'CategoryFilterRepository',
|
|
1909
|
-
useExisting: i1$1.CategoryFilterHasuraGraphQLRepository,
|
|
1910
|
-
},
|
|
1911
|
-
{
|
|
1912
|
-
provide: i1$1.CategoryFilterHasuraGraphQLRepository,
|
|
1913
|
-
useFactory: function (options) {
|
|
1914
|
-
return new i1$1.CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1915
|
-
},
|
|
1916
|
-
deps: [HASURA_OPTIONS],
|
|
1917
|
-
},
|
|
1918
|
-
{
|
|
1919
|
-
provide: 'FilterOptionRepository',
|
|
1920
|
-
useExisting: i1$1.FilterOptionHasuraGraphQLRepository,
|
|
1921
|
-
},
|
|
1922
|
-
{
|
|
1923
|
-
provide: i1$1.FilterOptionHasuraGraphQLRepository,
|
|
1924
|
-
useFactory: function (options) {
|
|
1925
|
-
return new i1$1.FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1926
|
-
},
|
|
1927
|
-
deps: [HASURA_OPTIONS],
|
|
1928
|
-
},
|
|
1929
|
-
{
|
|
1930
|
-
provide: 'FilterRepository',
|
|
1931
|
-
useExisting: i1$1.FilterHasuraGraphQLRepository,
|
|
1932
|
-
},
|
|
1933
|
-
{
|
|
1934
|
-
provide: i1$1.FilterHasuraGraphQLRepository,
|
|
1935
|
-
useFactory: function (options, filterOptionRepository, categoryFilterRepository) {
|
|
1936
|
-
return new i1$1.FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository, categoryFilterRepository);
|
|
1937
|
-
},
|
|
1938
|
-
deps: [HASURA_OPTIONS, i1$1.FilterOptionHasuraGraphQLRepository, i1$1.CategoryFilterHasuraGraphQLRepository],
|
|
1939
|
-
},
|
|
1940
1828
|
],
|
|
1941
1829
|
}]
|
|
1942
1830
|
}] });
|
|
@@ -1947,7 +1835,7 @@
|
|
|
1947
1835
|
AngularConnectModule.initializeApp = function (defaultShop, options, nameOrConfig) {
|
|
1948
1836
|
return {
|
|
1949
1837
|
ngModule: AngularConnectModule,
|
|
1950
|
-
providers: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(
|
|
1838
|
+
providers: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((i2.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i2.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((i2.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))), __read((i2.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [{ provide: ES_CONFIG, useValue: options.elasticSearch }]))), __read((i2.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [{ provide: HASURA_OPTIONS, useValue: options.hasura }]))),
|
|
1951
1839
|
};
|
|
1952
1840
|
};
|
|
1953
1841
|
return AngularConnectModule;
|
|
@@ -1962,7 +1850,6 @@
|
|
|
1962
1850
|
CouponService,
|
|
1963
1851
|
HomeShopService,
|
|
1964
1852
|
OrderService,
|
|
1965
|
-
ShippingService,
|
|
1966
1853
|
], imports: [[fire.AngularFireModule, AngularFirestoreModule, AngularHasuraGraphQLModule]] });
|
|
1967
1854
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, decorators: [{
|
|
1968
1855
|
type: i0.NgModule,
|
|
@@ -1976,7 +1863,6 @@
|
|
|
1976
1863
|
CouponService,
|
|
1977
1864
|
HomeShopService,
|
|
1978
1865
|
OrderService,
|
|
1979
|
-
ShippingService,
|
|
1980
1866
|
],
|
|
1981
1867
|
}]
|
|
1982
1868
|
}] });
|
|
@@ -1996,7 +1882,6 @@
|
|
|
1996
1882
|
exports.CouponService = CouponService;
|
|
1997
1883
|
exports.HomeShopService = HomeShopService;
|
|
1998
1884
|
exports.OrderService = OrderService;
|
|
1999
|
-
exports.ShippingService = ShippingService;
|
|
2000
1885
|
|
|
2001
1886
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2002
1887
|
|