@infrab4a/connect 0.0.3 → 0.0.5
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.umd.js +353 -4
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/esm2015/lib/domain/index.js +3 -1
- package/esm2015/lib/domain/location/index.js +2 -0
- package/esm2015/lib/domain/location/models/address.js +4 -0
- package/esm2015/lib/domain/location/models/index.js +3 -0
- package/esm2015/lib/domain/location/models/types/index.js +4 -0
- package/esm2015/lib/domain/location/models/types/location-bound.type.js +2 -0
- package/esm2015/lib/domain/location/models/types/location-geometry.type.js +2 -0
- package/esm2015/lib/domain/location/models/types/location-lat-lng.type.js +2 -0
- package/esm2015/lib/domain/shopping/index.js +3 -0
- package/esm2015/lib/domain/shopping/models/checkout.js +7 -0
- package/esm2015/lib/domain/shopping/models/coupons/coupon.js +15 -0
- package/esm2015/lib/domain/shopping/models/coupons/enums/coupon-subtypes.enum.js +6 -0
- package/esm2015/lib/domain/shopping/models/coupons/enums/coupon-types.enum.js +8 -0
- package/esm2015/lib/domain/shopping/models/coupons/enums/exclusivities.enum.js +7 -0
- package/esm2015/lib/domain/shopping/models/coupons/enums/index.js +4 -0
- package/esm2015/lib/domain/shopping/models/coupons/financial-coupon.js +28 -0
- package/esm2015/lib/domain/shopping/models/coupons/index.js +4 -0
- package/esm2015/lib/domain/shopping/models/enums/checkout-types.enum.js +6 -0
- package/esm2015/lib/domain/shopping/models/enums/index.js +3 -0
- package/esm2015/lib/domain/shopping/models/enums/order-status.enum.js +12 -0
- package/esm2015/lib/domain/shopping/models/index.js +9 -0
- package/esm2015/lib/domain/shopping/models/line-item.js +4 -0
- package/esm2015/lib/domain/shopping/models/order.js +4 -0
- package/esm2015/lib/domain/shopping/models/payment.js +129 -0
- package/esm2015/lib/domain/shopping/models/shipping-method.js +7 -0
- package/esm2015/lib/domain/shopping/models/types/index.js +8 -0
- package/esm2015/lib/domain/shopping/models/types/payment-address.type.js +2 -0
- package/esm2015/lib/domain/shopping/models/types/payment-billing.type.js +2 -0
- package/esm2015/lib/domain/shopping/models/types/payment-card.type.js +2 -0
- package/esm2015/lib/domain/shopping/models/types/payment-customer.type.js +2 -0
- package/esm2015/lib/domain/shopping/models/types/payment-document.type.js +2 -0
- package/esm2015/lib/domain/shopping/models/types/payment-item.type.js +2 -0
- package/esm2015/lib/domain/shopping/models/types/payment-shipping.type.js +2 -0
- package/esm2015/lib/domain/shopping/repositories/checkout.repository.js +2 -0
- package/esm2015/lib/domain/shopping/repositories/coupon.repository.js +2 -0
- package/esm2015/lib/domain/shopping/repositories/index.js +5 -0
- package/esm2015/lib/domain/shopping/repositories/order.repository.js +2 -0
- package/esm2015/lib/domain/shopping/repositories/payment.repository.js +2 -0
- package/esm2015/lib/domain/users/models/index.js +2 -1
- package/esm2015/lib/domain/users/models/user-address.js +7 -0
- package/esm2015/lib/domain/users/repositories/index.js +2 -1
- package/esm2015/lib/domain/users/repositories/user-address.repository.js +2 -0
- package/esm2015/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +3 -1
- package/esm2015/lib/infra/firebase/firestore/repositories/index.js +2 -1
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/index.js +5 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.js +12 -0
- package/esm2015/lib/infra/firebase/firestore/repositories/users/index.js +2 -1
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +14 -0
- package/fesm2015/infrab4a-connect.js +281 -3
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/lib/domain/index.d.ts +2 -0
- package/lib/domain/location/index.d.ts +1 -0
- package/lib/domain/location/models/address.d.ts +21 -0
- package/lib/domain/location/models/index.d.ts +2 -0
- package/lib/domain/location/models/types/index.d.ts +3 -0
- package/lib/domain/location/models/types/location-bound.type.d.ts +6 -0
- package/lib/domain/location/models/types/location-geometry.type.d.ts +7 -0
- package/lib/domain/location/models/types/location-lat-lng.type.d.ts +4 -0
- package/lib/domain/shopping/index.d.ts +2 -0
- package/lib/domain/shopping/models/checkout.d.ts +26 -0
- package/lib/domain/shopping/models/coupons/coupon.d.ts +24 -0
- package/lib/domain/shopping/models/coupons/enums/coupon-subtypes.enum.d.ts +4 -0
- package/lib/domain/shopping/models/coupons/enums/coupon-types.enum.d.ts +6 -0
- package/lib/domain/shopping/models/coupons/enums/exclusivities.enum.d.ts +5 -0
- package/lib/domain/shopping/models/coupons/enums/index.d.ts +3 -0
- package/lib/domain/shopping/models/coupons/financial-coupon.d.ts +8 -0
- package/lib/domain/shopping/models/coupons/index.d.ts +3 -0
- package/lib/domain/shopping/models/enums/checkout-types.enum.d.ts +4 -0
- package/lib/domain/shopping/models/enums/index.d.ts +2 -0
- package/lib/domain/shopping/models/enums/order-status.enum.d.ts +10 -0
- package/lib/domain/shopping/models/index.d.ts +8 -0
- package/lib/domain/shopping/models/line-item.d.ts +7 -0
- package/lib/domain/shopping/models/order.d.ts +7 -0
- package/lib/domain/shopping/models/payment.d.ts +69 -0
- package/lib/domain/shopping/models/shipping-method.d.ts +18 -0
- package/lib/domain/shopping/models/types/index.d.ts +7 -0
- package/lib/domain/shopping/models/types/payment-address.type.d.ts +12 -0
- package/lib/domain/shopping/models/types/payment-billing.type.d.ts +7 -0
- package/lib/domain/shopping/models/types/payment-card.type.d.ts +14 -0
- package/lib/domain/shopping/models/types/payment-customer.type.d.ts +18 -0
- package/lib/domain/shopping/models/types/payment-document.type.d.ts +6 -0
- package/lib/domain/shopping/models/types/payment-item.type.d.ts +11 -0
- package/lib/domain/shopping/models/types/payment-shipping.type.d.ts +10 -0
- package/lib/domain/shopping/repositories/checkout.repository.d.ts +4 -0
- package/lib/domain/shopping/repositories/coupon.repository.d.ts +4 -0
- package/lib/domain/shopping/repositories/index.d.ts +4 -0
- package/lib/domain/shopping/repositories/order.repository.d.ts +4 -0
- package/lib/domain/shopping/repositories/payment.repository.d.ts +4 -0
- package/lib/domain/users/models/index.d.ts +1 -0
- package/lib/domain/users/models/user-address.d.ts +7 -0
- package/lib/domain/users/repositories/index.d.ts +1 -0
- package/lib/domain/users/repositories/user-address.repository.d.ts +4 -0
- package/lib/infra/firebase/firestore/repositories/index.d.ts +1 -0
- package/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +48 -0
- package/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +48 -0
- package/lib/infra/firebase/firestore/repositories/shopping/index.d.ts +4 -0
- package/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +48 -0
- package/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +48 -0
- package/lib/infra/firebase/firestore/repositories/users/index.d.ts +1 -0
- package/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +59 -0
- package/package.json +2 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('class-transformer'), require('lodash'), require('firebase/app')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@infrab4a/connect', ['exports', 'class-transformer', 'lodash', 'firebase/app'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a.connect = {}), global["class-transformer"], global.lodash, global.firebase));
|
|
5
|
-
})(this, (function (exports, classTransformer, lodash, firebase) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('class-transformer'), require('lodash'), require('ts-md5'), require('firebase/app')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@infrab4a/connect', ['exports', 'class-transformer', 'lodash', 'ts-md5', 'firebase/app'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a.connect = {}), global["class-transformer"], global.lodash, global.tsMd5, global.firebase));
|
|
5
|
+
})(this, (function (exports, classTransformer, lodash, tsMd5, firebase) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -473,6 +473,25 @@
|
|
|
473
473
|
return BeautyProfile;
|
|
474
474
|
}(BaseModel));
|
|
475
475
|
|
|
476
|
+
var Address = /** @class */ (function (_super) {
|
|
477
|
+
__extends(Address, _super);
|
|
478
|
+
function Address() {
|
|
479
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
480
|
+
}
|
|
481
|
+
return Address;
|
|
482
|
+
}(BaseModel));
|
|
483
|
+
|
|
484
|
+
var UserAddress = /** @class */ (function (_super) {
|
|
485
|
+
__extends(UserAddress, _super);
|
|
486
|
+
function UserAddress() {
|
|
487
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
488
|
+
}
|
|
489
|
+
UserAddress.prototype.identifierFields = function () {
|
|
490
|
+
return ['id'];
|
|
491
|
+
};
|
|
492
|
+
return UserAddress;
|
|
493
|
+
}(Address));
|
|
494
|
+
|
|
476
495
|
var Base = /** @class */ (function () {
|
|
477
496
|
function Base() {
|
|
478
497
|
var args = [];
|
|
@@ -595,6 +614,258 @@
|
|
|
595
614
|
return Variant;
|
|
596
615
|
}(BaseModel));
|
|
597
616
|
|
|
617
|
+
exports.CouponTypes = void 0;
|
|
618
|
+
(function (CouponTypes) {
|
|
619
|
+
CouponTypes[CouponTypes["FINANCIAL"] = 1] = "FINANCIAL";
|
|
620
|
+
CouponTypes[CouponTypes["PRODUCT"] = 2] = "PRODUCT";
|
|
621
|
+
CouponTypes[CouponTypes["GIFTCARD"] = 3] = "GIFTCARD";
|
|
622
|
+
CouponTypes[CouponTypes["VOUCHER"] = 4] = "VOUCHER";
|
|
623
|
+
})(exports.CouponTypes || (exports.CouponTypes = {}));
|
|
624
|
+
|
|
625
|
+
exports.CouponSubtypes = void 0;
|
|
626
|
+
(function (CouponSubtypes) {
|
|
627
|
+
CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
|
|
628
|
+
CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
|
|
629
|
+
})(exports.CouponSubtypes || (exports.CouponSubtypes = {}));
|
|
630
|
+
|
|
631
|
+
exports.Exclusivities = void 0;
|
|
632
|
+
(function (Exclusivities) {
|
|
633
|
+
Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
|
|
634
|
+
Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
|
|
635
|
+
Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
|
|
636
|
+
})(exports.Exclusivities || (exports.Exclusivities = {}));
|
|
637
|
+
|
|
638
|
+
var Coupon = /** @class */ (function (_super) {
|
|
639
|
+
__extends(Coupon, _super);
|
|
640
|
+
function Coupon() {
|
|
641
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
642
|
+
}
|
|
643
|
+
Coupon.prototype.identifierFields = function () {
|
|
644
|
+
return ['id'];
|
|
645
|
+
};
|
|
646
|
+
return Coupon;
|
|
647
|
+
}(BaseModel));
|
|
648
|
+
__decorate([
|
|
649
|
+
classTransformer.Expose({ name: 'checkout_type' })
|
|
650
|
+
], Coupon.prototype, "checkoutType", void 0);
|
|
651
|
+
__decorate([
|
|
652
|
+
classTransformer.Expose({ name: 'exclusivity_type' })
|
|
653
|
+
], Coupon.prototype, "exclusivityType", void 0);
|
|
654
|
+
|
|
655
|
+
exports.CheckoutTypes = void 0;
|
|
656
|
+
(function (CheckoutTypes) {
|
|
657
|
+
CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
|
|
658
|
+
CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
|
|
659
|
+
})(exports.CheckoutTypes || (exports.CheckoutTypes = {}));
|
|
660
|
+
|
|
661
|
+
var COUPON_EXPIRATION = 60 * 60 * 24 * 30;
|
|
662
|
+
var FinancialCoupon = /** @class */ (function (_super) {
|
|
663
|
+
__extends(FinancialCoupon, _super);
|
|
664
|
+
function FinancialCoupon() {
|
|
665
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
666
|
+
_this.type = exports.CouponTypes.FINANCIAL;
|
|
667
|
+
return _this;
|
|
668
|
+
}
|
|
669
|
+
FinancialCoupon.isFinancialCoupon = function (coupon) {
|
|
670
|
+
return coupon.type === exports.CouponTypes.FINANCIAL && !!coupon.subtype;
|
|
671
|
+
};
|
|
672
|
+
FinancialCoupon.createCoupon = function (userId) {
|
|
673
|
+
return this.toInstance({
|
|
674
|
+
name: tsMd5.Md5.hashStr(userId + "_" + Date.now).toString(),
|
|
675
|
+
nickname: "" + Date.now(),
|
|
676
|
+
type: exports.CouponTypes.FINANCIAL,
|
|
677
|
+
subtype: exports.CouponSubtypes.PERCENTAGE,
|
|
678
|
+
checkoutType: exports.CheckoutTypes.ECOMMERCE,
|
|
679
|
+
discount: 30,
|
|
680
|
+
user: userId,
|
|
681
|
+
createdAt: Date.now(),
|
|
682
|
+
expiresIn: Date.now() + COUPON_EXPIRATION,
|
|
683
|
+
});
|
|
684
|
+
};
|
|
685
|
+
return FinancialCoupon;
|
|
686
|
+
}(Coupon));
|
|
687
|
+
|
|
688
|
+
exports.OrderStatus = void 0;
|
|
689
|
+
(function (OrderStatus) {
|
|
690
|
+
OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
|
|
691
|
+
OrderStatus["EM_PREPARO"] = "Preparando pedido";
|
|
692
|
+
OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
|
|
693
|
+
OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
|
|
694
|
+
OrderStatus["ENVIADO"] = "Pedido Enviado";
|
|
695
|
+
OrderStatus["ENTREGUE"] = "Pedido entregue";
|
|
696
|
+
OrderStatus["CANCELADO"] = "Cancelado";
|
|
697
|
+
OrderStatus["CREDIT_CARD"] = "credit_card";
|
|
698
|
+
})(exports.OrderStatus || (exports.OrderStatus = {}));
|
|
699
|
+
|
|
700
|
+
var Checkout = /** @class */ (function (_super) {
|
|
701
|
+
__extends(Checkout, _super);
|
|
702
|
+
function Checkout() {
|
|
703
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
704
|
+
}
|
|
705
|
+
Checkout.prototype.identifierFields = function () {
|
|
706
|
+
return ['id'];
|
|
707
|
+
};
|
|
708
|
+
return Checkout;
|
|
709
|
+
}(BaseModel));
|
|
710
|
+
|
|
711
|
+
var LineItem = /** @class */ (function (_super) {
|
|
712
|
+
__extends(LineItem, _super);
|
|
713
|
+
function LineItem() {
|
|
714
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
715
|
+
}
|
|
716
|
+
return LineItem;
|
|
717
|
+
}(Product));
|
|
718
|
+
|
|
719
|
+
var Order = /** @class */ (function (_super) {
|
|
720
|
+
__extends(Order, _super);
|
|
721
|
+
function Order() {
|
|
722
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
723
|
+
}
|
|
724
|
+
return Order;
|
|
725
|
+
}(Checkout));
|
|
726
|
+
|
|
727
|
+
var Payment = /** @class */ (function (_super) {
|
|
728
|
+
__extends(Payment, _super);
|
|
729
|
+
function Payment() {
|
|
730
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
731
|
+
}
|
|
732
|
+
Payment.prototype.identifierFields = function () {
|
|
733
|
+
return ['id'];
|
|
734
|
+
};
|
|
735
|
+
return Payment;
|
|
736
|
+
}(BaseModel));
|
|
737
|
+
__decorate([
|
|
738
|
+
classTransformer.Expose({ name: 'refuse_reason' })
|
|
739
|
+
], Payment.prototype, "refuseReason", void 0);
|
|
740
|
+
__decorate([
|
|
741
|
+
classTransformer.Expose({ name: 'status_reason' })
|
|
742
|
+
], Payment.prototype, "statusReason", void 0);
|
|
743
|
+
__decorate([
|
|
744
|
+
classTransformer.Expose({ name: 'acquirer_response_code' })
|
|
745
|
+
], Payment.prototype, "acquirerResponseCode", void 0);
|
|
746
|
+
__decorate([
|
|
747
|
+
classTransformer.Expose({ name: 'acquirer_name' })
|
|
748
|
+
], Payment.prototype, "acquirerName", void 0);
|
|
749
|
+
__decorate([
|
|
750
|
+
classTransformer.Expose({ name: 'acquirer_id' })
|
|
751
|
+
], Payment.prototype, "acquirerId", void 0);
|
|
752
|
+
__decorate([
|
|
753
|
+
classTransformer.Expose({ name: 'authorization_code' })
|
|
754
|
+
], Payment.prototype, "authorizationCode", void 0);
|
|
755
|
+
__decorate([
|
|
756
|
+
classTransformer.Expose({ name: 'soft_descriptor' })
|
|
757
|
+
], Payment.prototype, "softDescriptor", void 0);
|
|
758
|
+
__decorate([
|
|
759
|
+
classTransformer.Expose({ name: 'date_created' })
|
|
760
|
+
], Payment.prototype, "dateCreated", void 0);
|
|
761
|
+
__decorate([
|
|
762
|
+
classTransformer.Expose({ name: 'date_updated' })
|
|
763
|
+
], Payment.prototype, "dateUpdated", void 0);
|
|
764
|
+
__decorate([
|
|
765
|
+
classTransformer.Expose({ name: 'authorized_amount' })
|
|
766
|
+
], Payment.prototype, "authorizedAmount", void 0);
|
|
767
|
+
__decorate([
|
|
768
|
+
classTransformer.Expose({ name: 'paid_amount' })
|
|
769
|
+
], Payment.prototype, "paidAmount", void 0);
|
|
770
|
+
__decorate([
|
|
771
|
+
classTransformer.Expose({ name: 'refunded_amount' })
|
|
772
|
+
], Payment.prototype, "refundedAmount", void 0);
|
|
773
|
+
__decorate([
|
|
774
|
+
classTransformer.Expose({ name: 'card_holder_name' })
|
|
775
|
+
], Payment.prototype, "cardHolderName", void 0);
|
|
776
|
+
__decorate([
|
|
777
|
+
classTransformer.Expose({ name: 'card_last_digits' })
|
|
778
|
+
], Payment.prototype, "cardLastDigits", void 0);
|
|
779
|
+
__decorate([
|
|
780
|
+
classTransformer.Expose({ name: 'card_first_digits' })
|
|
781
|
+
], Payment.prototype, "cardFirstDigits", void 0);
|
|
782
|
+
__decorate([
|
|
783
|
+
classTransformer.Expose({ name: 'card_brand' })
|
|
784
|
+
], Payment.prototype, "cardBrand", void 0);
|
|
785
|
+
__decorate([
|
|
786
|
+
classTransformer.Expose({ name: 'card_pin_mode' })
|
|
787
|
+
], Payment.prototype, "cardPinMode", void 0);
|
|
788
|
+
__decorate([
|
|
789
|
+
classTransformer.Expose({ name: 'card_magstripe_fallback' })
|
|
790
|
+
], Payment.prototype, "cardMagstripeFallback", void 0);
|
|
791
|
+
__decorate([
|
|
792
|
+
classTransformer.Expose({ name: 'cvm_pin' })
|
|
793
|
+
], Payment.prototype, "cvmPin", void 0);
|
|
794
|
+
__decorate([
|
|
795
|
+
classTransformer.Expose({ name: 'postback_url' })
|
|
796
|
+
], Payment.prototype, "postbackUrl", void 0);
|
|
797
|
+
__decorate([
|
|
798
|
+
classTransformer.Expose({ name: 'payment_method' })
|
|
799
|
+
], Payment.prototype, "paymentMethod", void 0);
|
|
800
|
+
__decorate([
|
|
801
|
+
classTransformer.Expose({ name: 'capture_method' })
|
|
802
|
+
], Payment.prototype, "captureMethod", void 0);
|
|
803
|
+
__decorate([
|
|
804
|
+
classTransformer.Expose({ name: 'antifraud_score' })
|
|
805
|
+
], Payment.prototype, "antifraudScore", void 0);
|
|
806
|
+
__decorate([
|
|
807
|
+
classTransformer.Expose({ name: 'boleto_url' })
|
|
808
|
+
], Payment.prototype, "boletoUrl", void 0);
|
|
809
|
+
__decorate([
|
|
810
|
+
classTransformer.Expose({ name: 'boleto_barcode' })
|
|
811
|
+
], Payment.prototype, "boletoBarcode", void 0);
|
|
812
|
+
__decorate([
|
|
813
|
+
classTransformer.Expose({ name: 'boleto_expiration_date' })
|
|
814
|
+
], Payment.prototype, "boletoExpirationDate", void 0);
|
|
815
|
+
__decorate([
|
|
816
|
+
classTransformer.Expose({ name: 'subscription_id' })
|
|
817
|
+
], Payment.prototype, "subscriptionId", void 0);
|
|
818
|
+
__decorate([
|
|
819
|
+
classTransformer.Expose({ name: 'split_rules' })
|
|
820
|
+
], Payment.prototype, "splitRules", void 0);
|
|
821
|
+
__decorate([
|
|
822
|
+
classTransformer.Expose({ name: 'antifraud_metadata' })
|
|
823
|
+
], Payment.prototype, "antifraudMetadata", void 0);
|
|
824
|
+
__decorate([
|
|
825
|
+
classTransformer.Expose({ name: 'reference_key' })
|
|
826
|
+
], Payment.prototype, "referenceKey", void 0);
|
|
827
|
+
__decorate([
|
|
828
|
+
classTransformer.Expose({ name: 'local_transaction_id' })
|
|
829
|
+
], Payment.prototype, "localTransactionId", void 0);
|
|
830
|
+
__decorate([
|
|
831
|
+
classTransformer.Expose({ name: 'local_time' })
|
|
832
|
+
], Payment.prototype, "localTime", void 0);
|
|
833
|
+
__decorate([
|
|
834
|
+
classTransformer.Expose({ name: 'fraud_covered' })
|
|
835
|
+
], Payment.prototype, "fraudCovered", void 0);
|
|
836
|
+
__decorate([
|
|
837
|
+
classTransformer.Expose({ name: 'fraud_reimbursed' })
|
|
838
|
+
], Payment.prototype, "fraudReimbursed", void 0);
|
|
839
|
+
__decorate([
|
|
840
|
+
classTransformer.Expose({ name: 'order_id' })
|
|
841
|
+
], Payment.prototype, "orderId", void 0);
|
|
842
|
+
__decorate([
|
|
843
|
+
classTransformer.Expose({ name: 'risk_level' })
|
|
844
|
+
], Payment.prototype, "riskLevel", void 0);
|
|
845
|
+
__decorate([
|
|
846
|
+
classTransformer.Expose({ name: 'receipt_url' })
|
|
847
|
+
], Payment.prototype, "receiptUrl", void 0);
|
|
848
|
+
__decorate([
|
|
849
|
+
classTransformer.Expose({ name: 'private_label' })
|
|
850
|
+
], Payment.prototype, "privateLabel", void 0);
|
|
851
|
+
__decorate([
|
|
852
|
+
classTransformer.Expose({ name: 'pix_qr_code' })
|
|
853
|
+
], Payment.prototype, "pixQrCode", void 0);
|
|
854
|
+
__decorate([
|
|
855
|
+
classTransformer.Expose({ name: 'pix_expiration_date' })
|
|
856
|
+
], Payment.prototype, "pixExpirationDate", void 0);
|
|
857
|
+
|
|
858
|
+
var ShippingMethod = /** @class */ (function (_super) {
|
|
859
|
+
__extends(ShippingMethod, _super);
|
|
860
|
+
function ShippingMethod() {
|
|
861
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
862
|
+
}
|
|
863
|
+
ShippingMethod.prototype.identifierFields = function () {
|
|
864
|
+
return ['id'];
|
|
865
|
+
};
|
|
866
|
+
return ShippingMethod;
|
|
867
|
+
}(BaseModel));
|
|
868
|
+
|
|
598
869
|
var InvalidArgumentError = /** @class */ (function (_super) {
|
|
599
870
|
__extends(InvalidArgumentError, _super);
|
|
600
871
|
function InvalidArgumentError(message) {
|
|
@@ -715,6 +986,8 @@
|
|
|
715
986
|
queryReference = queryReference.where(fieldName.toString(), '>=', options.value);
|
|
716
987
|
queryReference = queryReference.where(fieldName.toString(), '<=', options.value + "~");
|
|
717
988
|
}
|
|
989
|
+
if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
|
|
990
|
+
return queryReference;
|
|
718
991
|
return queryReference.where(fieldName.toString(), options.operator, options.value);
|
|
719
992
|
};
|
|
720
993
|
return _this;
|
|
@@ -1007,6 +1280,20 @@
|
|
|
1007
1280
|
return UserBeautyProfileFirestoreRepository;
|
|
1008
1281
|
}(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
|
|
1009
1282
|
|
|
1283
|
+
var UserAddressFirestoreRepository = /** @class */ (function (_super) {
|
|
1284
|
+
__extends(UserAddressFirestoreRepository, _super);
|
|
1285
|
+
function UserAddressFirestoreRepository(firestore, parentRepository) {
|
|
1286
|
+
var _this = _super.call(this) || this;
|
|
1287
|
+
_this.firestore = firestore;
|
|
1288
|
+
_this.parentRepository = parentRepository;
|
|
1289
|
+
_this.collectionName = 'address';
|
|
1290
|
+
_this.parentIdField = 'userId';
|
|
1291
|
+
_this.model = UserAddress;
|
|
1292
|
+
return _this;
|
|
1293
|
+
}
|
|
1294
|
+
return UserAddressFirestoreRepository;
|
|
1295
|
+
}(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
|
|
1296
|
+
|
|
1010
1297
|
var CategoryFirestoreRepository = /** @class */ (function (_super) {
|
|
1011
1298
|
__extends(CategoryFirestoreRepository, _super);
|
|
1012
1299
|
function CategoryFirestoreRepository(firestore) {
|
|
@@ -1045,6 +1332,54 @@
|
|
|
1045
1332
|
return ProductVariantFirestoreRepository;
|
|
1046
1333
|
}(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product)));
|
|
1047
1334
|
|
|
1335
|
+
var CheckoutFirestoreRepository = /** @class */ (function (_super) {
|
|
1336
|
+
__extends(CheckoutFirestoreRepository, _super);
|
|
1337
|
+
function CheckoutFirestoreRepository(firestore) {
|
|
1338
|
+
var _this = _super.call(this) || this;
|
|
1339
|
+
_this.firestore = firestore;
|
|
1340
|
+
_this.collectionName = 'checkouts';
|
|
1341
|
+
_this.model = Checkout;
|
|
1342
|
+
return _this;
|
|
1343
|
+
}
|
|
1344
|
+
return CheckoutFirestoreRepository;
|
|
1345
|
+
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1346
|
+
|
|
1347
|
+
var CouponFirestoreRepository = /** @class */ (function (_super) {
|
|
1348
|
+
__extends(CouponFirestoreRepository, _super);
|
|
1349
|
+
function CouponFirestoreRepository(firestore) {
|
|
1350
|
+
var _this = _super.call(this) || this;
|
|
1351
|
+
_this.firestore = firestore;
|
|
1352
|
+
_this.collectionName = 'coupons';
|
|
1353
|
+
_this.model = Coupon;
|
|
1354
|
+
return _this;
|
|
1355
|
+
}
|
|
1356
|
+
return CouponFirestoreRepository;
|
|
1357
|
+
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1358
|
+
|
|
1359
|
+
var OrderFirestoreRepository = /** @class */ (function (_super) {
|
|
1360
|
+
__extends(OrderFirestoreRepository, _super);
|
|
1361
|
+
function OrderFirestoreRepository(firestore) {
|
|
1362
|
+
var _this = _super.call(this) || this;
|
|
1363
|
+
_this.firestore = firestore;
|
|
1364
|
+
_this.collectionName = 'orders';
|
|
1365
|
+
_this.model = Order;
|
|
1366
|
+
return _this;
|
|
1367
|
+
}
|
|
1368
|
+
return OrderFirestoreRepository;
|
|
1369
|
+
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1370
|
+
|
|
1371
|
+
var PaymentFirestoreRepository = /** @class */ (function (_super) {
|
|
1372
|
+
__extends(PaymentFirestoreRepository, _super);
|
|
1373
|
+
function PaymentFirestoreRepository(firestore) {
|
|
1374
|
+
var _this = _super.call(this) || this;
|
|
1375
|
+
_this.firestore = firestore;
|
|
1376
|
+
_this.collectionName = 'payments';
|
|
1377
|
+
_this.model = Payment;
|
|
1378
|
+
return _this;
|
|
1379
|
+
}
|
|
1380
|
+
return PaymentFirestoreRepository;
|
|
1381
|
+
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1382
|
+
|
|
1048
1383
|
var AuthenticationFirebaseAuthService = /** @class */ (function () {
|
|
1049
1384
|
function AuthenticationFirebaseAuthService(firebaseAuth) {
|
|
1050
1385
|
this.firebaseAuth = firebaseAuth;
|
|
@@ -1112,6 +1447,7 @@
|
|
|
1112
1447
|
enumerable: true,
|
|
1113
1448
|
get: function () { return lodash.isString; }
|
|
1114
1449
|
});
|
|
1450
|
+
exports.Address = Address;
|
|
1115
1451
|
exports.Authentication = Authentication;
|
|
1116
1452
|
exports.AuthenticationFirebaseAuthService = AuthenticationFirebaseAuthService;
|
|
1117
1453
|
exports.Base = Base;
|
|
@@ -1119,19 +1455,32 @@
|
|
|
1119
1455
|
exports.BeautyProfile = BeautyProfile;
|
|
1120
1456
|
exports.Category = Category;
|
|
1121
1457
|
exports.CategoryFirestoreRepository = CategoryFirestoreRepository;
|
|
1458
|
+
exports.Checkout = Checkout;
|
|
1459
|
+
exports.CheckoutFirestoreRepository = CheckoutFirestoreRepository;
|
|
1460
|
+
exports.Coupon = Coupon;
|
|
1461
|
+
exports.CouponFirestoreRepository = CouponFirestoreRepository;
|
|
1122
1462
|
exports.Edition = Edition;
|
|
1463
|
+
exports.FinancialCoupon = FinancialCoupon;
|
|
1123
1464
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
1465
|
+
exports.LineItem = LineItem;
|
|
1124
1466
|
exports.NotFoundError = NotFoundError;
|
|
1467
|
+
exports.Order = Order;
|
|
1468
|
+
exports.OrderFirestoreRepository = OrderFirestoreRepository;
|
|
1469
|
+
exports.Payment = Payment;
|
|
1470
|
+
exports.PaymentFirestoreRepository = PaymentFirestoreRepository;
|
|
1125
1471
|
exports.Product = Product;
|
|
1126
1472
|
exports.ProductFirestoreRepository = ProductFirestoreRepository;
|
|
1127
1473
|
exports.ProductVariantFirestoreRepository = ProductVariantFirestoreRepository;
|
|
1128
1474
|
exports.RequiredArgumentError = RequiredArgumentError;
|
|
1475
|
+
exports.ShippingMethod = ShippingMethod;
|
|
1129
1476
|
exports.SignOut = SignOut;
|
|
1130
1477
|
exports.Subscription = Subscription;
|
|
1131
1478
|
exports.SubscriptionEditionFirestoreRepository = SubscriptionEditionFirestoreRepository;
|
|
1132
1479
|
exports.SubscriptionFirestoreRepository = SubscriptionFirestoreRepository;
|
|
1133
1480
|
exports.UnauthorizedError = UnauthorizedError;
|
|
1134
1481
|
exports.User = User;
|
|
1482
|
+
exports.UserAddress = UserAddress;
|
|
1483
|
+
exports.UserAddressFirestoreRepository = UserAddressFirestoreRepository;
|
|
1135
1484
|
exports.UserBeautyProfileFirestoreRepository = UserBeautyProfileFirestoreRepository;
|
|
1136
1485
|
exports.UserFirestoreRepository = UserFirestoreRepository;
|
|
1137
1486
|
exports.Variant = Variant;
|