@infrab4a/connect 0.4.3 → 0.4.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/README.md +24 -24
- package/bundles/infrab4a-connect.umd.js +1464 -1460
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/esm2015/infrab4a-connect.js +4 -4
- package/esm2015/lib/domain/catalog/index.js +3 -3
- package/esm2015/lib/domain/catalog/models/category.js +7 -7
- package/esm2015/lib/domain/catalog/models/enums/index.js +2 -2
- package/esm2015/lib/domain/catalog/models/enums/shops.enum.js +6 -6
- package/esm2015/lib/domain/catalog/models/index.js +6 -6
- package/esm2015/lib/domain/catalog/models/product.js +7 -7
- package/esm2015/lib/domain/catalog/models/types/category-condition.type.js +2 -2
- package/esm2015/lib/domain/catalog/models/types/category-filter.type.js +2 -2
- package/esm2015/lib/domain/catalog/models/types/index.js +8 -8
- package/esm2015/lib/domain/catalog/models/types/product-review.type.js +2 -2
- package/esm2015/lib/domain/catalog/models/types/shops-description.type.js +2 -2
- package/esm2015/lib/domain/catalog/models/types/shops-price.type.js +2 -2
- package/esm2015/lib/domain/catalog/models/types/stock.type.js +2 -2
- package/esm2015/lib/domain/catalog/models/types/variant-grade.type.js +2 -2
- package/esm2015/lib/domain/catalog/models/variant.js +7 -7
- package/esm2015/lib/domain/catalog/repositories/category.repository.js +2 -2
- package/esm2015/lib/domain/catalog/repositories/index.js +4 -4
- package/esm2015/lib/domain/catalog/repositories/product.repository.js +2 -2
- package/esm2015/lib/domain/catalog/repositories/variant.repository.js +2 -2
- package/esm2015/lib/domain/general/index.js +3 -3
- package/esm2015/lib/domain/general/model/base-model-with-identifier-fields.js +2 -2
- package/esm2015/lib/domain/general/model/base.model.js +13 -13
- package/esm2015/lib/domain/general/model/identifier-fields.js +2 -2
- package/esm2015/lib/domain/general/model/index.js +5 -5
- package/esm2015/lib/domain/general/model/types/base-model-builder.type.js +2 -2
- package/esm2015/lib/domain/general/model/types/index.js +4 -4
- package/esm2015/lib/domain/general/model/types/non-function-properties.type.js +2 -2
- package/esm2015/lib/domain/general/model/types/non-function-property-name.type.js +2 -2
- package/esm2015/lib/domain/general/repository/create.repository.js +2 -2
- package/esm2015/lib/domain/general/repository/crud.repository.js +2 -2
- package/esm2015/lib/domain/general/repository/delete.repository.js +2 -2
- package/esm2015/lib/domain/general/repository/enums/index.js +3 -3
- package/esm2015/lib/domain/general/repository/enums/update-option-actions.enum.js +9 -9
- package/esm2015/lib/domain/general/repository/enums/where.enum.js +11 -11
- package/esm2015/lib/domain/general/repository/find.repository.js +2 -2
- package/esm2015/lib/domain/general/repository/get.repository.js +2 -2
- package/esm2015/lib/domain/general/repository/index.js +10 -10
- package/esm2015/lib/domain/general/repository/read.repository.js +2 -2
- package/esm2015/lib/domain/general/repository/types/index.js +6 -6
- package/esm2015/lib/domain/general/repository/types/repository-find-filters.type.js +2 -2
- package/esm2015/lib/domain/general/repository/types/repository-find-result.type.js +2 -2
- package/esm2015/lib/domain/general/repository/types/repository-limit-options.type.js +2 -2
- package/esm2015/lib/domain/general/repository/types/repository-order-by-list.type.js +2 -2
- package/esm2015/lib/domain/general/repository/types/repository-update-params.type.js +2 -2
- package/esm2015/lib/domain/general/repository/update.repository.js +2 -2
- package/esm2015/lib/domain/index.js +7 -7
- package/esm2015/lib/domain/location/index.js +2 -2
- package/esm2015/lib/domain/location/models/address.js +4 -4
- package/esm2015/lib/domain/location/models/index.js +3 -3
- package/esm2015/lib/domain/location/models/types/index.js +4 -4
- package/esm2015/lib/domain/location/models/types/location-bound.type.js +2 -2
- package/esm2015/lib/domain/location/models/types/location-geometry.type.js +2 -2
- package/esm2015/lib/domain/location/models/types/location-lat-lng.type.js +2 -2
- package/esm2015/lib/domain/shop-settings/index.js +3 -3
- package/esm2015/lib/domain/shop-settings/models/home.js +7 -7
- package/esm2015/lib/domain/shop-settings/models/index.js +4 -4
- package/esm2015/lib/domain/shop-settings/models/shop-menu.js +7 -7
- package/esm2015/lib/domain/shop-settings/models/types/banner.type.js +2 -2
- package/esm2015/lib/domain/shop-settings/models/types/benefit.type.js +2 -2
- package/esm2015/lib/domain/shop-settings/models/types/index.js +5 -5
- package/esm2015/lib/domain/shop-settings/models/types/menu-nav.type.js +2 -2
- package/esm2015/lib/domain/shop-settings/models/types/sub-menu.type.js +2 -2
- package/esm2015/lib/domain/shop-settings/repositories/home.repository.js +2 -2
- package/esm2015/lib/domain/shop-settings/repositories/index.js +3 -3
- package/esm2015/lib/domain/shop-settings/repositories/shop-menu.repository.js +2 -2
- package/esm2015/lib/domain/shopping/index.js +3 -3
- package/esm2015/lib/domain/shopping/models/buy-2-win.js +7 -7
- package/esm2015/lib/domain/shopping/models/checkout.js +7 -7
- package/esm2015/lib/domain/shopping/models/coupons/coupon.js +15 -15
- package/esm2015/lib/domain/shopping/models/coupons/enums/coupon-subtypes.enum.js +6 -6
- package/esm2015/lib/domain/shopping/models/coupons/enums/coupon-types.enum.js +8 -8
- package/esm2015/lib/domain/shopping/models/coupons/enums/exclusivities.enum.js +7 -7
- package/esm2015/lib/domain/shopping/models/coupons/enums/index.js +4 -4
- package/esm2015/lib/domain/shopping/models/coupons/financial-coupon.js +28 -28
- package/esm2015/lib/domain/shopping/models/coupons/index.js +4 -4
- package/esm2015/lib/domain/shopping/models/enums/checkout-types.enum.js +6 -6
- package/esm2015/lib/domain/shopping/models/enums/index.js +3 -3
- package/esm2015/lib/domain/shopping/models/enums/order-status.enum.js +12 -12
- package/esm2015/lib/domain/shopping/models/index.js +12 -12
- package/esm2015/lib/domain/shopping/models/line-item.js +4 -4
- package/esm2015/lib/domain/shopping/models/order.js +4 -4
- package/esm2015/lib/domain/shopping/models/payment.js +129 -129
- package/esm2015/lib/domain/shopping/models/shipping-method.js +7 -7
- package/esm2015/lib/domain/shopping/models/subscription/checkout.js +7 -7
- package/esm2015/lib/domain/shopping/models/subscription/index.js +3 -3
- package/esm2015/lib/domain/shopping/models/subscription/plan.js +7 -7
- package/esm2015/lib/domain/shopping/models/types/index.js +8 -8
- package/esm2015/lib/domain/shopping/models/types/payment-address.type.js +2 -2
- package/esm2015/lib/domain/shopping/models/types/payment-billing.type.js +2 -2
- package/esm2015/lib/domain/shopping/models/types/payment-card.type.js +2 -2
- package/esm2015/lib/domain/shopping/models/types/payment-customer.type.js +2 -2
- package/esm2015/lib/domain/shopping/models/types/payment-document.type.js +2 -2
- package/esm2015/lib/domain/shopping/models/types/payment-item.type.js +2 -2
- package/esm2015/lib/domain/shopping/models/types/payment-shipping.type.js +2 -2
- package/esm2015/lib/domain/shopping/repositories/buy-2-win.repository.js +2 -2
- package/esm2015/lib/domain/shopping/repositories/checkout.repository.js +2 -2
- package/esm2015/lib/domain/shopping/repositories/coupon.repository.js +2 -2
- package/esm2015/lib/domain/shopping/repositories/index.js +7 -7
- package/esm2015/lib/domain/shopping/repositories/order.repository.js +2 -2
- package/esm2015/lib/domain/shopping/repositories/payment.repository.js +2 -2
- package/esm2015/lib/domain/shopping/repositories/subscription/checkout.repository.js +2 -2
- package/esm2015/lib/domain/shopping/repositories/subscription/index.js +3 -3
- package/esm2015/lib/domain/shopping/repositories/subscription/plan.repository.js +2 -2
- package/esm2015/lib/domain/users/errors/index.js +2 -2
- package/esm2015/lib/domain/users/errors/unauthorized.error.js +7 -7
- package/esm2015/lib/domain/users/index.js +6 -6
- package/esm2015/lib/domain/users/models/beauty-profile.js +12 -12
- package/esm2015/lib/domain/users/models/enums/area.enum.js +13 -13
- package/esm2015/lib/domain/users/models/enums/beard-sizes.enum.js +9 -9
- package/esm2015/lib/domain/users/models/enums/hair-types.enum.js +9 -9
- package/esm2015/lib/domain/users/models/enums/index.js +7 -7
- package/esm2015/lib/domain/users/models/enums/office-position.enum.js +8 -8
- package/esm2015/lib/domain/users/models/enums/user-type.enum.js +10 -10
- package/esm2015/lib/domain/users/models/index.js +6 -6
- package/esm2015/lib/domain/users/models/subscription/edition.js +7 -7
- package/esm2015/lib/domain/users/models/subscription/enums/billing-status.enum.js +5 -5
- package/esm2015/lib/domain/users/models/subscription/enums/edition-status.enum.js +5 -5
- package/esm2015/lib/domain/users/models/subscription/enums/index.js +5 -5
- package/esm2015/lib/domain/users/models/subscription/enums/payment-type.enum.js +7 -7
- package/esm2015/lib/domain/users/models/subscription/enums/status.enum.js +5 -5
- package/esm2015/lib/domain/users/models/subscription/index.js +5 -5
- package/esm2015/lib/domain/users/models/subscription/payment.js +7 -7
- package/esm2015/lib/domain/users/models/subscription/subscription.js +7 -7
- package/esm2015/lib/domain/users/models/user-address.js +7 -7
- package/esm2015/lib/domain/users/models/user.js +17 -17
- package/esm2015/lib/domain/users/repositories/beauty-profile.repository.js +2 -2
- package/esm2015/lib/domain/users/repositories/edition.repository.js +2 -2
- package/esm2015/lib/domain/users/repositories/index.js +7 -7
- package/esm2015/lib/domain/users/repositories/subscription-payment.repository.js +2 -2
- package/esm2015/lib/domain/users/repositories/subscription.repository.js +2 -2
- package/esm2015/lib/domain/users/repositories/user-address.repository.js +2 -2
- package/esm2015/lib/domain/users/repositories/user.repository.js +2 -2
- package/esm2015/lib/domain/users/services/authentication.service.js +2 -2
- package/esm2015/lib/domain/users/services/index.js +2 -2
- package/esm2015/lib/domain/users/use-cases/authentication.js +40 -40
- package/esm2015/lib/domain/users/use-cases/index.js +3 -3
- package/esm2015/lib/domain/users/use-cases/signout.js +12 -12
- package/esm2015/lib/errors/index.js +4 -4
- package/esm2015/lib/errors/invalid-argument.error.js +7 -7
- package/esm2015/lib/errors/not-found.error.js +7 -7
- package/esm2015/lib/errors/required-argument.error.js +8 -8
- package/esm2015/lib/index.js +5 -5
- package/esm2015/lib/infra/firebase/auth/authentication-firebase-auth.service.js +27 -27
- package/esm2015/lib/infra/firebase/auth/index.js +2 -2
- package/esm2015/lib/infra/firebase/firestore/index.js +4 -4
- package/esm2015/lib/infra/firebase/firestore/mixins/index.js +10 -10
- package/esm2015/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +30 -30
- package/esm2015/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +10 -10
- package/esm2015/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +18 -18
- package/esm2015/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +64 -62
- package/esm2015/lib/infra/firebase/firestore/mixins/with-firestore.mixin.js +26 -26
- package/esm2015/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +24 -24
- package/esm2015/lib/infra/firebase/firestore/mixins/with-helpers.mixin.js +17 -17
- package/esm2015/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +11 -11
- package/esm2015/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +45 -43
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +12 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/index.js +4 -4
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +12 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.js +14 -14
- package/esm2015/lib/infra/firebase/firestore/repositories/index.js +5 -5
- package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.js +12 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/index.js +3 -3
- package/esm2015/lib/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.js +12 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.js +12 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.js +12 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.js +12 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.js +12 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/index.js +8 -8
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.js +12 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.js +12 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.js +12 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/users/index.js +7 -7
- package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.js +14 -14
- package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.js +12 -12
- package/esm2015/lib/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.js +14 -14
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +14 -14
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.js +14 -14
- package/esm2015/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.js +40 -40
- package/esm2015/lib/infra/firebase/firestore/types/firestore-sub.repository.type.js +2 -2
- package/esm2015/lib/infra/firebase/firestore/types/firestore.helpers.type.js +2 -2
- package/esm2015/lib/infra/firebase/firestore/types/firestore.repository.type.js +2 -2
- package/esm2015/lib/infra/firebase/firestore/types/index.js +4 -4
- package/esm2015/lib/infra/firebase/index.js +3 -3
- package/esm2015/lib/infra/index.js +2 -2
- package/esm2015/lib/utils/index.js +5 -5
- package/esm2015/lib/utils/mixins/base.mixin.js +6 -6
- package/esm2015/lib/utils/mixins/index.js +3 -3
- package/esm2015/lib/utils/mixins/mixin-ctor.type.js +2 -2
- package/esm2015/lib/utils/types/index.js +2 -2
- package/esm2015/lib/utils/types/prop.type.js +2 -2
- package/esm2015/public-api.js +2 -2
- package/fesm2015/infrab4a-connect.js +901 -897
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/infrab4a-connect.d.ts +5 -5
- package/lib/domain/catalog/index.d.ts +2 -2
- package/lib/domain/catalog/models/category.d.ts +20 -20
- package/lib/domain/catalog/models/enums/index.d.ts +1 -1
- package/lib/domain/catalog/models/enums/shops.enum.d.ts +4 -4
- package/lib/domain/catalog/models/index.d.ts +5 -5
- package/lib/domain/catalog/models/product.d.ts +31 -31
- package/lib/domain/catalog/models/types/category-condition.type.d.ts +4 -4
- package/lib/domain/catalog/models/types/category-filter.type.d.ts +4 -4
- package/lib/domain/catalog/models/types/index.d.ts +7 -7
- package/lib/domain/catalog/models/types/product-review.type.d.ts +12 -12
- package/lib/domain/catalog/models/types/shops-description.type.d.ts +7 -7
- package/lib/domain/catalog/models/types/shops-price.type.d.ts +10 -10
- package/lib/domain/catalog/models/types/stock.type.d.ts +3 -3
- package/lib/domain/catalog/models/types/variant-grade.type.d.ts +4 -4
- package/lib/domain/catalog/models/variant.d.ts +12 -12
- package/lib/domain/catalog/repositories/category.repository.d.ts +4 -4
- package/lib/domain/catalog/repositories/index.d.ts +3 -3
- package/lib/domain/catalog/repositories/product.repository.d.ts +4 -4
- package/lib/domain/catalog/repositories/variant.repository.d.ts +4 -4
- package/lib/domain/general/index.d.ts +2 -2
- package/lib/domain/general/model/base-model-with-identifier-fields.d.ts +3 -3
- package/lib/domain/general/model/base.model.d.ts +6 -6
- package/lib/domain/general/model/identifier-fields.d.ts +4 -4
- package/lib/domain/general/model/index.d.ts +4 -4
- package/lib/domain/general/model/types/base-model-builder.type.d.ts +5 -5
- package/lib/domain/general/model/types/index.d.ts +3 -3
- package/lib/domain/general/model/types/non-function-properties.type.d.ts +2 -2
- package/lib/domain/general/model/types/non-function-property-name.type.d.ts +3 -3
- package/lib/domain/general/repository/create.repository.d.ts +5 -5
- package/lib/domain/general/repository/crud.repository.d.ts +7 -7
- package/lib/domain/general/repository/delete.repository.d.ts +5 -5
- package/lib/domain/general/repository/enums/index.d.ts +2 -2
- package/lib/domain/general/repository/enums/update-option-actions.enum.d.ts +7 -7
- package/lib/domain/general/repository/enums/where.enum.d.ts +9 -9
- package/lib/domain/general/repository/find.repository.d.ts +5 -5
- package/lib/domain/general/repository/get.repository.d.ts +5 -5
- package/lib/domain/general/repository/index.d.ts +9 -9
- package/lib/domain/general/repository/read.repository.d.ts +5 -5
- package/lib/domain/general/repository/types/index.d.ts +5 -5
- package/lib/domain/general/repository/types/repository-find-filters.type.d.ts +10 -10
- package/lib/domain/general/repository/types/repository-find-result.type.d.ts +4 -4
- package/lib/domain/general/repository/types/repository-limit-options.type.d.ts +4 -4
- package/lib/domain/general/repository/types/repository-order-by-list.type.d.ts +5 -5
- package/lib/domain/general/repository/types/repository-update-params.type.d.ts +11 -11
- package/lib/domain/general/repository/update.repository.d.ts +5 -5
- package/lib/domain/index.d.ts +6 -6
- package/lib/domain/location/index.d.ts +1 -1
- package/lib/domain/location/models/address.d.ts +21 -21
- package/lib/domain/location/models/index.d.ts +2 -2
- package/lib/domain/location/models/types/index.d.ts +3 -3
- package/lib/domain/location/models/types/location-bound.type.d.ts +6 -6
- package/lib/domain/location/models/types/location-geometry.type.d.ts +7 -7
- package/lib/domain/location/models/types/location-lat-lng.type.d.ts +4 -4
- package/lib/domain/shop-settings/index.d.ts +2 -2
- package/lib/domain/shop-settings/models/home.d.ts +17 -17
- package/lib/domain/shop-settings/models/index.d.ts +3 -3
- package/lib/domain/shop-settings/models/shop-menu.d.ts +7 -7
- package/lib/domain/shop-settings/models/types/banner.type.d.ts +6 -6
- package/lib/domain/shop-settings/models/types/benefit.type.d.ts +5 -5
- package/lib/domain/shop-settings/models/types/index.d.ts +4 -4
- package/lib/domain/shop-settings/models/types/menu-nav.type.d.ts +8 -8
- package/lib/domain/shop-settings/models/types/sub-menu.type.d.ts +8 -8
- package/lib/domain/shop-settings/repositories/home.repository.d.ts +4 -4
- package/lib/domain/shop-settings/repositories/index.d.ts +2 -2
- package/lib/domain/shop-settings/repositories/shop-menu.repository.d.ts +4 -4
- package/lib/domain/shopping/index.d.ts +2 -2
- package/lib/domain/shopping/models/buy-2-win.d.ts +18 -18
- package/lib/domain/shopping/models/checkout.d.ts +28 -28
- package/lib/domain/shopping/models/coupons/coupon.d.ts +25 -25
- package/lib/domain/shopping/models/coupons/enums/coupon-subtypes.enum.d.ts +4 -4
- package/lib/domain/shopping/models/coupons/enums/coupon-types.enum.d.ts +6 -6
- package/lib/domain/shopping/models/coupons/enums/exclusivities.enum.d.ts +5 -5
- package/lib/domain/shopping/models/coupons/enums/index.d.ts +3 -3
- package/lib/domain/shopping/models/coupons/financial-coupon.d.ts +8 -8
- package/lib/domain/shopping/models/coupons/index.d.ts +3 -3
- package/lib/domain/shopping/models/enums/checkout-types.enum.d.ts +4 -4
- package/lib/domain/shopping/models/enums/index.d.ts +2 -2
- package/lib/domain/shopping/models/enums/order-status.enum.d.ts +10 -10
- package/lib/domain/shopping/models/index.d.ts +11 -11
- package/lib/domain/shopping/models/line-item.d.ts +7 -7
- package/lib/domain/shopping/models/order.d.ts +7 -7
- package/lib/domain/shopping/models/payment.d.ts +69 -69
- package/lib/domain/shopping/models/shipping-method.d.ts +18 -18
- package/lib/domain/shopping/models/subscription/checkout.d.ts +23 -23
- package/lib/domain/shopping/models/subscription/index.d.ts +2 -2
- package/lib/domain/shopping/models/subscription/plan.d.ts +12 -12
- package/lib/domain/shopping/models/types/index.d.ts +7 -7
- package/lib/domain/shopping/models/types/payment-address.type.d.ts +12 -12
- package/lib/domain/shopping/models/types/payment-billing.type.d.ts +7 -7
- package/lib/domain/shopping/models/types/payment-card.type.d.ts +14 -14
- package/lib/domain/shopping/models/types/payment-customer.type.d.ts +18 -18
- package/lib/domain/shopping/models/types/payment-document.type.d.ts +6 -6
- package/lib/domain/shopping/models/types/payment-item.type.d.ts +11 -11
- package/lib/domain/shopping/models/types/payment-shipping.type.d.ts +10 -10
- package/lib/domain/shopping/repositories/buy-2-win.repository.d.ts +4 -4
- package/lib/domain/shopping/repositories/checkout.repository.d.ts +4 -4
- package/lib/domain/shopping/repositories/coupon.repository.d.ts +4 -4
- package/lib/domain/shopping/repositories/index.d.ts +6 -6
- package/lib/domain/shopping/repositories/order.repository.d.ts +4 -4
- package/lib/domain/shopping/repositories/payment.repository.d.ts +4 -4
- package/lib/domain/shopping/repositories/subscription/checkout.repository.d.ts +4 -4
- package/lib/domain/shopping/repositories/subscription/index.d.ts +2 -2
- package/lib/domain/shopping/repositories/subscription/plan.repository.d.ts +4 -4
- package/lib/domain/users/errors/index.d.ts +1 -1
- package/lib/domain/users/errors/unauthorized.error.d.ts +4 -4
- package/lib/domain/users/index.d.ts +5 -5
- package/lib/domain/users/models/beauty-profile.d.ts +12 -12
- package/lib/domain/users/models/enums/area.enum.d.ts +11 -11
- package/lib/domain/users/models/enums/beard-sizes.enum.d.ts +7 -7
- package/lib/domain/users/models/enums/hair-types.enum.d.ts +7 -7
- package/lib/domain/users/models/enums/index.d.ts +6 -6
- package/lib/domain/users/models/enums/office-position.enum.d.ts +6 -6
- package/lib/domain/users/models/enums/user-type.enum.d.ts +8 -8
- package/lib/domain/users/models/index.d.ts +5 -5
- package/lib/domain/users/models/subscription/edition.d.ts +15 -15
- package/lib/domain/users/models/subscription/enums/billing-status.enum.d.ts +3 -3
- package/lib/domain/users/models/subscription/enums/edition-status.enum.d.ts +3 -3
- package/lib/domain/users/models/subscription/enums/index.d.ts +4 -4
- package/lib/domain/users/models/subscription/enums/payment-type.enum.d.ts +5 -5
- package/lib/domain/users/models/subscription/enums/status.enum.d.ts +3 -3
- package/lib/domain/users/models/subscription/index.d.ts +4 -4
- package/lib/domain/users/models/subscription/payment.d.ts +14 -14
- package/lib/domain/users/models/subscription/subscription.d.ts +30 -30
- package/lib/domain/users/models/user-address.d.ts +7 -7
- package/lib/domain/users/models/user.d.ts +23 -23
- package/lib/domain/users/repositories/beauty-profile.repository.d.ts +4 -4
- package/lib/domain/users/repositories/edition.repository.d.ts +4 -4
- package/lib/domain/users/repositories/index.d.ts +6 -6
- package/lib/domain/users/repositories/subscription-payment.repository.d.ts +4 -4
- package/lib/domain/users/repositories/subscription.repository.d.ts +4 -4
- package/lib/domain/users/repositories/user-address.repository.d.ts +4 -4
- package/lib/domain/users/repositories/user.repository.d.ts +4 -4
- package/lib/domain/users/services/authentication.service.d.ts +10 -10
- package/lib/domain/users/services/index.d.ts +1 -1
- package/lib/domain/users/use-cases/authentication.d.ts +21 -21
- package/lib/domain/users/use-cases/index.d.ts +2 -2
- package/lib/domain/users/use-cases/signout.d.ts +6 -6
- package/lib/errors/index.d.ts +3 -3
- package/lib/errors/invalid-argument.error.d.ts +4 -4
- package/lib/errors/not-found.error.d.ts +4 -4
- package/lib/errors/required-argument.error.d.ts +5 -5
- package/lib/index.d.ts +4 -4
- package/lib/infra/firebase/auth/authentication-firebase-auth.service.d.ts +9 -9
- package/lib/infra/firebase/auth/index.d.ts +1 -1
- package/lib/infra/firebase/firestore/index.d.ts +3 -3
- package/lib/infra/firebase/firestore/mixins/index.d.ts +9 -9
- package/lib/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +17 -17
- package/lib/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +29 -29
- package/lib/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +15 -15
- package/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +20 -20
- package/lib/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +15 -15
- package/lib/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +15 -15
- package/lib/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +10 -10
- package/lib/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +14 -14
- package/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +16 -16
- package/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +49 -49
- package/lib/infra/firebase/firestore/repositories/catalog/index.d.ts +3 -3
- package/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +49 -49
- package/lib/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +60 -60
- package/lib/infra/firebase/firestore/repositories/index.d.ts +4 -4
- package/lib/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +49 -49
- package/lib/infra/firebase/firestore/repositories/shop-settings/index.d.ts +2 -2
- package/lib/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +49 -49
- package/lib/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +49 -49
- package/lib/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +49 -49
- package/lib/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +49 -49
- package/lib/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +49 -49
- package/lib/infra/firebase/firestore/repositories/shopping/index.d.ts +7 -7
- package/lib/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +49 -49
- package/lib/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +49 -49
- package/lib/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +49 -49
- package/lib/infra/firebase/firestore/repositories/users/index.d.ts +6 -6
- package/lib/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +60 -60
- package/lib/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +49 -49
- package/lib/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +60 -60
- package/lib/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +60 -60
- package/lib/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +60 -60
- package/lib/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +52 -52
- package/lib/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +6 -6
- package/lib/infra/firebase/firestore/types/firestore.helpers.type.d.ts +8 -8
- package/lib/infra/firebase/firestore/types/firestore.repository.type.d.ts +8 -8
- package/lib/infra/firebase/firestore/types/index.d.ts +3 -3
- package/lib/infra/firebase/index.d.ts +2 -2
- package/lib/infra/index.d.ts +1 -1
- package/lib/utils/index.d.ts +4 -4
- package/lib/utils/mixins/base.mixin.d.ts +3 -3
- package/lib/utils/mixins/index.d.ts +2 -2
- package/lib/utils/mixins/mixin-ctor.type.d.ts +1 -1
- package/lib/utils/types/index.d.ts +1 -1
- package/lib/utils/types/prop.type.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
|
@@ -9,1618 +9,1622 @@
|
|
|
9
9
|
var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
|
|
10
10
|
var firebase__default$1 = /*#__PURE__*/_interopDefaultLegacy(firebase$1);
|
|
11
11
|
|
|
12
|
-
var BaseModel = /** @class */ (function () {
|
|
13
|
-
function BaseModel(args) {
|
|
14
|
-
Object.assign(this, args);
|
|
15
|
-
}
|
|
16
|
-
BaseModel.toInstance = function (data) {
|
|
17
|
-
return classTransformer.plainToClass(this, data);
|
|
18
|
-
};
|
|
19
|
-
BaseModel.prototype.toPlain = function () {
|
|
20
|
-
return classTransformer.classToPlain(this, { exposeUnsetFields: false });
|
|
21
|
-
};
|
|
22
|
-
return BaseModel;
|
|
12
|
+
var BaseModel = /** @class */ (function () {
|
|
13
|
+
function BaseModel(args) {
|
|
14
|
+
Object.assign(this, args);
|
|
15
|
+
}
|
|
16
|
+
BaseModel.toInstance = function (data) {
|
|
17
|
+
return classTransformer.plainToClass(this, data);
|
|
18
|
+
};
|
|
19
|
+
BaseModel.prototype.toPlain = function () {
|
|
20
|
+
return classTransformer.classToPlain(this, { exposeUnsetFields: false });
|
|
21
|
+
};
|
|
22
|
+
return BaseModel;
|
|
23
23
|
}());
|
|
24
24
|
|
|
25
|
-
exports.Where = void 0;
|
|
26
|
-
(function (Where) {
|
|
27
|
-
Where["EQUALS"] = "==";
|
|
28
|
-
Where["GT"] = ">";
|
|
29
|
-
Where["GTE"] = ">=";
|
|
30
|
-
Where["IN"] = "in";
|
|
31
|
-
Where["LT"] = "<";
|
|
32
|
-
Where["LTE"] = "<=";
|
|
33
|
-
Where["LIKE"] = "like";
|
|
25
|
+
exports.Where = void 0;
|
|
26
|
+
(function (Where) {
|
|
27
|
+
Where["EQUALS"] = "==";
|
|
28
|
+
Where["GT"] = ">";
|
|
29
|
+
Where["GTE"] = ">=";
|
|
30
|
+
Where["IN"] = "in";
|
|
31
|
+
Where["LT"] = "<";
|
|
32
|
+
Where["LTE"] = "<=";
|
|
33
|
+
Where["LIKE"] = "like";
|
|
34
34
|
})(exports.Where || (exports.Where = {}));
|
|
35
35
|
|
|
36
|
-
exports.UpdateOptionActions = void 0;
|
|
37
|
-
(function (UpdateOptionActions) {
|
|
38
|
-
UpdateOptionActions["UPDATE"] = "update";
|
|
39
|
-
UpdateOptionActions["MERGE"] = "merge";
|
|
40
|
-
UpdateOptionActions["REMOVE"] = "remove";
|
|
41
|
-
UpdateOptionActions["REMOVE_FIELD"] = "removeField";
|
|
42
|
-
UpdateOptionActions["NULL"] = "null";
|
|
36
|
+
exports.UpdateOptionActions = void 0;
|
|
37
|
+
(function (UpdateOptionActions) {
|
|
38
|
+
UpdateOptionActions["UPDATE"] = "update";
|
|
39
|
+
UpdateOptionActions["MERGE"] = "merge";
|
|
40
|
+
UpdateOptionActions["REMOVE"] = "remove";
|
|
41
|
+
UpdateOptionActions["REMOVE_FIELD"] = "removeField";
|
|
42
|
+
UpdateOptionActions["NULL"] = "null";
|
|
43
43
|
})(exports.UpdateOptionActions || (exports.UpdateOptionActions = {}));
|
|
44
44
|
|
|
45
|
-
exports.UserType = void 0;
|
|
46
|
-
(function (UserType) {
|
|
47
|
-
UserType["B2C"] = "Cliente Transacional";
|
|
48
|
-
UserType["GlamGirl"] = "Glamgirl";
|
|
49
|
-
UserType["MensBoy"] = "Mensboy";
|
|
50
|
-
UserType["B2B"] = "Company";
|
|
51
|
-
UserType["Collaborator"] = "Funcion\u00E1rio";
|
|
52
|
-
UserType["Influencer"] = "Influencer";
|
|
45
|
+
exports.UserType = void 0;
|
|
46
|
+
(function (UserType) {
|
|
47
|
+
UserType["B2C"] = "Cliente Transacional";
|
|
48
|
+
UserType["GlamGirl"] = "Glamgirl";
|
|
49
|
+
UserType["MensBoy"] = "Mensboy";
|
|
50
|
+
UserType["B2B"] = "Company";
|
|
51
|
+
UserType["Collaborator"] = "Funcion\u00E1rio";
|
|
52
|
+
UserType["Influencer"] = "Influencer";
|
|
53
53
|
})(exports.UserType || (exports.UserType = {}));
|
|
54
54
|
|
|
55
|
-
exports.BeardSizes = void 0;
|
|
56
|
-
(function (BeardSizes) {
|
|
57
|
-
BeardSizes["BIG"] = "Grande";
|
|
58
|
-
BeardSizes["MEDIUM"] = "M\u00E9dia";
|
|
59
|
-
BeardSizes["SHORT"] = "Curta";
|
|
60
|
-
BeardSizes["MUSTACHE"] = "Bigode";
|
|
61
|
-
BeardSizes["NOTHING"] = "Sem Barba";
|
|
55
|
+
exports.BeardSizes = void 0;
|
|
56
|
+
(function (BeardSizes) {
|
|
57
|
+
BeardSizes["BIG"] = "Grande";
|
|
58
|
+
BeardSizes["MEDIUM"] = "M\u00E9dia";
|
|
59
|
+
BeardSizes["SHORT"] = "Curta";
|
|
60
|
+
BeardSizes["MUSTACHE"] = "Bigode";
|
|
61
|
+
BeardSizes["NOTHING"] = "Sem Barba";
|
|
62
62
|
})(exports.BeardSizes || (exports.BeardSizes = {}));
|
|
63
63
|
|
|
64
|
-
exports.HairTypes = void 0;
|
|
65
|
-
(function (HairTypes) {
|
|
66
|
-
HairTypes["Smooth"] = "Liso";
|
|
67
|
-
HairTypes["WAVY"] = "Ondulado";
|
|
68
|
-
HairTypes["CURLY"] = "Cacheado";
|
|
69
|
-
HairTypes["FRIZZY"] = "Crespo";
|
|
70
|
-
HairTypes["BALD"] = "Sou careca";
|
|
64
|
+
exports.HairTypes = void 0;
|
|
65
|
+
(function (HairTypes) {
|
|
66
|
+
HairTypes["Smooth"] = "Liso";
|
|
67
|
+
HairTypes["WAVY"] = "Ondulado";
|
|
68
|
+
HairTypes["CURLY"] = "Cacheado";
|
|
69
|
+
HairTypes["FRIZZY"] = "Crespo";
|
|
70
|
+
HairTypes["BALD"] = "Sou careca";
|
|
71
71
|
})(exports.HairTypes || (exports.HairTypes = {}));
|
|
72
72
|
|
|
73
|
-
exports.Area = void 0;
|
|
74
|
-
(function (Area) {
|
|
75
|
-
Area["GP"] = "Geral";
|
|
76
|
-
Area["CRM"] = "CRM";
|
|
77
|
-
Area["MediaProd"] = "Media Production";
|
|
78
|
-
Area["Tech"] = "Tecnologia";
|
|
79
|
-
Area["Transactional"] = "Transacional";
|
|
80
|
-
Area["Operations"] = "Opera\u00E7\u00F5es";
|
|
81
|
-
Area["Sales"] = "Comercial";
|
|
82
|
-
Area["Finantial"] = "Financeiro";
|
|
83
|
-
Area["HR"] = "RH";
|
|
73
|
+
exports.Area = void 0;
|
|
74
|
+
(function (Area) {
|
|
75
|
+
Area["GP"] = "Geral";
|
|
76
|
+
Area["CRM"] = "CRM";
|
|
77
|
+
Area["MediaProd"] = "Media Production";
|
|
78
|
+
Area["Tech"] = "Tecnologia";
|
|
79
|
+
Area["Transactional"] = "Transacional";
|
|
80
|
+
Area["Operations"] = "Opera\u00E7\u00F5es";
|
|
81
|
+
Area["Sales"] = "Comercial";
|
|
82
|
+
Area["Finantial"] = "Financeiro";
|
|
83
|
+
Area["HR"] = "RH";
|
|
84
84
|
})(exports.Area || (exports.Area = {}));
|
|
85
85
|
|
|
86
|
-
exports.OfficePosition = void 0;
|
|
87
|
-
(function (OfficePosition) {
|
|
88
|
-
OfficePosition["Intern"] = "Estagi\u00E1rio";
|
|
89
|
-
OfficePosition["Analyst"] = "Analista";
|
|
90
|
-
OfficePosition["Manager"] = "Gerente";
|
|
91
|
-
OfficePosition["Director"] = "Diretor";
|
|
86
|
+
exports.OfficePosition = void 0;
|
|
87
|
+
(function (OfficePosition) {
|
|
88
|
+
OfficePosition["Intern"] = "Estagi\u00E1rio";
|
|
89
|
+
OfficePosition["Analyst"] = "Analista";
|
|
90
|
+
OfficePosition["Manager"] = "Gerente";
|
|
91
|
+
OfficePosition["Director"] = "Diretor";
|
|
92
92
|
})(exports.OfficePosition || (exports.OfficePosition = {}));
|
|
93
93
|
|
|
94
|
-
exports.BillingStatus = void 0;
|
|
95
|
-
(function (BillingStatus) {
|
|
96
|
-
BillingStatus["PAYED"] = "PAGO";
|
|
94
|
+
exports.BillingStatus = void 0;
|
|
95
|
+
(function (BillingStatus) {
|
|
96
|
+
BillingStatus["PAYED"] = "PAGO";
|
|
97
97
|
})(exports.BillingStatus || (exports.BillingStatus = {}));
|
|
98
98
|
|
|
99
|
-
exports.EditionStatus = void 0;
|
|
100
|
-
(function (EditionStatus) {
|
|
101
|
-
EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
|
|
99
|
+
exports.EditionStatus = void 0;
|
|
100
|
+
(function (EditionStatus) {
|
|
101
|
+
EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
|
|
102
102
|
})(exports.EditionStatus || (exports.EditionStatus = {}));
|
|
103
103
|
|
|
104
|
-
exports.PaymentType = void 0;
|
|
105
|
-
(function (PaymentType) {
|
|
106
|
-
PaymentType["AQUISITION"] = "Aquisi\u00E7\u00E3o";
|
|
107
|
-
PaymentType["RENEWAL"] = "Renova\u00E7\u00E3o";
|
|
108
|
-
PaymentType["FREIGHT"] = "mudan\u00E7a de endere\u00E7o, Frete";
|
|
104
|
+
exports.PaymentType = void 0;
|
|
105
|
+
(function (PaymentType) {
|
|
106
|
+
PaymentType["AQUISITION"] = "Aquisi\u00E7\u00E3o";
|
|
107
|
+
PaymentType["RENEWAL"] = "Renova\u00E7\u00E3o";
|
|
108
|
+
PaymentType["FREIGHT"] = "mudan\u00E7a de endere\u00E7o, Frete";
|
|
109
109
|
})(exports.PaymentType || (exports.PaymentType = {}));
|
|
110
110
|
|
|
111
|
-
exports.Status = void 0;
|
|
112
|
-
(function (Status) {
|
|
113
|
-
Status["ACTIVE"] = "active";
|
|
111
|
+
exports.Status = void 0;
|
|
112
|
+
(function (Status) {
|
|
113
|
+
Status["ACTIVE"] = "active";
|
|
114
114
|
})(exports.Status || (exports.Status = {}));
|
|
115
115
|
|
|
116
|
-
/*! *****************************************************************************
|
|
117
|
-
Copyright (c) Microsoft Corporation.
|
|
118
|
-
|
|
119
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
120
|
-
purpose with or without fee is hereby granted.
|
|
121
|
-
|
|
122
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
123
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
124
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
125
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
126
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
127
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
128
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
129
|
-
***************************************************************************** */
|
|
130
|
-
/* global Reflect, Promise */
|
|
131
|
-
var extendStatics = function (d, b) {
|
|
132
|
-
extendStatics = Object.setPrototypeOf ||
|
|
133
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
134
|
-
function (d, b) { for (var p in b)
|
|
135
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
136
|
-
d[p] = b[p]; };
|
|
137
|
-
return extendStatics(d, b);
|
|
138
|
-
};
|
|
139
|
-
function __extends(d, b) {
|
|
140
|
-
if (typeof b !== "function" && b !== null)
|
|
141
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
142
|
-
extendStatics(d, b);
|
|
143
|
-
function __() { this.constructor = d; }
|
|
144
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
145
|
-
}
|
|
146
|
-
var __assign = function () {
|
|
147
|
-
__assign = Object.assign || function __assign(t) {
|
|
148
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
149
|
-
s = arguments[i];
|
|
150
|
-
for (var p in s)
|
|
151
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
152
|
-
t[p] = s[p];
|
|
153
|
-
}
|
|
154
|
-
return t;
|
|
155
|
-
};
|
|
156
|
-
return __assign.apply(this, arguments);
|
|
157
|
-
};
|
|
158
|
-
function __rest(s, e) {
|
|
159
|
-
var t = {};
|
|
160
|
-
for (var p in s)
|
|
161
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
162
|
-
t[p] = s[p];
|
|
163
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
164
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
165
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
166
|
-
t[p[i]] = s[p[i]];
|
|
167
|
-
}
|
|
168
|
-
return t;
|
|
169
|
-
}
|
|
170
|
-
function __decorate(decorators, target, key, desc) {
|
|
171
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
172
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
173
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
174
|
-
else
|
|
175
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
176
|
-
if (d = decorators[i])
|
|
177
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
178
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
179
|
-
}
|
|
180
|
-
function __param(paramIndex, decorator) {
|
|
181
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
182
|
-
}
|
|
183
|
-
function __metadata(metadataKey, metadataValue) {
|
|
184
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
185
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
186
|
-
}
|
|
187
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
188
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
189
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
190
|
-
function fulfilled(value) { try {
|
|
191
|
-
step(generator.next(value));
|
|
192
|
-
}
|
|
193
|
-
catch (e) {
|
|
194
|
-
reject(e);
|
|
195
|
-
} }
|
|
196
|
-
function rejected(value) { try {
|
|
197
|
-
step(generator["throw"](value));
|
|
198
|
-
}
|
|
199
|
-
catch (e) {
|
|
200
|
-
reject(e);
|
|
201
|
-
} }
|
|
202
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
203
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
function __generator(thisArg, body) {
|
|
207
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
208
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
209
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
210
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
211
|
-
function step(op) {
|
|
212
|
-
if (f)
|
|
213
|
-
throw new TypeError("Generator is already executing.");
|
|
214
|
-
while (_)
|
|
215
|
-
try {
|
|
216
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
217
|
-
return t;
|
|
218
|
-
if (y = 0, t)
|
|
219
|
-
op = [op[0] & 2, t.value];
|
|
220
|
-
switch (op[0]) {
|
|
221
|
-
case 0:
|
|
222
|
-
case 1:
|
|
223
|
-
t = op;
|
|
224
|
-
break;
|
|
225
|
-
case 4:
|
|
226
|
-
_.label++;
|
|
227
|
-
return { value: op[1], done: false };
|
|
228
|
-
case 5:
|
|
229
|
-
_.label++;
|
|
230
|
-
y = op[1];
|
|
231
|
-
op = [0];
|
|
232
|
-
continue;
|
|
233
|
-
case 7:
|
|
234
|
-
op = _.ops.pop();
|
|
235
|
-
_.trys.pop();
|
|
236
|
-
continue;
|
|
237
|
-
default:
|
|
238
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
239
|
-
_ = 0;
|
|
240
|
-
continue;
|
|
241
|
-
}
|
|
242
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
243
|
-
_.label = op[1];
|
|
244
|
-
break;
|
|
245
|
-
}
|
|
246
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
247
|
-
_.label = t[1];
|
|
248
|
-
t = op;
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
if (t && _.label < t[2]) {
|
|
252
|
-
_.label = t[2];
|
|
253
|
-
_.ops.push(op);
|
|
254
|
-
break;
|
|
255
|
-
}
|
|
256
|
-
if (t[2])
|
|
257
|
-
_.ops.pop();
|
|
258
|
-
_.trys.pop();
|
|
259
|
-
continue;
|
|
260
|
-
}
|
|
261
|
-
op = body.call(thisArg, _);
|
|
262
|
-
}
|
|
263
|
-
catch (e) {
|
|
264
|
-
op = [6, e];
|
|
265
|
-
y = 0;
|
|
266
|
-
}
|
|
267
|
-
finally {
|
|
268
|
-
f = t = 0;
|
|
269
|
-
}
|
|
270
|
-
if (op[0] & 5)
|
|
271
|
-
throw op[1];
|
|
272
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
276
|
-
if (k2 === undefined)
|
|
277
|
-
k2 = k;
|
|
278
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
279
|
-
}) : (function (o, m, k, k2) {
|
|
280
|
-
if (k2 === undefined)
|
|
281
|
-
k2 = k;
|
|
282
|
-
o[k2] = m[k];
|
|
283
|
-
});
|
|
284
|
-
function __exportStar(m, o) {
|
|
285
|
-
for (var p in m)
|
|
286
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
287
|
-
__createBinding(o, m, p);
|
|
288
|
-
}
|
|
289
|
-
function __values(o) {
|
|
290
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
291
|
-
if (m)
|
|
292
|
-
return m.call(o);
|
|
293
|
-
if (o && typeof o.length === "number")
|
|
294
|
-
return {
|
|
295
|
-
next: function () {
|
|
296
|
-
if (o && i >= o.length)
|
|
297
|
-
o = void 0;
|
|
298
|
-
return { value: o && o[i++], done: !o };
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
302
|
-
}
|
|
303
|
-
function __read(o, n) {
|
|
304
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
305
|
-
if (!m)
|
|
306
|
-
return o;
|
|
307
|
-
var i = m.call(o), r, ar = [], e;
|
|
308
|
-
try {
|
|
309
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
310
|
-
ar.push(r.value);
|
|
311
|
-
}
|
|
312
|
-
catch (error) {
|
|
313
|
-
e = { error: error };
|
|
314
|
-
}
|
|
315
|
-
finally {
|
|
316
|
-
try {
|
|
317
|
-
if (r && !r.done && (m = i["return"]))
|
|
318
|
-
m.call(i);
|
|
319
|
-
}
|
|
320
|
-
finally {
|
|
321
|
-
if (e)
|
|
322
|
-
throw e.error;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
return ar;
|
|
326
|
-
}
|
|
327
|
-
/** @deprecated */
|
|
328
|
-
function __spread() {
|
|
329
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
330
|
-
ar = ar.concat(__read(arguments[i]));
|
|
331
|
-
return ar;
|
|
332
|
-
}
|
|
333
|
-
/** @deprecated */
|
|
334
|
-
function __spreadArrays() {
|
|
335
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
336
|
-
s += arguments[i].length;
|
|
337
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
338
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
339
|
-
r[k] = a[j];
|
|
340
|
-
return r;
|
|
341
|
-
}
|
|
342
|
-
function __spreadArray(to, from, pack) {
|
|
343
|
-
if (pack || arguments.length === 2)
|
|
344
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
345
|
-
if (ar || !(i in from)) {
|
|
346
|
-
if (!ar)
|
|
347
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
348
|
-
ar[i] = from[i];
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
352
|
-
}
|
|
353
|
-
function __await(v) {
|
|
354
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
355
|
-
}
|
|
356
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
357
|
-
if (!Symbol.asyncIterator)
|
|
358
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
359
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
360
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
361
|
-
function verb(n) { if (g[n])
|
|
362
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
363
|
-
function resume(n, v) { try {
|
|
364
|
-
step(g[n](v));
|
|
365
|
-
}
|
|
366
|
-
catch (e) {
|
|
367
|
-
settle(q[0][3], e);
|
|
368
|
-
} }
|
|
369
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
370
|
-
function fulfill(value) { resume("next", value); }
|
|
371
|
-
function reject(value) { resume("throw", value); }
|
|
372
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
373
|
-
resume(q[0][0], q[0][1]); }
|
|
374
|
-
}
|
|
375
|
-
function __asyncDelegator(o) {
|
|
376
|
-
var i, p;
|
|
377
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
378
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
379
|
-
}
|
|
380
|
-
function __asyncValues(o) {
|
|
381
|
-
if (!Symbol.asyncIterator)
|
|
382
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
383
|
-
var m = o[Symbol.asyncIterator], i;
|
|
384
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
385
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
386
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
387
|
-
}
|
|
388
|
-
function __makeTemplateObject(cooked, raw) {
|
|
389
|
-
if (Object.defineProperty) {
|
|
390
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
391
|
-
}
|
|
392
|
-
else {
|
|
393
|
-
cooked.raw = raw;
|
|
394
|
-
}
|
|
395
|
-
return cooked;
|
|
396
|
-
}
|
|
397
|
-
;
|
|
398
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
399
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
400
|
-
}) : function (o, v) {
|
|
401
|
-
o["default"] = v;
|
|
402
|
-
};
|
|
403
|
-
function __importStar(mod) {
|
|
404
|
-
if (mod && mod.__esModule)
|
|
405
|
-
return mod;
|
|
406
|
-
var result = {};
|
|
407
|
-
if (mod != null)
|
|
408
|
-
for (var k in mod)
|
|
409
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
410
|
-
__createBinding(result, mod, k);
|
|
411
|
-
__setModuleDefault(result, mod);
|
|
412
|
-
return result;
|
|
413
|
-
}
|
|
414
|
-
function __importDefault(mod) {
|
|
415
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
416
|
-
}
|
|
417
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
418
|
-
if (kind === "a" && !f)
|
|
419
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
420
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
421
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
422
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
423
|
-
}
|
|
424
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
425
|
-
if (kind === "m")
|
|
426
|
-
throw new TypeError("Private method is not writable");
|
|
427
|
-
if (kind === "a" && !f)
|
|
428
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
429
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
430
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
431
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
116
|
+
/*! *****************************************************************************
|
|
117
|
+
Copyright (c) Microsoft Corporation.
|
|
118
|
+
|
|
119
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
120
|
+
purpose with or without fee is hereby granted.
|
|
121
|
+
|
|
122
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
123
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
124
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
125
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
126
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
127
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
128
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
129
|
+
***************************************************************************** */
|
|
130
|
+
/* global Reflect, Promise */
|
|
131
|
+
var extendStatics = function (d, b) {
|
|
132
|
+
extendStatics = Object.setPrototypeOf ||
|
|
133
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
134
|
+
function (d, b) { for (var p in b)
|
|
135
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
136
|
+
d[p] = b[p]; };
|
|
137
|
+
return extendStatics(d, b);
|
|
138
|
+
};
|
|
139
|
+
function __extends(d, b) {
|
|
140
|
+
if (typeof b !== "function" && b !== null)
|
|
141
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
142
|
+
extendStatics(d, b);
|
|
143
|
+
function __() { this.constructor = d; }
|
|
144
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
145
|
+
}
|
|
146
|
+
var __assign = function () {
|
|
147
|
+
__assign = Object.assign || function __assign(t) {
|
|
148
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
149
|
+
s = arguments[i];
|
|
150
|
+
for (var p in s)
|
|
151
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
152
|
+
t[p] = s[p];
|
|
153
|
+
}
|
|
154
|
+
return t;
|
|
155
|
+
};
|
|
156
|
+
return __assign.apply(this, arguments);
|
|
157
|
+
};
|
|
158
|
+
function __rest(s, e) {
|
|
159
|
+
var t = {};
|
|
160
|
+
for (var p in s)
|
|
161
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
162
|
+
t[p] = s[p];
|
|
163
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
164
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
165
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
166
|
+
t[p[i]] = s[p[i]];
|
|
167
|
+
}
|
|
168
|
+
return t;
|
|
169
|
+
}
|
|
170
|
+
function __decorate(decorators, target, key, desc) {
|
|
171
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
172
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
173
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
174
|
+
else
|
|
175
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
176
|
+
if (d = decorators[i])
|
|
177
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
178
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
179
|
+
}
|
|
180
|
+
function __param(paramIndex, decorator) {
|
|
181
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
182
|
+
}
|
|
183
|
+
function __metadata(metadataKey, metadataValue) {
|
|
184
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
185
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
186
|
+
}
|
|
187
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
188
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
189
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
190
|
+
function fulfilled(value) { try {
|
|
191
|
+
step(generator.next(value));
|
|
192
|
+
}
|
|
193
|
+
catch (e) {
|
|
194
|
+
reject(e);
|
|
195
|
+
} }
|
|
196
|
+
function rejected(value) { try {
|
|
197
|
+
step(generator["throw"](value));
|
|
198
|
+
}
|
|
199
|
+
catch (e) {
|
|
200
|
+
reject(e);
|
|
201
|
+
} }
|
|
202
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
203
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
function __generator(thisArg, body) {
|
|
207
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
208
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
209
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
210
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
211
|
+
function step(op) {
|
|
212
|
+
if (f)
|
|
213
|
+
throw new TypeError("Generator is already executing.");
|
|
214
|
+
while (_)
|
|
215
|
+
try {
|
|
216
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
217
|
+
return t;
|
|
218
|
+
if (y = 0, t)
|
|
219
|
+
op = [op[0] & 2, t.value];
|
|
220
|
+
switch (op[0]) {
|
|
221
|
+
case 0:
|
|
222
|
+
case 1:
|
|
223
|
+
t = op;
|
|
224
|
+
break;
|
|
225
|
+
case 4:
|
|
226
|
+
_.label++;
|
|
227
|
+
return { value: op[1], done: false };
|
|
228
|
+
case 5:
|
|
229
|
+
_.label++;
|
|
230
|
+
y = op[1];
|
|
231
|
+
op = [0];
|
|
232
|
+
continue;
|
|
233
|
+
case 7:
|
|
234
|
+
op = _.ops.pop();
|
|
235
|
+
_.trys.pop();
|
|
236
|
+
continue;
|
|
237
|
+
default:
|
|
238
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
239
|
+
_ = 0;
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
243
|
+
_.label = op[1];
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
247
|
+
_.label = t[1];
|
|
248
|
+
t = op;
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
if (t && _.label < t[2]) {
|
|
252
|
+
_.label = t[2];
|
|
253
|
+
_.ops.push(op);
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
if (t[2])
|
|
257
|
+
_.ops.pop();
|
|
258
|
+
_.trys.pop();
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
op = body.call(thisArg, _);
|
|
262
|
+
}
|
|
263
|
+
catch (e) {
|
|
264
|
+
op = [6, e];
|
|
265
|
+
y = 0;
|
|
266
|
+
}
|
|
267
|
+
finally {
|
|
268
|
+
f = t = 0;
|
|
269
|
+
}
|
|
270
|
+
if (op[0] & 5)
|
|
271
|
+
throw op[1];
|
|
272
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
276
|
+
if (k2 === undefined)
|
|
277
|
+
k2 = k;
|
|
278
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
279
|
+
}) : (function (o, m, k, k2) {
|
|
280
|
+
if (k2 === undefined)
|
|
281
|
+
k2 = k;
|
|
282
|
+
o[k2] = m[k];
|
|
283
|
+
});
|
|
284
|
+
function __exportStar(m, o) {
|
|
285
|
+
for (var p in m)
|
|
286
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
287
|
+
__createBinding(o, m, p);
|
|
288
|
+
}
|
|
289
|
+
function __values(o) {
|
|
290
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
291
|
+
if (m)
|
|
292
|
+
return m.call(o);
|
|
293
|
+
if (o && typeof o.length === "number")
|
|
294
|
+
return {
|
|
295
|
+
next: function () {
|
|
296
|
+
if (o && i >= o.length)
|
|
297
|
+
o = void 0;
|
|
298
|
+
return { value: o && o[i++], done: !o };
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
302
|
+
}
|
|
303
|
+
function __read(o, n) {
|
|
304
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
305
|
+
if (!m)
|
|
306
|
+
return o;
|
|
307
|
+
var i = m.call(o), r, ar = [], e;
|
|
308
|
+
try {
|
|
309
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
310
|
+
ar.push(r.value);
|
|
311
|
+
}
|
|
312
|
+
catch (error) {
|
|
313
|
+
e = { error: error };
|
|
314
|
+
}
|
|
315
|
+
finally {
|
|
316
|
+
try {
|
|
317
|
+
if (r && !r.done && (m = i["return"]))
|
|
318
|
+
m.call(i);
|
|
319
|
+
}
|
|
320
|
+
finally {
|
|
321
|
+
if (e)
|
|
322
|
+
throw e.error;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return ar;
|
|
326
|
+
}
|
|
327
|
+
/** @deprecated */
|
|
328
|
+
function __spread() {
|
|
329
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
330
|
+
ar = ar.concat(__read(arguments[i]));
|
|
331
|
+
return ar;
|
|
332
|
+
}
|
|
333
|
+
/** @deprecated */
|
|
334
|
+
function __spreadArrays() {
|
|
335
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
336
|
+
s += arguments[i].length;
|
|
337
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
338
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
339
|
+
r[k] = a[j];
|
|
340
|
+
return r;
|
|
341
|
+
}
|
|
342
|
+
function __spreadArray(to, from, pack) {
|
|
343
|
+
if (pack || arguments.length === 2)
|
|
344
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
345
|
+
if (ar || !(i in from)) {
|
|
346
|
+
if (!ar)
|
|
347
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
348
|
+
ar[i] = from[i];
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
352
|
+
}
|
|
353
|
+
function __await(v) {
|
|
354
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
355
|
+
}
|
|
356
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
357
|
+
if (!Symbol.asyncIterator)
|
|
358
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
359
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
360
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
361
|
+
function verb(n) { if (g[n])
|
|
362
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
363
|
+
function resume(n, v) { try {
|
|
364
|
+
step(g[n](v));
|
|
365
|
+
}
|
|
366
|
+
catch (e) {
|
|
367
|
+
settle(q[0][3], e);
|
|
368
|
+
} }
|
|
369
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
370
|
+
function fulfill(value) { resume("next", value); }
|
|
371
|
+
function reject(value) { resume("throw", value); }
|
|
372
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
373
|
+
resume(q[0][0], q[0][1]); }
|
|
374
|
+
}
|
|
375
|
+
function __asyncDelegator(o) {
|
|
376
|
+
var i, p;
|
|
377
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
378
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
379
|
+
}
|
|
380
|
+
function __asyncValues(o) {
|
|
381
|
+
if (!Symbol.asyncIterator)
|
|
382
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
383
|
+
var m = o[Symbol.asyncIterator], i;
|
|
384
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
385
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
386
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
387
|
+
}
|
|
388
|
+
function __makeTemplateObject(cooked, raw) {
|
|
389
|
+
if (Object.defineProperty) {
|
|
390
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
cooked.raw = raw;
|
|
394
|
+
}
|
|
395
|
+
return cooked;
|
|
396
|
+
}
|
|
397
|
+
;
|
|
398
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
399
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
400
|
+
}) : function (o, v) {
|
|
401
|
+
o["default"] = v;
|
|
402
|
+
};
|
|
403
|
+
function __importStar(mod) {
|
|
404
|
+
if (mod && mod.__esModule)
|
|
405
|
+
return mod;
|
|
406
|
+
var result = {};
|
|
407
|
+
if (mod != null)
|
|
408
|
+
for (var k in mod)
|
|
409
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
410
|
+
__createBinding(result, mod, k);
|
|
411
|
+
__setModuleDefault(result, mod);
|
|
412
|
+
return result;
|
|
413
|
+
}
|
|
414
|
+
function __importDefault(mod) {
|
|
415
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
416
|
+
}
|
|
417
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
418
|
+
if (kind === "a" && !f)
|
|
419
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
420
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
421
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
422
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
423
|
+
}
|
|
424
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
425
|
+
if (kind === "m")
|
|
426
|
+
throw new TypeError("Private method is not writable");
|
|
427
|
+
if (kind === "a" && !f)
|
|
428
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
429
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
430
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
431
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
-
var Edition = /** @class */ (function (_super) {
|
|
435
|
-
__extends(Edition, _super);
|
|
436
|
-
function Edition() {
|
|
437
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
438
|
-
}
|
|
439
|
-
Edition.prototype.identifierFields = function () {
|
|
440
|
-
return ['id'];
|
|
441
|
-
};
|
|
442
|
-
return Edition;
|
|
434
|
+
var Edition = /** @class */ (function (_super) {
|
|
435
|
+
__extends(Edition, _super);
|
|
436
|
+
function Edition() {
|
|
437
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
438
|
+
}
|
|
439
|
+
Edition.prototype.identifierFields = function () {
|
|
440
|
+
return ['id'];
|
|
441
|
+
};
|
|
442
|
+
return Edition;
|
|
443
443
|
}(BaseModel));
|
|
444
444
|
|
|
445
|
-
var SubscriptionPayment = /** @class */ (function (_super) {
|
|
446
|
-
__extends(SubscriptionPayment, _super);
|
|
447
|
-
function SubscriptionPayment() {
|
|
448
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
449
|
-
}
|
|
450
|
-
SubscriptionPayment.prototype.identifierFields = function () {
|
|
451
|
-
return ['id'];
|
|
452
|
-
};
|
|
453
|
-
return SubscriptionPayment;
|
|
445
|
+
var SubscriptionPayment = /** @class */ (function (_super) {
|
|
446
|
+
__extends(SubscriptionPayment, _super);
|
|
447
|
+
function SubscriptionPayment() {
|
|
448
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
449
|
+
}
|
|
450
|
+
SubscriptionPayment.prototype.identifierFields = function () {
|
|
451
|
+
return ['id'];
|
|
452
|
+
};
|
|
453
|
+
return SubscriptionPayment;
|
|
454
454
|
}(BaseModel));
|
|
455
455
|
|
|
456
|
-
var Subscription = /** @class */ (function (_super) {
|
|
457
|
-
__extends(Subscription, _super);
|
|
458
|
-
function Subscription() {
|
|
459
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
460
|
-
}
|
|
461
|
-
Subscription.prototype.identifierFields = function () {
|
|
462
|
-
return ['id'];
|
|
463
|
-
};
|
|
464
|
-
return Subscription;
|
|
456
|
+
var Subscription = /** @class */ (function (_super) {
|
|
457
|
+
__extends(Subscription, _super);
|
|
458
|
+
function Subscription() {
|
|
459
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
460
|
+
}
|
|
461
|
+
Subscription.prototype.identifierFields = function () {
|
|
462
|
+
return ['id'];
|
|
463
|
+
};
|
|
464
|
+
return Subscription;
|
|
465
465
|
}(BaseModel));
|
|
466
466
|
|
|
467
|
-
var User = /** @class */ (function (_super) {
|
|
468
|
-
__extends(User, _super);
|
|
469
|
-
function User() {
|
|
470
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
471
|
-
}
|
|
472
|
-
User.toInstance = function (data) {
|
|
473
|
-
var instance = _super.toInstance.call(this, data);
|
|
474
|
-
instance.displayName = data.firstName + " " + data.lastName;
|
|
475
|
-
return instance;
|
|
476
|
-
};
|
|
477
|
-
User.prototype.identifierFields = function () {
|
|
478
|
-
return ['id'];
|
|
479
|
-
};
|
|
480
|
-
User.prototype.toPlain = function () {
|
|
481
|
-
var plain = _super.prototype.toPlain.call(this);
|
|
482
|
-
delete plain.beautyProfile;
|
|
483
|
-
return plain;
|
|
484
|
-
};
|
|
485
|
-
return User;
|
|
467
|
+
var User = /** @class */ (function (_super) {
|
|
468
|
+
__extends(User, _super);
|
|
469
|
+
function User() {
|
|
470
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
471
|
+
}
|
|
472
|
+
User.toInstance = function (data) {
|
|
473
|
+
var instance = _super.toInstance.call(this, data);
|
|
474
|
+
instance.displayName = data.firstName + " " + data.lastName;
|
|
475
|
+
return instance;
|
|
476
|
+
};
|
|
477
|
+
User.prototype.identifierFields = function () {
|
|
478
|
+
return ['id'];
|
|
479
|
+
};
|
|
480
|
+
User.prototype.toPlain = function () {
|
|
481
|
+
var plain = _super.prototype.toPlain.call(this);
|
|
482
|
+
delete plain.beautyProfile;
|
|
483
|
+
return plain;
|
|
484
|
+
};
|
|
485
|
+
return User;
|
|
486
486
|
}(BaseModel));
|
|
487
487
|
|
|
488
|
-
var BeautyProfile = /** @class */ (function (_super) {
|
|
489
|
-
__extends(BeautyProfile, _super);
|
|
490
|
-
function BeautyProfile() {
|
|
491
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
492
|
-
}
|
|
493
|
-
BeautyProfile.prototype.toPlain = function () {
|
|
494
|
-
var plain = _super.prototype.toPlain.call(this);
|
|
495
|
-
delete plain.id;
|
|
496
|
-
return plain;
|
|
497
|
-
};
|
|
498
|
-
BeautyProfile.prototype.identifierFields = function () {
|
|
499
|
-
return ['id'];
|
|
500
|
-
};
|
|
501
|
-
return BeautyProfile;
|
|
488
|
+
var BeautyProfile = /** @class */ (function (_super) {
|
|
489
|
+
__extends(BeautyProfile, _super);
|
|
490
|
+
function BeautyProfile() {
|
|
491
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
492
|
+
}
|
|
493
|
+
BeautyProfile.prototype.toPlain = function () {
|
|
494
|
+
var plain = _super.prototype.toPlain.call(this);
|
|
495
|
+
delete plain.id;
|
|
496
|
+
return plain;
|
|
497
|
+
};
|
|
498
|
+
BeautyProfile.prototype.identifierFields = function () {
|
|
499
|
+
return ['id'];
|
|
500
|
+
};
|
|
501
|
+
return BeautyProfile;
|
|
502
502
|
}(BaseModel));
|
|
503
503
|
|
|
504
|
-
var Address = /** @class */ (function (_super) {
|
|
505
|
-
__extends(Address, _super);
|
|
506
|
-
function Address() {
|
|
507
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
508
|
-
}
|
|
509
|
-
return Address;
|
|
504
|
+
var Address = /** @class */ (function (_super) {
|
|
505
|
+
__extends(Address, _super);
|
|
506
|
+
function Address() {
|
|
507
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
508
|
+
}
|
|
509
|
+
return Address;
|
|
510
510
|
}(BaseModel));
|
|
511
511
|
|
|
512
|
-
var UserAddress = /** @class */ (function (_super) {
|
|
513
|
-
__extends(UserAddress, _super);
|
|
514
|
-
function UserAddress() {
|
|
515
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
516
|
-
}
|
|
517
|
-
UserAddress.prototype.identifierFields = function () {
|
|
518
|
-
return ['id'];
|
|
519
|
-
};
|
|
520
|
-
return UserAddress;
|
|
512
|
+
var UserAddress = /** @class */ (function (_super) {
|
|
513
|
+
__extends(UserAddress, _super);
|
|
514
|
+
function UserAddress() {
|
|
515
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
516
|
+
}
|
|
517
|
+
UserAddress.prototype.identifierFields = function () {
|
|
518
|
+
return ['id'];
|
|
519
|
+
};
|
|
520
|
+
return UserAddress;
|
|
521
521
|
}(Address));
|
|
522
522
|
|
|
523
|
-
var Base = /** @class */ (function () {
|
|
524
|
-
function Base() {
|
|
525
|
-
var args = [];
|
|
526
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
527
|
-
args[_i] = arguments[_i];
|
|
528
|
-
}
|
|
529
|
-
Object.assign.apply(Object, __spreadArray([this], __read(args)));
|
|
530
|
-
}
|
|
531
|
-
return Base;
|
|
523
|
+
var Base = /** @class */ (function () {
|
|
524
|
+
function Base() {
|
|
525
|
+
var args = [];
|
|
526
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
527
|
+
args[_i] = arguments[_i];
|
|
528
|
+
}
|
|
529
|
+
Object.assign.apply(Object, __spreadArray([this], __read(args)));
|
|
530
|
+
}
|
|
531
|
+
return Base;
|
|
532
532
|
}());
|
|
533
533
|
|
|
534
|
-
var UnauthorizedError = /** @class */ (function (_super) {
|
|
535
|
-
__extends(UnauthorizedError, _super);
|
|
536
|
-
function UnauthorizedError(message) {
|
|
537
|
-
var _this = _super.call(this, message) || this;
|
|
538
|
-
_this.message = message;
|
|
539
|
-
return _this;
|
|
540
|
-
}
|
|
541
|
-
return UnauthorizedError;
|
|
534
|
+
var UnauthorizedError = /** @class */ (function (_super) {
|
|
535
|
+
__extends(UnauthorizedError, _super);
|
|
536
|
+
function UnauthorizedError(message) {
|
|
537
|
+
var _this = _super.call(this, message) || this;
|
|
538
|
+
_this.message = message;
|
|
539
|
+
return _this;
|
|
540
|
+
}
|
|
541
|
+
return UnauthorizedError;
|
|
542
542
|
}(Error));
|
|
543
543
|
|
|
544
|
-
exports.SignInMethods = void 0;
|
|
545
|
-
(function (SignInMethods) {
|
|
546
|
-
SignInMethods["EMAIL_PASSWORD"] = "email_password";
|
|
547
|
-
SignInMethods["GOOGLE"] = "google";
|
|
548
|
-
})(exports.SignInMethods || (exports.SignInMethods = {}));
|
|
549
|
-
var Authentication = /** @class */ (function () {
|
|
550
|
-
function Authentication(authService, userRepository) {
|
|
551
|
-
this.authService = authService;
|
|
552
|
-
this.userRepository = userRepository;
|
|
553
|
-
}
|
|
554
|
-
Authentication.prototype.signIn = function (_b, signInMethod) {
|
|
555
|
-
var email = _b.email, password = _b.password;
|
|
556
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
557
|
-
var method, userAuth, user;
|
|
558
|
-
return __generator(this, function (_b) {
|
|
559
|
-
switch (_b.label) {
|
|
560
|
-
case 0:
|
|
561
|
-
method = this.getServiceByMethod(signInMethod);
|
|
562
|
-
return [4 /*yield*/, this.authService[method]({ email: email, password: password })];
|
|
563
|
-
case 1:
|
|
564
|
-
userAuth = _b.sent();
|
|
565
|
-
user = this.userRepository.get(userAuth);
|
|
566
|
-
if (!lodash.isNil(user))
|
|
567
|
-
return [2 /*return*/, user];
|
|
568
|
-
if (/^.+@b4a.com.br$/.test(userAuth.email))
|
|
569
|
-
return [2 /*return*/, this.createsUserByCredential(userAuth)];
|
|
570
|
-
throw new UnauthorizedError('Invalid credentials');
|
|
571
|
-
}
|
|
572
|
-
});
|
|
573
|
-
});
|
|
574
|
-
};
|
|
575
|
-
Authentication.prototype.getServiceByMethod = function (signInMethod) {
|
|
576
|
-
return signInMethod === exports.SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
|
|
577
|
-
};
|
|
578
|
-
Authentication.prototype.createsUserByCredential = function (user) {
|
|
579
|
-
var _a;
|
|
580
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
581
|
-
var _b, firstName, lastName, person;
|
|
582
|
-
return __generator(this, function (_c) {
|
|
583
|
-
_b = __read((_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/), 2), firstName = _b[0], lastName = _b[1];
|
|
584
|
-
person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName: firstName,
|
|
585
|
-
lastName: lastName, acceptsNewsletter: false, area: exports.Area.Transactional, officePosition: exports.OfficePosition.Intern, type: exports.UserType.Collaborator }));
|
|
586
|
-
return [2 /*return*/, this.userRepository.create(person)];
|
|
587
|
-
});
|
|
588
|
-
});
|
|
589
|
-
};
|
|
590
|
-
return Authentication;
|
|
544
|
+
exports.SignInMethods = void 0;
|
|
545
|
+
(function (SignInMethods) {
|
|
546
|
+
SignInMethods["EMAIL_PASSWORD"] = "email_password";
|
|
547
|
+
SignInMethods["GOOGLE"] = "google";
|
|
548
|
+
})(exports.SignInMethods || (exports.SignInMethods = {}));
|
|
549
|
+
var Authentication = /** @class */ (function () {
|
|
550
|
+
function Authentication(authService, userRepository) {
|
|
551
|
+
this.authService = authService;
|
|
552
|
+
this.userRepository = userRepository;
|
|
553
|
+
}
|
|
554
|
+
Authentication.prototype.signIn = function (_b, signInMethod) {
|
|
555
|
+
var email = _b.email, password = _b.password;
|
|
556
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
557
|
+
var method, userAuth, user;
|
|
558
|
+
return __generator(this, function (_b) {
|
|
559
|
+
switch (_b.label) {
|
|
560
|
+
case 0:
|
|
561
|
+
method = this.getServiceByMethod(signInMethod);
|
|
562
|
+
return [4 /*yield*/, this.authService[method]({ email: email, password: password })];
|
|
563
|
+
case 1:
|
|
564
|
+
userAuth = _b.sent();
|
|
565
|
+
user = this.userRepository.get(userAuth);
|
|
566
|
+
if (!lodash.isNil(user))
|
|
567
|
+
return [2 /*return*/, user];
|
|
568
|
+
if (/^.+@b4a.com.br$/.test(userAuth.email))
|
|
569
|
+
return [2 /*return*/, this.createsUserByCredential(userAuth)];
|
|
570
|
+
throw new UnauthorizedError('Invalid credentials');
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
});
|
|
574
|
+
};
|
|
575
|
+
Authentication.prototype.getServiceByMethod = function (signInMethod) {
|
|
576
|
+
return signInMethod === exports.SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
|
|
577
|
+
};
|
|
578
|
+
Authentication.prototype.createsUserByCredential = function (user) {
|
|
579
|
+
var _a;
|
|
580
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
581
|
+
var _b, firstName, lastName, person;
|
|
582
|
+
return __generator(this, function (_c) {
|
|
583
|
+
_b = __read((_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/), 2), firstName = _b[0], lastName = _b[1];
|
|
584
|
+
person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName: firstName,
|
|
585
|
+
lastName: lastName, acceptsNewsletter: false, area: exports.Area.Transactional, officePosition: exports.OfficePosition.Intern, type: exports.UserType.Collaborator }));
|
|
586
|
+
return [2 /*return*/, this.userRepository.create(person)];
|
|
587
|
+
});
|
|
588
|
+
});
|
|
589
|
+
};
|
|
590
|
+
return Authentication;
|
|
591
591
|
}());
|
|
592
592
|
|
|
593
|
-
var SignOut = /** @class */ (function () {
|
|
594
|
-
function SignOut(authService) {
|
|
595
|
-
this.authService = authService;
|
|
596
|
-
}
|
|
597
|
-
SignOut.prototype.signOut = function () {
|
|
598
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
599
|
-
return __generator(this, function (_a) {
|
|
600
|
-
switch (_a.label) {
|
|
601
|
-
case 0: return [4 /*yield*/, this.authService.signOut()];
|
|
602
|
-
case 1:
|
|
603
|
-
_a.sent();
|
|
604
|
-
return [2 /*return*/];
|
|
605
|
-
}
|
|
606
|
-
});
|
|
607
|
-
});
|
|
608
|
-
};
|
|
609
|
-
return SignOut;
|
|
593
|
+
var SignOut = /** @class */ (function () {
|
|
594
|
+
function SignOut(authService) {
|
|
595
|
+
this.authService = authService;
|
|
596
|
+
}
|
|
597
|
+
SignOut.prototype.signOut = function () {
|
|
598
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
599
|
+
return __generator(this, function (_a) {
|
|
600
|
+
switch (_a.label) {
|
|
601
|
+
case 0: return [4 /*yield*/, this.authService.signOut()];
|
|
602
|
+
case 1:
|
|
603
|
+
_a.sent();
|
|
604
|
+
return [2 /*return*/];
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
});
|
|
608
|
+
};
|
|
609
|
+
return SignOut;
|
|
610
610
|
}());
|
|
611
611
|
|
|
612
|
-
exports.Shops = void 0;
|
|
613
|
-
(function (Shops) {
|
|
614
|
-
Shops["MENSMARKET"] = "Men's Market";
|
|
615
|
-
Shops["GLAMSHOP"] = "Glamshop";
|
|
612
|
+
exports.Shops = void 0;
|
|
613
|
+
(function (Shops) {
|
|
614
|
+
Shops["MENSMARKET"] = "Men's Market";
|
|
615
|
+
Shops["GLAMSHOP"] = "Glamshop";
|
|
616
616
|
})(exports.Shops || (exports.Shops = {}));
|
|
617
617
|
|
|
618
|
-
var Category = /** @class */ (function (_super) {
|
|
619
|
-
__extends(Category, _super);
|
|
620
|
-
function Category() {
|
|
621
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
622
|
-
}
|
|
623
|
-
Category.prototype.identifierFields = function () {
|
|
624
|
-
return ['id'];
|
|
625
|
-
};
|
|
626
|
-
return Category;
|
|
618
|
+
var Category = /** @class */ (function (_super) {
|
|
619
|
+
__extends(Category, _super);
|
|
620
|
+
function Category() {
|
|
621
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
622
|
+
}
|
|
623
|
+
Category.prototype.identifierFields = function () {
|
|
624
|
+
return ['id'];
|
|
625
|
+
};
|
|
626
|
+
return Category;
|
|
627
627
|
}(BaseModel));
|
|
628
628
|
|
|
629
|
-
var Product = /** @class */ (function (_super) {
|
|
630
|
-
__extends(Product, _super);
|
|
631
|
-
function Product() {
|
|
632
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
633
|
-
}
|
|
634
|
-
Product.prototype.identifierFields = function () {
|
|
635
|
-
return ['id'];
|
|
636
|
-
};
|
|
637
|
-
return Product;
|
|
629
|
+
var Product = /** @class */ (function (_super) {
|
|
630
|
+
__extends(Product, _super);
|
|
631
|
+
function Product() {
|
|
632
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
633
|
+
}
|
|
634
|
+
Product.prototype.identifierFields = function () {
|
|
635
|
+
return ['id'];
|
|
636
|
+
};
|
|
637
|
+
return Product;
|
|
638
638
|
}(BaseModel));
|
|
639
639
|
|
|
640
|
-
var Variant = /** @class */ (function (_super) {
|
|
641
|
-
__extends(Variant, _super);
|
|
642
|
-
function Variant() {
|
|
643
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
644
|
-
}
|
|
645
|
-
Variant.prototype.identifierFields = function () {
|
|
646
|
-
return ['id'];
|
|
647
|
-
};
|
|
648
|
-
return Variant;
|
|
640
|
+
var Variant = /** @class */ (function (_super) {
|
|
641
|
+
__extends(Variant, _super);
|
|
642
|
+
function Variant() {
|
|
643
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
644
|
+
}
|
|
645
|
+
Variant.prototype.identifierFields = function () {
|
|
646
|
+
return ['id'];
|
|
647
|
+
};
|
|
648
|
+
return Variant;
|
|
649
649
|
}(BaseModel));
|
|
650
650
|
|
|
651
|
-
exports.CouponTypes = void 0;
|
|
652
|
-
(function (CouponTypes) {
|
|
653
|
-
CouponTypes[CouponTypes["FINANCIAL"] = 1] = "FINANCIAL";
|
|
654
|
-
CouponTypes[CouponTypes["PRODUCT"] = 2] = "PRODUCT";
|
|
655
|
-
CouponTypes[CouponTypes["GIFTCARD"] = 3] = "GIFTCARD";
|
|
656
|
-
CouponTypes[CouponTypes["VOUCHER"] = 4] = "VOUCHER";
|
|
651
|
+
exports.CouponTypes = void 0;
|
|
652
|
+
(function (CouponTypes) {
|
|
653
|
+
CouponTypes[CouponTypes["FINANCIAL"] = 1] = "FINANCIAL";
|
|
654
|
+
CouponTypes[CouponTypes["PRODUCT"] = 2] = "PRODUCT";
|
|
655
|
+
CouponTypes[CouponTypes["GIFTCARD"] = 3] = "GIFTCARD";
|
|
656
|
+
CouponTypes[CouponTypes["VOUCHER"] = 4] = "VOUCHER";
|
|
657
657
|
})(exports.CouponTypes || (exports.CouponTypes = {}));
|
|
658
658
|
|
|
659
|
-
exports.CouponSubtypes = void 0;
|
|
660
|
-
(function (CouponSubtypes) {
|
|
661
|
-
CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
|
|
662
|
-
CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
|
|
659
|
+
exports.CouponSubtypes = void 0;
|
|
660
|
+
(function (CouponSubtypes) {
|
|
661
|
+
CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
|
|
662
|
+
CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
|
|
663
663
|
})(exports.CouponSubtypes || (exports.CouponSubtypes = {}));
|
|
664
664
|
|
|
665
|
-
exports.Exclusivities = void 0;
|
|
666
|
-
(function (Exclusivities) {
|
|
667
|
-
Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
|
|
668
|
-
Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
|
|
669
|
-
Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
|
|
665
|
+
exports.Exclusivities = void 0;
|
|
666
|
+
(function (Exclusivities) {
|
|
667
|
+
Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
|
|
668
|
+
Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
|
|
669
|
+
Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
|
|
670
670
|
})(exports.Exclusivities || (exports.Exclusivities = {}));
|
|
671
671
|
|
|
672
|
-
var Coupon = /** @class */ (function (_super) {
|
|
673
|
-
__extends(Coupon, _super);
|
|
674
|
-
function Coupon() {
|
|
675
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
676
|
-
}
|
|
677
|
-
Coupon.prototype.identifierFields = function () {
|
|
678
|
-
return ['id'];
|
|
679
|
-
};
|
|
680
|
-
return Coupon;
|
|
681
|
-
}(BaseModel));
|
|
682
|
-
__decorate([
|
|
683
|
-
classTransformer.Expose({ name: 'checkout_type' })
|
|
684
|
-
], Coupon.prototype, "checkoutType", void 0);
|
|
685
|
-
__decorate([
|
|
686
|
-
classTransformer.Expose({ name: 'exclusivity_type' })
|
|
672
|
+
var Coupon = /** @class */ (function (_super) {
|
|
673
|
+
__extends(Coupon, _super);
|
|
674
|
+
function Coupon() {
|
|
675
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
676
|
+
}
|
|
677
|
+
Coupon.prototype.identifierFields = function () {
|
|
678
|
+
return ['id'];
|
|
679
|
+
};
|
|
680
|
+
return Coupon;
|
|
681
|
+
}(BaseModel));
|
|
682
|
+
__decorate([
|
|
683
|
+
classTransformer.Expose({ name: 'checkout_type' })
|
|
684
|
+
], Coupon.prototype, "checkoutType", void 0);
|
|
685
|
+
__decorate([
|
|
686
|
+
classTransformer.Expose({ name: 'exclusivity_type' })
|
|
687
687
|
], Coupon.prototype, "exclusivityType", void 0);
|
|
688
688
|
|
|
689
|
-
exports.CheckoutTypes = void 0;
|
|
690
|
-
(function (CheckoutTypes) {
|
|
691
|
-
CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
|
|
692
|
-
CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
|
|
689
|
+
exports.CheckoutTypes = void 0;
|
|
690
|
+
(function (CheckoutTypes) {
|
|
691
|
+
CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
|
|
692
|
+
CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
|
|
693
693
|
})(exports.CheckoutTypes || (exports.CheckoutTypes = {}));
|
|
694
694
|
|
|
695
|
-
var COUPON_EXPIRATION = 60 * 60 * 24 * 30;
|
|
696
|
-
var FinancialCoupon = /** @class */ (function (_super) {
|
|
697
|
-
__extends(FinancialCoupon, _super);
|
|
698
|
-
function FinancialCoupon() {
|
|
699
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
700
|
-
_this.type = exports.CouponTypes.FINANCIAL;
|
|
701
|
-
return _this;
|
|
702
|
-
}
|
|
703
|
-
FinancialCoupon.isFinancialCoupon = function (coupon) {
|
|
704
|
-
return coupon.type === exports.CouponTypes.FINANCIAL && !!coupon.subtype;
|
|
705
|
-
};
|
|
706
|
-
FinancialCoupon.createCoupon = function (userId) {
|
|
707
|
-
return this.toInstance({
|
|
708
|
-
name: tsMd5.Md5.hashStr(userId + "_" + Date.now).toString(),
|
|
709
|
-
nickname: "" + Date.now(),
|
|
710
|
-
type: exports.CouponTypes.FINANCIAL,
|
|
711
|
-
subtype: exports.CouponSubtypes.PERCENTAGE,
|
|
712
|
-
checkoutType: exports.CheckoutTypes.ECOMMERCE,
|
|
713
|
-
discount: 30,
|
|
714
|
-
user: userId,
|
|
715
|
-
createdAt: new Date(Date.now()),
|
|
716
|
-
expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
|
|
717
|
-
});
|
|
718
|
-
};
|
|
719
|
-
return FinancialCoupon;
|
|
695
|
+
var COUPON_EXPIRATION = 60 * 60 * 24 * 30;
|
|
696
|
+
var FinancialCoupon = /** @class */ (function (_super) {
|
|
697
|
+
__extends(FinancialCoupon, _super);
|
|
698
|
+
function FinancialCoupon() {
|
|
699
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
700
|
+
_this.type = exports.CouponTypes.FINANCIAL;
|
|
701
|
+
return _this;
|
|
702
|
+
}
|
|
703
|
+
FinancialCoupon.isFinancialCoupon = function (coupon) {
|
|
704
|
+
return coupon.type === exports.CouponTypes.FINANCIAL && !!coupon.subtype;
|
|
705
|
+
};
|
|
706
|
+
FinancialCoupon.createCoupon = function (userId) {
|
|
707
|
+
return this.toInstance({
|
|
708
|
+
name: tsMd5.Md5.hashStr(userId + "_" + Date.now).toString(),
|
|
709
|
+
nickname: "" + Date.now(),
|
|
710
|
+
type: exports.CouponTypes.FINANCIAL,
|
|
711
|
+
subtype: exports.CouponSubtypes.PERCENTAGE,
|
|
712
|
+
checkoutType: exports.CheckoutTypes.ECOMMERCE,
|
|
713
|
+
discount: 30,
|
|
714
|
+
user: userId,
|
|
715
|
+
createdAt: new Date(Date.now()),
|
|
716
|
+
expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
|
|
717
|
+
});
|
|
718
|
+
};
|
|
719
|
+
return FinancialCoupon;
|
|
720
720
|
}(Coupon));
|
|
721
721
|
|
|
722
|
-
exports.OrderStatus = void 0;
|
|
723
|
-
(function (OrderStatus) {
|
|
724
|
-
OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
|
|
725
|
-
OrderStatus["EM_PREPARO"] = "Preparando pedido";
|
|
726
|
-
OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
|
|
727
|
-
OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
|
|
728
|
-
OrderStatus["ENVIADO"] = "Pedido Enviado";
|
|
729
|
-
OrderStatus["ENTREGUE"] = "Pedido entregue";
|
|
730
|
-
OrderStatus["CANCELADO"] = "Cancelado";
|
|
731
|
-
OrderStatus["CREDIT_CARD"] = "credit_card";
|
|
722
|
+
exports.OrderStatus = void 0;
|
|
723
|
+
(function (OrderStatus) {
|
|
724
|
+
OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
|
|
725
|
+
OrderStatus["EM_PREPARO"] = "Preparando pedido";
|
|
726
|
+
OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
|
|
727
|
+
OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
|
|
728
|
+
OrderStatus["ENVIADO"] = "Pedido Enviado";
|
|
729
|
+
OrderStatus["ENTREGUE"] = "Pedido entregue";
|
|
730
|
+
OrderStatus["CANCELADO"] = "Cancelado";
|
|
731
|
+
OrderStatus["CREDIT_CARD"] = "credit_card";
|
|
732
732
|
})(exports.OrderStatus || (exports.OrderStatus = {}));
|
|
733
733
|
|
|
734
|
-
var Checkout = /** @class */ (function (_super) {
|
|
735
|
-
__extends(Checkout, _super);
|
|
736
|
-
function Checkout() {
|
|
737
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
738
|
-
}
|
|
739
|
-
Checkout.prototype.identifierFields = function () {
|
|
740
|
-
return ['id'];
|
|
741
|
-
};
|
|
742
|
-
return Checkout;
|
|
734
|
+
var Checkout = /** @class */ (function (_super) {
|
|
735
|
+
__extends(Checkout, _super);
|
|
736
|
+
function Checkout() {
|
|
737
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
738
|
+
}
|
|
739
|
+
Checkout.prototype.identifierFields = function () {
|
|
740
|
+
return ['id'];
|
|
741
|
+
};
|
|
742
|
+
return Checkout;
|
|
743
743
|
}(BaseModel));
|
|
744
744
|
|
|
745
|
-
var LineItem = /** @class */ (function (_super) {
|
|
746
|
-
__extends(LineItem, _super);
|
|
747
|
-
function LineItem() {
|
|
748
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
749
|
-
}
|
|
750
|
-
return LineItem;
|
|
745
|
+
var LineItem = /** @class */ (function (_super) {
|
|
746
|
+
__extends(LineItem, _super);
|
|
747
|
+
function LineItem() {
|
|
748
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
749
|
+
}
|
|
750
|
+
return LineItem;
|
|
751
751
|
}(Product));
|
|
752
752
|
|
|
753
|
-
var Order = /** @class */ (function (_super) {
|
|
754
|
-
__extends(Order, _super);
|
|
755
|
-
function Order() {
|
|
756
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
757
|
-
}
|
|
758
|
-
return Order;
|
|
753
|
+
var Order = /** @class */ (function (_super) {
|
|
754
|
+
__extends(Order, _super);
|
|
755
|
+
function Order() {
|
|
756
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
757
|
+
}
|
|
758
|
+
return Order;
|
|
759
759
|
}(Checkout));
|
|
760
760
|
|
|
761
|
-
var Payment = /** @class */ (function (_super) {
|
|
762
|
-
__extends(Payment, _super);
|
|
763
|
-
function Payment() {
|
|
764
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
765
|
-
}
|
|
766
|
-
Payment.prototype.identifierFields = function () {
|
|
767
|
-
return ['id'];
|
|
768
|
-
};
|
|
769
|
-
return Payment;
|
|
770
|
-
}(BaseModel));
|
|
771
|
-
__decorate([
|
|
772
|
-
classTransformer.Expose({ name: 'refuse_reason' })
|
|
773
|
-
], Payment.prototype, "refuseReason", void 0);
|
|
774
|
-
__decorate([
|
|
775
|
-
classTransformer.Expose({ name: 'status_reason' })
|
|
776
|
-
], Payment.prototype, "statusReason", void 0);
|
|
777
|
-
__decorate([
|
|
778
|
-
classTransformer.Expose({ name: 'acquirer_response_code' })
|
|
779
|
-
], Payment.prototype, "acquirerResponseCode", void 0);
|
|
780
|
-
__decorate([
|
|
781
|
-
classTransformer.Expose({ name: 'acquirer_name' })
|
|
782
|
-
], Payment.prototype, "acquirerName", void 0);
|
|
783
|
-
__decorate([
|
|
784
|
-
classTransformer.Expose({ name: 'acquirer_id' })
|
|
785
|
-
], Payment.prototype, "acquirerId", void 0);
|
|
786
|
-
__decorate([
|
|
787
|
-
classTransformer.Expose({ name: 'authorization_code' })
|
|
788
|
-
], Payment.prototype, "authorizationCode", void 0);
|
|
789
|
-
__decorate([
|
|
790
|
-
classTransformer.Expose({ name: 'soft_descriptor' })
|
|
791
|
-
], Payment.prototype, "softDescriptor", void 0);
|
|
792
|
-
__decorate([
|
|
793
|
-
classTransformer.Expose({ name: 'date_created' })
|
|
794
|
-
], Payment.prototype, "dateCreated", void 0);
|
|
795
|
-
__decorate([
|
|
796
|
-
classTransformer.Expose({ name: 'date_updated' })
|
|
797
|
-
], Payment.prototype, "dateUpdated", void 0);
|
|
798
|
-
__decorate([
|
|
799
|
-
classTransformer.Expose({ name: 'authorized_amount' })
|
|
800
|
-
], Payment.prototype, "authorizedAmount", void 0);
|
|
801
|
-
__decorate([
|
|
802
|
-
classTransformer.Expose({ name: 'paid_amount' })
|
|
803
|
-
], Payment.prototype, "paidAmount", void 0);
|
|
804
|
-
__decorate([
|
|
805
|
-
classTransformer.Expose({ name: 'refunded_amount' })
|
|
806
|
-
], Payment.prototype, "refundedAmount", void 0);
|
|
807
|
-
__decorate([
|
|
808
|
-
classTransformer.Expose({ name: 'card_holder_name' })
|
|
809
|
-
], Payment.prototype, "cardHolderName", void 0);
|
|
810
|
-
__decorate([
|
|
811
|
-
classTransformer.Expose({ name: 'card_last_digits' })
|
|
812
|
-
], Payment.prototype, "cardLastDigits", void 0);
|
|
813
|
-
__decorate([
|
|
814
|
-
classTransformer.Expose({ name: 'card_first_digits' })
|
|
815
|
-
], Payment.prototype, "cardFirstDigits", void 0);
|
|
816
|
-
__decorate([
|
|
817
|
-
classTransformer.Expose({ name: 'card_brand' })
|
|
818
|
-
], Payment.prototype, "cardBrand", void 0);
|
|
819
|
-
__decorate([
|
|
820
|
-
classTransformer.Expose({ name: 'card_pin_mode' })
|
|
821
|
-
], Payment.prototype, "cardPinMode", void 0);
|
|
822
|
-
__decorate([
|
|
823
|
-
classTransformer.Expose({ name: 'card_magstripe_fallback' })
|
|
824
|
-
], Payment.prototype, "cardMagstripeFallback", void 0);
|
|
825
|
-
__decorate([
|
|
826
|
-
classTransformer.Expose({ name: 'cvm_pin' })
|
|
827
|
-
], Payment.prototype, "cvmPin", void 0);
|
|
828
|
-
__decorate([
|
|
829
|
-
classTransformer.Expose({ name: 'postback_url' })
|
|
830
|
-
], Payment.prototype, "postbackUrl", void 0);
|
|
831
|
-
__decorate([
|
|
832
|
-
classTransformer.Expose({ name: 'payment_method' })
|
|
833
|
-
], Payment.prototype, "paymentMethod", void 0);
|
|
834
|
-
__decorate([
|
|
835
|
-
classTransformer.Expose({ name: 'capture_method' })
|
|
836
|
-
], Payment.prototype, "captureMethod", void 0);
|
|
837
|
-
__decorate([
|
|
838
|
-
classTransformer.Expose({ name: 'antifraud_score' })
|
|
839
|
-
], Payment.prototype, "antifraudScore", void 0);
|
|
840
|
-
__decorate([
|
|
841
|
-
classTransformer.Expose({ name: 'boleto_url' })
|
|
842
|
-
], Payment.prototype, "boletoUrl", void 0);
|
|
843
|
-
__decorate([
|
|
844
|
-
classTransformer.Expose({ name: 'boleto_barcode' })
|
|
845
|
-
], Payment.prototype, "boletoBarcode", void 0);
|
|
846
|
-
__decorate([
|
|
847
|
-
classTransformer.Expose({ name: 'boleto_expiration_date' })
|
|
848
|
-
], Payment.prototype, "boletoExpirationDate", void 0);
|
|
849
|
-
__decorate([
|
|
850
|
-
classTransformer.Expose({ name: 'subscription_id' })
|
|
851
|
-
], Payment.prototype, "subscriptionId", void 0);
|
|
852
|
-
__decorate([
|
|
853
|
-
classTransformer.Expose({ name: 'split_rules' })
|
|
854
|
-
], Payment.prototype, "splitRules", void 0);
|
|
855
|
-
__decorate([
|
|
856
|
-
classTransformer.Expose({ name: 'antifraud_metadata' })
|
|
857
|
-
], Payment.prototype, "antifraudMetadata", void 0);
|
|
858
|
-
__decorate([
|
|
859
|
-
classTransformer.Expose({ name: 'reference_key' })
|
|
860
|
-
], Payment.prototype, "referenceKey", void 0);
|
|
861
|
-
__decorate([
|
|
862
|
-
classTransformer.Expose({ name: 'local_transaction_id' })
|
|
863
|
-
], Payment.prototype, "localTransactionId", void 0);
|
|
864
|
-
__decorate([
|
|
865
|
-
classTransformer.Expose({ name: 'local_time' })
|
|
866
|
-
], Payment.prototype, "localTime", void 0);
|
|
867
|
-
__decorate([
|
|
868
|
-
classTransformer.Expose({ name: 'fraud_covered' })
|
|
869
|
-
], Payment.prototype, "fraudCovered", void 0);
|
|
870
|
-
__decorate([
|
|
871
|
-
classTransformer.Expose({ name: 'fraud_reimbursed' })
|
|
872
|
-
], Payment.prototype, "fraudReimbursed", void 0);
|
|
873
|
-
__decorate([
|
|
874
|
-
classTransformer.Expose({ name: 'order_id' })
|
|
875
|
-
], Payment.prototype, "orderId", void 0);
|
|
876
|
-
__decorate([
|
|
877
|
-
classTransformer.Expose({ name: 'risk_level' })
|
|
878
|
-
], Payment.prototype, "riskLevel", void 0);
|
|
879
|
-
__decorate([
|
|
880
|
-
classTransformer.Expose({ name: 'receipt_url' })
|
|
881
|
-
], Payment.prototype, "receiptUrl", void 0);
|
|
882
|
-
__decorate([
|
|
883
|
-
classTransformer.Expose({ name: 'private_label' })
|
|
884
|
-
], Payment.prototype, "privateLabel", void 0);
|
|
885
|
-
__decorate([
|
|
886
|
-
classTransformer.Expose({ name: 'pix_qr_code' })
|
|
887
|
-
], Payment.prototype, "pixQrCode", void 0);
|
|
888
|
-
__decorate([
|
|
889
|
-
classTransformer.Expose({ name: 'pix_expiration_date' })
|
|
761
|
+
var Payment = /** @class */ (function (_super) {
|
|
762
|
+
__extends(Payment, _super);
|
|
763
|
+
function Payment() {
|
|
764
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
765
|
+
}
|
|
766
|
+
Payment.prototype.identifierFields = function () {
|
|
767
|
+
return ['id'];
|
|
768
|
+
};
|
|
769
|
+
return Payment;
|
|
770
|
+
}(BaseModel));
|
|
771
|
+
__decorate([
|
|
772
|
+
classTransformer.Expose({ name: 'refuse_reason' })
|
|
773
|
+
], Payment.prototype, "refuseReason", void 0);
|
|
774
|
+
__decorate([
|
|
775
|
+
classTransformer.Expose({ name: 'status_reason' })
|
|
776
|
+
], Payment.prototype, "statusReason", void 0);
|
|
777
|
+
__decorate([
|
|
778
|
+
classTransformer.Expose({ name: 'acquirer_response_code' })
|
|
779
|
+
], Payment.prototype, "acquirerResponseCode", void 0);
|
|
780
|
+
__decorate([
|
|
781
|
+
classTransformer.Expose({ name: 'acquirer_name' })
|
|
782
|
+
], Payment.prototype, "acquirerName", void 0);
|
|
783
|
+
__decorate([
|
|
784
|
+
classTransformer.Expose({ name: 'acquirer_id' })
|
|
785
|
+
], Payment.prototype, "acquirerId", void 0);
|
|
786
|
+
__decorate([
|
|
787
|
+
classTransformer.Expose({ name: 'authorization_code' })
|
|
788
|
+
], Payment.prototype, "authorizationCode", void 0);
|
|
789
|
+
__decorate([
|
|
790
|
+
classTransformer.Expose({ name: 'soft_descriptor' })
|
|
791
|
+
], Payment.prototype, "softDescriptor", void 0);
|
|
792
|
+
__decorate([
|
|
793
|
+
classTransformer.Expose({ name: 'date_created' })
|
|
794
|
+
], Payment.prototype, "dateCreated", void 0);
|
|
795
|
+
__decorate([
|
|
796
|
+
classTransformer.Expose({ name: 'date_updated' })
|
|
797
|
+
], Payment.prototype, "dateUpdated", void 0);
|
|
798
|
+
__decorate([
|
|
799
|
+
classTransformer.Expose({ name: 'authorized_amount' })
|
|
800
|
+
], Payment.prototype, "authorizedAmount", void 0);
|
|
801
|
+
__decorate([
|
|
802
|
+
classTransformer.Expose({ name: 'paid_amount' })
|
|
803
|
+
], Payment.prototype, "paidAmount", void 0);
|
|
804
|
+
__decorate([
|
|
805
|
+
classTransformer.Expose({ name: 'refunded_amount' })
|
|
806
|
+
], Payment.prototype, "refundedAmount", void 0);
|
|
807
|
+
__decorate([
|
|
808
|
+
classTransformer.Expose({ name: 'card_holder_name' })
|
|
809
|
+
], Payment.prototype, "cardHolderName", void 0);
|
|
810
|
+
__decorate([
|
|
811
|
+
classTransformer.Expose({ name: 'card_last_digits' })
|
|
812
|
+
], Payment.prototype, "cardLastDigits", void 0);
|
|
813
|
+
__decorate([
|
|
814
|
+
classTransformer.Expose({ name: 'card_first_digits' })
|
|
815
|
+
], Payment.prototype, "cardFirstDigits", void 0);
|
|
816
|
+
__decorate([
|
|
817
|
+
classTransformer.Expose({ name: 'card_brand' })
|
|
818
|
+
], Payment.prototype, "cardBrand", void 0);
|
|
819
|
+
__decorate([
|
|
820
|
+
classTransformer.Expose({ name: 'card_pin_mode' })
|
|
821
|
+
], Payment.prototype, "cardPinMode", void 0);
|
|
822
|
+
__decorate([
|
|
823
|
+
classTransformer.Expose({ name: 'card_magstripe_fallback' })
|
|
824
|
+
], Payment.prototype, "cardMagstripeFallback", void 0);
|
|
825
|
+
__decorate([
|
|
826
|
+
classTransformer.Expose({ name: 'cvm_pin' })
|
|
827
|
+
], Payment.prototype, "cvmPin", void 0);
|
|
828
|
+
__decorate([
|
|
829
|
+
classTransformer.Expose({ name: 'postback_url' })
|
|
830
|
+
], Payment.prototype, "postbackUrl", void 0);
|
|
831
|
+
__decorate([
|
|
832
|
+
classTransformer.Expose({ name: 'payment_method' })
|
|
833
|
+
], Payment.prototype, "paymentMethod", void 0);
|
|
834
|
+
__decorate([
|
|
835
|
+
classTransformer.Expose({ name: 'capture_method' })
|
|
836
|
+
], Payment.prototype, "captureMethod", void 0);
|
|
837
|
+
__decorate([
|
|
838
|
+
classTransformer.Expose({ name: 'antifraud_score' })
|
|
839
|
+
], Payment.prototype, "antifraudScore", void 0);
|
|
840
|
+
__decorate([
|
|
841
|
+
classTransformer.Expose({ name: 'boleto_url' })
|
|
842
|
+
], Payment.prototype, "boletoUrl", void 0);
|
|
843
|
+
__decorate([
|
|
844
|
+
classTransformer.Expose({ name: 'boleto_barcode' })
|
|
845
|
+
], Payment.prototype, "boletoBarcode", void 0);
|
|
846
|
+
__decorate([
|
|
847
|
+
classTransformer.Expose({ name: 'boleto_expiration_date' })
|
|
848
|
+
], Payment.prototype, "boletoExpirationDate", void 0);
|
|
849
|
+
__decorate([
|
|
850
|
+
classTransformer.Expose({ name: 'subscription_id' })
|
|
851
|
+
], Payment.prototype, "subscriptionId", void 0);
|
|
852
|
+
__decorate([
|
|
853
|
+
classTransformer.Expose({ name: 'split_rules' })
|
|
854
|
+
], Payment.prototype, "splitRules", void 0);
|
|
855
|
+
__decorate([
|
|
856
|
+
classTransformer.Expose({ name: 'antifraud_metadata' })
|
|
857
|
+
], Payment.prototype, "antifraudMetadata", void 0);
|
|
858
|
+
__decorate([
|
|
859
|
+
classTransformer.Expose({ name: 'reference_key' })
|
|
860
|
+
], Payment.prototype, "referenceKey", void 0);
|
|
861
|
+
__decorate([
|
|
862
|
+
classTransformer.Expose({ name: 'local_transaction_id' })
|
|
863
|
+
], Payment.prototype, "localTransactionId", void 0);
|
|
864
|
+
__decorate([
|
|
865
|
+
classTransformer.Expose({ name: 'local_time' })
|
|
866
|
+
], Payment.prototype, "localTime", void 0);
|
|
867
|
+
__decorate([
|
|
868
|
+
classTransformer.Expose({ name: 'fraud_covered' })
|
|
869
|
+
], Payment.prototype, "fraudCovered", void 0);
|
|
870
|
+
__decorate([
|
|
871
|
+
classTransformer.Expose({ name: 'fraud_reimbursed' })
|
|
872
|
+
], Payment.prototype, "fraudReimbursed", void 0);
|
|
873
|
+
__decorate([
|
|
874
|
+
classTransformer.Expose({ name: 'order_id' })
|
|
875
|
+
], Payment.prototype, "orderId", void 0);
|
|
876
|
+
__decorate([
|
|
877
|
+
classTransformer.Expose({ name: 'risk_level' })
|
|
878
|
+
], Payment.prototype, "riskLevel", void 0);
|
|
879
|
+
__decorate([
|
|
880
|
+
classTransformer.Expose({ name: 'receipt_url' })
|
|
881
|
+
], Payment.prototype, "receiptUrl", void 0);
|
|
882
|
+
__decorate([
|
|
883
|
+
classTransformer.Expose({ name: 'private_label' })
|
|
884
|
+
], Payment.prototype, "privateLabel", void 0);
|
|
885
|
+
__decorate([
|
|
886
|
+
classTransformer.Expose({ name: 'pix_qr_code' })
|
|
887
|
+
], Payment.prototype, "pixQrCode", void 0);
|
|
888
|
+
__decorate([
|
|
889
|
+
classTransformer.Expose({ name: 'pix_expiration_date' })
|
|
890
890
|
], Payment.prototype, "pixExpirationDate", void 0);
|
|
891
891
|
|
|
892
|
-
var ShippingMethod = /** @class */ (function (_super) {
|
|
893
|
-
__extends(ShippingMethod, _super);
|
|
894
|
-
function ShippingMethod() {
|
|
895
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
896
|
-
}
|
|
897
|
-
ShippingMethod.prototype.identifierFields = function () {
|
|
898
|
-
return ['id'];
|
|
899
|
-
};
|
|
900
|
-
return ShippingMethod;
|
|
892
|
+
var ShippingMethod = /** @class */ (function (_super) {
|
|
893
|
+
__extends(ShippingMethod, _super);
|
|
894
|
+
function ShippingMethod() {
|
|
895
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
896
|
+
}
|
|
897
|
+
ShippingMethod.prototype.identifierFields = function () {
|
|
898
|
+
return ['id'];
|
|
899
|
+
};
|
|
900
|
+
return ShippingMethod;
|
|
901
901
|
}(BaseModel));
|
|
902
902
|
|
|
903
|
-
var CheckoutSubscription = /** @class */ (function (_super) {
|
|
904
|
-
__extends(CheckoutSubscription, _super);
|
|
905
|
-
function CheckoutSubscription() {
|
|
906
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
907
|
-
}
|
|
908
|
-
CheckoutSubscription.prototype.identifierFields = function () {
|
|
909
|
-
return ['id'];
|
|
910
|
-
};
|
|
911
|
-
return CheckoutSubscription;
|
|
903
|
+
var CheckoutSubscription = /** @class */ (function (_super) {
|
|
904
|
+
__extends(CheckoutSubscription, _super);
|
|
905
|
+
function CheckoutSubscription() {
|
|
906
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
907
|
+
}
|
|
908
|
+
CheckoutSubscription.prototype.identifierFields = function () {
|
|
909
|
+
return ['id'];
|
|
910
|
+
};
|
|
911
|
+
return CheckoutSubscription;
|
|
912
912
|
}(BaseModel));
|
|
913
913
|
|
|
914
|
-
var SubscriptionPlan = /** @class */ (function (_super) {
|
|
915
|
-
__extends(SubscriptionPlan, _super);
|
|
916
|
-
function SubscriptionPlan() {
|
|
917
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
918
|
-
}
|
|
919
|
-
SubscriptionPlan.prototype.identifierFields = function () {
|
|
920
|
-
return ['id'];
|
|
921
|
-
};
|
|
922
|
-
return SubscriptionPlan;
|
|
914
|
+
var SubscriptionPlan = /** @class */ (function (_super) {
|
|
915
|
+
__extends(SubscriptionPlan, _super);
|
|
916
|
+
function SubscriptionPlan() {
|
|
917
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
918
|
+
}
|
|
919
|
+
SubscriptionPlan.prototype.identifierFields = function () {
|
|
920
|
+
return ['id'];
|
|
921
|
+
};
|
|
922
|
+
return SubscriptionPlan;
|
|
923
923
|
}(BaseModel));
|
|
924
924
|
|
|
925
|
-
var Buy2Win = /** @class */ (function (_super) {
|
|
926
|
-
__extends(Buy2Win, _super);
|
|
927
|
-
function Buy2Win() {
|
|
928
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
929
|
-
}
|
|
930
|
-
Buy2Win.prototype.identifierFields = function () {
|
|
931
|
-
return ['id'];
|
|
932
|
-
};
|
|
933
|
-
return Buy2Win;
|
|
925
|
+
var Buy2Win = /** @class */ (function (_super) {
|
|
926
|
+
__extends(Buy2Win, _super);
|
|
927
|
+
function Buy2Win() {
|
|
928
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
929
|
+
}
|
|
930
|
+
Buy2Win.prototype.identifierFields = function () {
|
|
931
|
+
return ['id'];
|
|
932
|
+
};
|
|
933
|
+
return Buy2Win;
|
|
934
934
|
}(BaseModel));
|
|
935
935
|
|
|
936
|
-
var Home = /** @class */ (function (_super) {
|
|
937
|
-
__extends(Home, _super);
|
|
938
|
-
function Home() {
|
|
939
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
940
|
-
}
|
|
941
|
-
Home.prototype.identifierFields = function () {
|
|
942
|
-
return ['id'];
|
|
943
|
-
};
|
|
944
|
-
return Home;
|
|
936
|
+
var Home = /** @class */ (function (_super) {
|
|
937
|
+
__extends(Home, _super);
|
|
938
|
+
function Home() {
|
|
939
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
940
|
+
}
|
|
941
|
+
Home.prototype.identifierFields = function () {
|
|
942
|
+
return ['id'];
|
|
943
|
+
};
|
|
944
|
+
return Home;
|
|
945
945
|
}(BaseModel));
|
|
946
946
|
|
|
947
|
-
var ShopMenu = /** @class */ (function (_super) {
|
|
948
|
-
__extends(ShopMenu, _super);
|
|
949
|
-
function ShopMenu() {
|
|
950
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
951
|
-
}
|
|
952
|
-
ShopMenu.prototype.identifierFields = function () {
|
|
953
|
-
return ['id'];
|
|
954
|
-
};
|
|
955
|
-
return ShopMenu;
|
|
947
|
+
var ShopMenu = /** @class */ (function (_super) {
|
|
948
|
+
__extends(ShopMenu, _super);
|
|
949
|
+
function ShopMenu() {
|
|
950
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
951
|
+
}
|
|
952
|
+
ShopMenu.prototype.identifierFields = function () {
|
|
953
|
+
return ['id'];
|
|
954
|
+
};
|
|
955
|
+
return ShopMenu;
|
|
956
956
|
}(BaseModel));
|
|
957
957
|
|
|
958
|
-
var InvalidArgumentError = /** @class */ (function (_super) {
|
|
959
|
-
__extends(InvalidArgumentError, _super);
|
|
960
|
-
function InvalidArgumentError(message) {
|
|
961
|
-
var _this = _super.call(this, message) || this;
|
|
962
|
-
_this.message = message;
|
|
963
|
-
return _this;
|
|
964
|
-
}
|
|
965
|
-
return InvalidArgumentError;
|
|
958
|
+
var InvalidArgumentError = /** @class */ (function (_super) {
|
|
959
|
+
__extends(InvalidArgumentError, _super);
|
|
960
|
+
function InvalidArgumentError(message) {
|
|
961
|
+
var _this = _super.call(this, message) || this;
|
|
962
|
+
_this.message = message;
|
|
963
|
+
return _this;
|
|
964
|
+
}
|
|
965
|
+
return InvalidArgumentError;
|
|
966
966
|
}(Error));
|
|
967
967
|
|
|
968
|
-
var RequiredArgumentError = /** @class */ (function (_super) {
|
|
969
|
-
__extends(RequiredArgumentError, _super);
|
|
970
|
-
function RequiredArgumentError(args) {
|
|
971
|
-
var _this = _super.call(this, "Required arguments: " + args.join(', ')) || this;
|
|
972
|
-
_this.args = args;
|
|
973
|
-
_this.arguments = args;
|
|
974
|
-
return _this;
|
|
975
|
-
}
|
|
976
|
-
return RequiredArgumentError;
|
|
968
|
+
var RequiredArgumentError = /** @class */ (function (_super) {
|
|
969
|
+
__extends(RequiredArgumentError, _super);
|
|
970
|
+
function RequiredArgumentError(args) {
|
|
971
|
+
var _this = _super.call(this, "Required arguments: " + args.join(', ')) || this;
|
|
972
|
+
_this.args = args;
|
|
973
|
+
_this.arguments = args;
|
|
974
|
+
return _this;
|
|
975
|
+
}
|
|
976
|
+
return RequiredArgumentError;
|
|
977
977
|
}(Error));
|
|
978
978
|
|
|
979
|
-
var NotFoundError = /** @class */ (function (_super) {
|
|
980
|
-
__extends(NotFoundError, _super);
|
|
981
|
-
function NotFoundError(message) {
|
|
982
|
-
var _this = _super.call(this, message) || this;
|
|
983
|
-
_this.message = message;
|
|
984
|
-
return _this;
|
|
985
|
-
}
|
|
986
|
-
return NotFoundError;
|
|
979
|
+
var NotFoundError = /** @class */ (function (_super) {
|
|
980
|
+
__extends(NotFoundError, _super);
|
|
981
|
+
function NotFoundError(message) {
|
|
982
|
+
var _this = _super.call(this, message) || this;
|
|
983
|
+
_this.message = message;
|
|
984
|
+
return _this;
|
|
985
|
+
}
|
|
986
|
+
return NotFoundError;
|
|
987
987
|
}(Error));
|
|
988
988
|
|
|
989
|
-
var withFirestore = function (MixinBase) {
|
|
990
|
-
return /** @class */ (function (_super) {
|
|
991
|
-
__extends(class_1, _super);
|
|
992
|
-
function class_1() {
|
|
993
|
-
var args = [];
|
|
994
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
995
|
-
args[_i] = arguments[_i];
|
|
996
|
-
}
|
|
997
|
-
return _super.call(this, args) || this;
|
|
998
|
-
}
|
|
999
|
-
class_1.prototype.collection = function (path) {
|
|
1000
|
-
return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
|
|
1001
|
-
};
|
|
1002
|
-
class_1.prototype.buildModelInstance = function () {
|
|
1003
|
-
var _this = this;
|
|
1004
|
-
return {
|
|
1005
|
-
toFirestore: function (data) { return data.toPlain(); },
|
|
1006
|
-
fromFirestore: function (snap) {
|
|
1007
|
-
var data = snap.data();
|
|
1008
|
-
Object.keys(data).forEach(function (key) {
|
|
1009
|
-
if (data[key] instanceof firebase__default["default"].firestore.Timestamp) {
|
|
1010
|
-
data[key] = data[key].toDate();
|
|
1011
|
-
}
|
|
1012
|
-
});
|
|
1013
|
-
return _this.model.toInstance(Object.assign({ id: snap.id }, data));
|
|
1014
|
-
},
|
|
1015
|
-
};
|
|
1016
|
-
};
|
|
1017
|
-
return class_1;
|
|
1018
|
-
}(MixinBase));
|
|
989
|
+
var withFirestore = function (MixinBase) {
|
|
990
|
+
return /** @class */ (function (_super) {
|
|
991
|
+
__extends(class_1, _super);
|
|
992
|
+
function class_1() {
|
|
993
|
+
var args = [];
|
|
994
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
995
|
+
args[_i] = arguments[_i];
|
|
996
|
+
}
|
|
997
|
+
return _super.call(this, args) || this;
|
|
998
|
+
}
|
|
999
|
+
class_1.prototype.collection = function (path) {
|
|
1000
|
+
return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
|
|
1001
|
+
};
|
|
1002
|
+
class_1.prototype.buildModelInstance = function () {
|
|
1003
|
+
var _this = this;
|
|
1004
|
+
return {
|
|
1005
|
+
toFirestore: function (data) { return data.toPlain(); },
|
|
1006
|
+
fromFirestore: function (snap) {
|
|
1007
|
+
var data = snap.data();
|
|
1008
|
+
Object.keys(data).forEach(function (key) {
|
|
1009
|
+
if (data[key] instanceof firebase__default["default"].firestore.Timestamp) {
|
|
1010
|
+
data[key] = data[key].toDate();
|
|
1011
|
+
}
|
|
1012
|
+
});
|
|
1013
|
+
return _this.model.toInstance(Object.assign({ id: snap.id }, data));
|
|
1014
|
+
},
|
|
1015
|
+
};
|
|
1016
|
+
};
|
|
1017
|
+
return class_1;
|
|
1018
|
+
}(MixinBase));
|
|
1019
1019
|
};
|
|
1020
1020
|
|
|
1021
|
-
var withHelpers = function (MixinBase) {
|
|
1022
|
-
return /** @class */ (function (_super) {
|
|
1023
|
-
__extends(class_1, _super);
|
|
1024
|
-
function class_1() {
|
|
1025
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1026
|
-
}
|
|
1027
|
-
class_1.prototype.toArray = function (snapShot) {
|
|
1028
|
-
if (Array.isArray(snapShot)) {
|
|
1029
|
-
return snapShot.map(function (doc) { return doc.data(); });
|
|
1030
|
-
}
|
|
1031
|
-
else {
|
|
1032
|
-
return snapShot.docs.map(function (doc) { return doc.data(); });
|
|
1033
|
-
}
|
|
1034
|
-
};
|
|
1035
|
-
class_1.prototype.isSubCollection = function (repository) {
|
|
1036
|
-
return !lodash.isNil(Object.keys(this).find(function (key) { return key === 'parentRepository'; }));
|
|
1037
|
-
};
|
|
1038
|
-
return class_1;
|
|
1039
|
-
}(MixinBase));
|
|
1021
|
+
var withHelpers = function (MixinBase) {
|
|
1022
|
+
return /** @class */ (function (_super) {
|
|
1023
|
+
__extends(class_1, _super);
|
|
1024
|
+
function class_1() {
|
|
1025
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1026
|
+
}
|
|
1027
|
+
class_1.prototype.toArray = function (snapShot) {
|
|
1028
|
+
if (Array.isArray(snapShot)) {
|
|
1029
|
+
return snapShot.map(function (doc) { return doc.data(); });
|
|
1030
|
+
}
|
|
1031
|
+
else {
|
|
1032
|
+
return snapShot.docs.map(function (doc) { return doc.data(); });
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
1035
|
+
class_1.prototype.isSubCollection = function (repository) {
|
|
1036
|
+
return !lodash.isNil(Object.keys(this).find(function (key) { return key === 'parentRepository'; }));
|
|
1037
|
+
};
|
|
1038
|
+
return class_1;
|
|
1039
|
+
}(MixinBase));
|
|
1040
1040
|
};
|
|
1041
1041
|
|
|
1042
|
-
var withGetFirestore = function (MixinBase) {
|
|
1043
|
-
return /** @class */ (function (_super) {
|
|
1044
|
-
__extends(GetFirestore, _super);
|
|
1045
|
-
function GetFirestore() {
|
|
1046
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1047
|
-
}
|
|
1048
|
-
GetFirestore.prototype.get = function (identifiers) {
|
|
1049
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1050
|
-
var doc, data;
|
|
1051
|
-
return __generator(this, function (_a) {
|
|
1052
|
-
switch (_a.label) {
|
|
1053
|
-
case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForGet(identifiers))
|
|
1054
|
-
.doc(Object.values(identifiers).shift().toString())
|
|
1055
|
-
.get()];
|
|
1056
|
-
case 1:
|
|
1057
|
-
doc = _a.sent();
|
|
1058
|
-
data = doc.data();
|
|
1059
|
-
if (lodash.isNil(data))
|
|
1060
|
-
throw new NotFoundError("Document " + JSON.stringify(identifiers) + " not found");
|
|
1061
|
-
return [2 /*return*/, data];
|
|
1062
|
-
}
|
|
1063
|
-
});
|
|
1064
|
-
});
|
|
1065
|
-
};
|
|
1066
|
-
GetFirestore.prototype.buildCollectionPathForGet = function (identifiers) {
|
|
1067
|
-
return this.isSubCollection(this)
|
|
1068
|
-
? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
|
|
1069
|
-
: this.collectionName;
|
|
1070
|
-
};
|
|
1071
|
-
return GetFirestore;
|
|
1072
|
-
}(MixinBase));
|
|
1042
|
+
var withGetFirestore = function (MixinBase) {
|
|
1043
|
+
return /** @class */ (function (_super) {
|
|
1044
|
+
__extends(GetFirestore, _super);
|
|
1045
|
+
function GetFirestore() {
|
|
1046
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1047
|
+
}
|
|
1048
|
+
GetFirestore.prototype.get = function (identifiers) {
|
|
1049
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1050
|
+
var doc, data;
|
|
1051
|
+
return __generator(this, function (_a) {
|
|
1052
|
+
switch (_a.label) {
|
|
1053
|
+
case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForGet(identifiers))
|
|
1054
|
+
.doc(Object.values(identifiers).shift().toString())
|
|
1055
|
+
.get()];
|
|
1056
|
+
case 1:
|
|
1057
|
+
doc = _a.sent();
|
|
1058
|
+
data = doc.data();
|
|
1059
|
+
if (lodash.isNil(data))
|
|
1060
|
+
throw new NotFoundError("Document " + JSON.stringify(identifiers) + " not found");
|
|
1061
|
+
return [2 /*return*/, data];
|
|
1062
|
+
}
|
|
1063
|
+
});
|
|
1064
|
+
});
|
|
1065
|
+
};
|
|
1066
|
+
GetFirestore.prototype.buildCollectionPathForGet = function (identifiers) {
|
|
1067
|
+
return this.isSubCollection(this)
|
|
1068
|
+
? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
|
|
1069
|
+
: this.collectionName;
|
|
1070
|
+
};
|
|
1071
|
+
return GetFirestore;
|
|
1072
|
+
}(MixinBase));
|
|
1073
1073
|
};
|
|
1074
1074
|
|
|
1075
|
-
var withFindFirestore = function (MixinBase) {
|
|
1076
|
-
return /** @class */ (function (_super) {
|
|
1077
|
-
__extends(FindFirestore, _super);
|
|
1078
|
-
function FindFirestore() {
|
|
1079
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1080
|
-
_this.makeFirestoreWhere = function (queryReference, filter) { return Object.keys(filter).reduce(function (query, fieldName) { return _this.buildWhereSentence(query, fieldName, filter[fieldName]); }, queryReference); };
|
|
1081
|
-
_this.buildWhereSentence = function (queryReference, fieldName, options) {
|
|
1082
|
-
if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
|
|
1083
|
-
return queryReference;
|
|
1084
|
-
if (options.operator === exports.Where.LIKE) {
|
|
1085
|
-
queryReference = queryReference.where(fieldName.toString(), '>=', options.value);
|
|
1086
|
-
queryReference = queryReference.where(fieldName.toString(), '<=', options.value + "~");
|
|
1087
|
-
return queryReference;
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
query =
|
|
1104
|
-
return
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
if (
|
|
1129
|
-
query = query.
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
if (data.length
|
|
1139
|
-
return
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1075
|
+
var withFindFirestore = function (MixinBase) {
|
|
1076
|
+
return /** @class */ (function (_super) {
|
|
1077
|
+
__extends(FindFirestore, _super);
|
|
1078
|
+
function FindFirestore() {
|
|
1079
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1080
|
+
_this.makeFirestoreWhere = function (queryReference, filter) { return Object.keys(filter).reduce(function (query, fieldName) { return _this.buildWhereSentence(query, fieldName, filter[fieldName]); }, queryReference); };
|
|
1081
|
+
_this.buildWhereSentence = function (queryReference, fieldName, options) {
|
|
1082
|
+
if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
|
|
1083
|
+
return queryReference;
|
|
1084
|
+
if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.LIKE) {
|
|
1085
|
+
queryReference = queryReference.where(fieldName.toString(), '>=', options.value);
|
|
1086
|
+
queryReference = queryReference.where(fieldName.toString(), '<=', options.value + "~");
|
|
1087
|
+
return queryReference;
|
|
1088
|
+
}
|
|
1089
|
+
if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1090
|
+
return queryReference.where(fieldName.toString(), 'array-contains-any', options.value);
|
|
1091
|
+
return queryReference.where(fieldName.toString(), options.operator, options.value);
|
|
1092
|
+
};
|
|
1093
|
+
return _this;
|
|
1094
|
+
}
|
|
1095
|
+
FindFirestore.prototype.find = function (filters, limits, orderBy) {
|
|
1096
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1097
|
+
var query, docs, data;
|
|
1098
|
+
var _this = this;
|
|
1099
|
+
return __generator(this, function (_b) {
|
|
1100
|
+
switch (_b.label) {
|
|
1101
|
+
case 0:
|
|
1102
|
+
query = this.collection(this.buildCollectionPathForFind(filters));
|
|
1103
|
+
filters === null || filters === void 0 ? void 0 : filters.forEach(function (filterer) { return (query = _this.makeFirestoreWhere(query, filterer)); });
|
|
1104
|
+
orderBy === null || orderBy === void 0 ? void 0 : orderBy.forEach(function (orderer) { return Object.keys(orderer).forEach(function (fieldName) { return (query = query.orderBy(fieldName, orderer[fieldName])); }); });
|
|
1105
|
+
query = this.defineLimits(query, filters, limits);
|
|
1106
|
+
return [4 /*yield*/, query.get()];
|
|
1107
|
+
case 1:
|
|
1108
|
+
docs = _b.sent();
|
|
1109
|
+
data = docs.docs.map(function (doc) { return doc.data(); });
|
|
1110
|
+
return [2 /*return*/, {
|
|
1111
|
+
data: data,
|
|
1112
|
+
count: this.calculateCount(data, limits),
|
|
1113
|
+
}];
|
|
1114
|
+
}
|
|
1115
|
+
});
|
|
1116
|
+
});
|
|
1117
|
+
};
|
|
1118
|
+
FindFirestore.prototype.buildCollectionPathForFind = function (filters) {
|
|
1119
|
+
var _a;
|
|
1120
|
+
if (!this.isSubCollection(this))
|
|
1121
|
+
return this.collectionName;
|
|
1122
|
+
var parentIdField = this.parentIdField;
|
|
1123
|
+
var parentId = (_a = filters.find(function (groupFilter) { var _a; return Boolean((_a = groupFilter[parentIdField]) === null || _a === void 0 ? void 0 : _a.value); })) === null || _a === void 0 ? void 0 : _a[parentIdField].value;
|
|
1124
|
+
return this.parentRepository.collectionName + "/" + parentId + "/" + this.collectionName;
|
|
1125
|
+
};
|
|
1126
|
+
FindFirestore.prototype.defineLimits = function (query, filters, limits) {
|
|
1127
|
+
if (limits === null || limits === void 0 ? void 0 : limits.offset) {
|
|
1128
|
+
if (limits.offset instanceof this.model)
|
|
1129
|
+
query = query.startAfter(this.collection(this.buildCollectionPathForFind(filters)).doc(limits.offset[limits.offset.identifierFields().shift()]));
|
|
1130
|
+
if (lodash.isNumber(limits.offset) || lodash.isString(limits.offset))
|
|
1131
|
+
query = query.startAt(limits.offset);
|
|
1132
|
+
}
|
|
1133
|
+
if (limits === null || limits === void 0 ? void 0 : limits.limit)
|
|
1134
|
+
query = query.limit(limits.limit);
|
|
1135
|
+
return query;
|
|
1136
|
+
};
|
|
1137
|
+
FindFirestore.prototype.calculateCount = function (data, limits) {
|
|
1138
|
+
if (data.length <= 0)
|
|
1139
|
+
return 0;
|
|
1140
|
+
if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
|
|
1141
|
+
return data.length;
|
|
1142
|
+
return Infinity;
|
|
1143
|
+
};
|
|
1144
|
+
return FindFirestore;
|
|
1145
|
+
}(MixinBase));
|
|
1144
1146
|
};
|
|
1145
1147
|
|
|
1146
|
-
var withCreateFirestore = function (MixinBase) {
|
|
1147
|
-
return /** @class */ (function (_super) {
|
|
1148
|
-
__extends(CreateFirestore, _super);
|
|
1149
|
-
function CreateFirestore() {
|
|
1150
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1151
|
-
}
|
|
1152
|
-
CreateFirestore.prototype.create = function (data) {
|
|
1153
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1154
|
-
var docRef, doc;
|
|
1155
|
-
return __generator(this, function (_b) {
|
|
1156
|
-
switch (_b.label) {
|
|
1157
|
-
case 0: return [4 /*yield*/, this.save(this.model.toInstance(data))];
|
|
1158
|
-
case 1:
|
|
1159
|
-
docRef = _b.sent();
|
|
1160
|
-
return [4 /*yield*/, docRef.get()];
|
|
1161
|
-
case 2:
|
|
1162
|
-
doc = _b.sent();
|
|
1163
|
-
return [2 /*return*/, doc.data()];
|
|
1164
|
-
}
|
|
1165
|
-
});
|
|
1166
|
-
});
|
|
1167
|
-
};
|
|
1168
|
-
CreateFirestore.prototype.save = function (data) {
|
|
1169
|
-
var _a;
|
|
1170
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1171
|
-
var id, docRef;
|
|
1172
|
-
return __generator(this, function (_b) {
|
|
1173
|
-
switch (_b.label) {
|
|
1174
|
-
case 0:
|
|
1175
|
-
id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
|
|
1176
|
-
if (lodash.isEmpty(id))
|
|
1177
|
-
return [2 /*return*/, this.collection(this.buildCollectionPathForAdd(data)).add(data)];
|
|
1178
|
-
docRef = this.collection().doc(id);
|
|
1179
|
-
return [4 /*yield*/, docRef.set(data)];
|
|
1180
|
-
case 1:
|
|
1181
|
-
_b.sent();
|
|
1182
|
-
return [2 /*return*/, docRef];
|
|
1183
|
-
}
|
|
1184
|
-
});
|
|
1185
|
-
});
|
|
1186
|
-
};
|
|
1187
|
-
CreateFirestore.prototype.buildCollectionPathForAdd = function (identifiers) {
|
|
1188
|
-
return this.isSubCollection(this)
|
|
1189
|
-
? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
|
|
1190
|
-
: this.collectionName;
|
|
1191
|
-
};
|
|
1192
|
-
return CreateFirestore;
|
|
1193
|
-
}(MixinBase));
|
|
1148
|
+
var withCreateFirestore = function (MixinBase) {
|
|
1149
|
+
return /** @class */ (function (_super) {
|
|
1150
|
+
__extends(CreateFirestore, _super);
|
|
1151
|
+
function CreateFirestore() {
|
|
1152
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1153
|
+
}
|
|
1154
|
+
CreateFirestore.prototype.create = function (data) {
|
|
1155
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1156
|
+
var docRef, doc;
|
|
1157
|
+
return __generator(this, function (_b) {
|
|
1158
|
+
switch (_b.label) {
|
|
1159
|
+
case 0: return [4 /*yield*/, this.save(this.model.toInstance(data))];
|
|
1160
|
+
case 1:
|
|
1161
|
+
docRef = _b.sent();
|
|
1162
|
+
return [4 /*yield*/, docRef.get()];
|
|
1163
|
+
case 2:
|
|
1164
|
+
doc = _b.sent();
|
|
1165
|
+
return [2 /*return*/, doc.data()];
|
|
1166
|
+
}
|
|
1167
|
+
});
|
|
1168
|
+
});
|
|
1169
|
+
};
|
|
1170
|
+
CreateFirestore.prototype.save = function (data) {
|
|
1171
|
+
var _a;
|
|
1172
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1173
|
+
var id, docRef;
|
|
1174
|
+
return __generator(this, function (_b) {
|
|
1175
|
+
switch (_b.label) {
|
|
1176
|
+
case 0:
|
|
1177
|
+
id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
|
|
1178
|
+
if (lodash.isEmpty(id))
|
|
1179
|
+
return [2 /*return*/, this.collection(this.buildCollectionPathForAdd(data)).add(data)];
|
|
1180
|
+
docRef = this.collection().doc(id);
|
|
1181
|
+
return [4 /*yield*/, docRef.set(data)];
|
|
1182
|
+
case 1:
|
|
1183
|
+
_b.sent();
|
|
1184
|
+
return [2 /*return*/, docRef];
|
|
1185
|
+
}
|
|
1186
|
+
});
|
|
1187
|
+
});
|
|
1188
|
+
};
|
|
1189
|
+
CreateFirestore.prototype.buildCollectionPathForAdd = function (identifiers) {
|
|
1190
|
+
return this.isSubCollection(this)
|
|
1191
|
+
? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
|
|
1192
|
+
: this.collectionName;
|
|
1193
|
+
};
|
|
1194
|
+
return CreateFirestore;
|
|
1195
|
+
}(MixinBase));
|
|
1194
1196
|
};
|
|
1195
1197
|
|
|
1196
|
-
var withUpdateFirestore = function (MixinBase) {
|
|
1197
|
-
var getValueFromParams = function (params, field) { var _a; return (lodash.isNil((_a = params[field]) === null || _a === void 0 ? void 0 : _a.value) ? params[field] : params[field].value) || null; };
|
|
1198
|
-
var getValueByAction = function (options) {
|
|
1199
|
-
var fieldValues = firebase__default["default"].firestore.FieldValue;
|
|
1200
|
-
if (options.action
|
|
1201
|
-
return
|
|
1202
|
-
if (
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
if (options.action === exports.UpdateOptionActions.
|
|
1206
|
-
return fieldValues.
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1198
|
+
var withUpdateFirestore = function (MixinBase) {
|
|
1199
|
+
var getValueFromParams = function (params, field) { var _a; return (lodash.isNil((_a = params[field]) === null || _a === void 0 ? void 0 : _a.value) ? params[field] : params[field].value) || null; };
|
|
1200
|
+
var getValueByAction = function (options) {
|
|
1201
|
+
var fieldValues = firebase__default["default"].firestore.FieldValue;
|
|
1202
|
+
if (lodash.isNil(options.action))
|
|
1203
|
+
return options;
|
|
1204
|
+
if (options.action === exports.UpdateOptionActions.REMOVE_FIELD)
|
|
1205
|
+
return fieldValues.delete();
|
|
1206
|
+
if (Array.isArray(options.value)) {
|
|
1207
|
+
if (options.action === exports.UpdateOptionActions.MERGE)
|
|
1208
|
+
return fieldValues.arrayUnion.apply(fieldValues, __spreadArray([], __read(options.value)));
|
|
1209
|
+
if (options.action === exports.UpdateOptionActions.REMOVE)
|
|
1210
|
+
return fieldValues.arrayRemove.apply(fieldValues, __spreadArray([], __read(options.value)));
|
|
1211
|
+
}
|
|
1212
|
+
return options.value;
|
|
1213
|
+
};
|
|
1214
|
+
return /** @class */ (function (_super) {
|
|
1215
|
+
__extends(UpdateFirestore, _super);
|
|
1216
|
+
function UpdateFirestore() {
|
|
1217
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1218
|
+
}
|
|
1219
|
+
UpdateFirestore.prototype.update = function (data) {
|
|
1220
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1221
|
+
var model, keyField, docRef, doc;
|
|
1222
|
+
return __generator(this, function (_b) {
|
|
1223
|
+
switch (_b.label) {
|
|
1224
|
+
case 0:
|
|
1225
|
+
model = new this.model();
|
|
1226
|
+
keyField = model.identifierFields().shift();
|
|
1227
|
+
docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
|
|
1228
|
+
return [4 /*yield*/, docRef.update(this.paramsToPlain(data))];
|
|
1229
|
+
case 1:
|
|
1230
|
+
_b.sent();
|
|
1231
|
+
return [4 /*yield*/, docRef.get()];
|
|
1232
|
+
case 2:
|
|
1233
|
+
doc = _b.sent();
|
|
1234
|
+
return [2 /*return*/, doc.data()];
|
|
1235
|
+
}
|
|
1236
|
+
});
|
|
1237
|
+
});
|
|
1238
|
+
};
|
|
1239
|
+
UpdateFirestore.prototype.buildCollectionPathForUpdate = function (identifiers) {
|
|
1240
|
+
return this.isSubCollection(this)
|
|
1241
|
+
? this.parentRepository.collectionName + "/" + getValueFromParams(identifiers, this.parentIdField) + "/" + this.collectionName
|
|
1242
|
+
: this.collectionName;
|
|
1243
|
+
};
|
|
1244
|
+
UpdateFirestore.prototype.paramsToPlain = function (params) {
|
|
1245
|
+
var model = this.model;
|
|
1246
|
+
if (params instanceof model)
|
|
1247
|
+
return params.toPlain();
|
|
1248
|
+
return Object.keys(params).reduce(function (data, currentKey) {
|
|
1249
|
+
var _b;
|
|
1250
|
+
return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
|
|
1251
|
+
}, {});
|
|
1252
|
+
};
|
|
1253
|
+
return UpdateFirestore;
|
|
1254
|
+
}(MixinBase));
|
|
1251
1255
|
};
|
|
1252
1256
|
|
|
1253
|
-
var withDeleteFirestore = function (MixinBase) {
|
|
1254
|
-
return /** @class */ (function (_super) {
|
|
1255
|
-
__extends(DeleteFirestore, _super);
|
|
1256
|
-
function DeleteFirestore() {
|
|
1257
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1258
|
-
}
|
|
1259
|
-
DeleteFirestore.prototype.delete = function (identifiers) {
|
|
1260
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1261
|
-
return __generator(this, function (_a) {
|
|
1262
|
-
switch (_a.label) {
|
|
1263
|
-
case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForRemove(identifiers))
|
|
1264
|
-
.doc(Object.values(identifiers).shift().toString())
|
|
1265
|
-
.delete()];
|
|
1266
|
-
case 1:
|
|
1267
|
-
_a.sent();
|
|
1268
|
-
return [2 /*return*/];
|
|
1269
|
-
}
|
|
1270
|
-
});
|
|
1271
|
-
});
|
|
1272
|
-
};
|
|
1273
|
-
DeleteFirestore.prototype.buildCollectionPathForRemove = function (identifiers) {
|
|
1274
|
-
return this.isSubCollection(this)
|
|
1275
|
-
? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
|
|
1276
|
-
: this.collectionName;
|
|
1277
|
-
};
|
|
1278
|
-
return DeleteFirestore;
|
|
1279
|
-
}(MixinBase));
|
|
1257
|
+
var withDeleteFirestore = function (MixinBase) {
|
|
1258
|
+
return /** @class */ (function (_super) {
|
|
1259
|
+
__extends(DeleteFirestore, _super);
|
|
1260
|
+
function DeleteFirestore() {
|
|
1261
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1262
|
+
}
|
|
1263
|
+
DeleteFirestore.prototype.delete = function (identifiers) {
|
|
1264
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1265
|
+
return __generator(this, function (_a) {
|
|
1266
|
+
switch (_a.label) {
|
|
1267
|
+
case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForRemove(identifiers))
|
|
1268
|
+
.doc(Object.values(identifiers).shift().toString())
|
|
1269
|
+
.delete()];
|
|
1270
|
+
case 1:
|
|
1271
|
+
_a.sent();
|
|
1272
|
+
return [2 /*return*/];
|
|
1273
|
+
}
|
|
1274
|
+
});
|
|
1275
|
+
});
|
|
1276
|
+
};
|
|
1277
|
+
DeleteFirestore.prototype.buildCollectionPathForRemove = function (identifiers) {
|
|
1278
|
+
return this.isSubCollection(this)
|
|
1279
|
+
? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
|
|
1280
|
+
: this.collectionName;
|
|
1281
|
+
};
|
|
1282
|
+
return DeleteFirestore;
|
|
1283
|
+
}(MixinBase));
|
|
1280
1284
|
};
|
|
1281
1285
|
|
|
1282
|
-
var withSubCollection = function (MixinBase, ParentModel) {
|
|
1283
|
-
return /** @class */ (function (_super) {
|
|
1284
|
-
__extends(SubCollectionMix, _super);
|
|
1285
|
-
function SubCollectionMix() {
|
|
1286
|
-
var args = [];
|
|
1287
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1288
|
-
args[_i] = arguments[_i];
|
|
1289
|
-
}
|
|
1290
|
-
return _super.call(this, args) || this;
|
|
1291
|
-
}
|
|
1292
|
-
SubCollectionMix.prototype.collection = function (path) {
|
|
1293
|
-
return _super.prototype.collection.call(this, path);
|
|
1294
|
-
};
|
|
1295
|
-
return SubCollectionMix;
|
|
1296
|
-
}(MixinBase));
|
|
1286
|
+
var withSubCollection = function (MixinBase, ParentModel) {
|
|
1287
|
+
return /** @class */ (function (_super) {
|
|
1288
|
+
__extends(SubCollectionMix, _super);
|
|
1289
|
+
function SubCollectionMix() {
|
|
1290
|
+
var args = [];
|
|
1291
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1292
|
+
args[_i] = arguments[_i];
|
|
1293
|
+
}
|
|
1294
|
+
return _super.call(this, args) || this;
|
|
1295
|
+
}
|
|
1296
|
+
SubCollectionMix.prototype.collection = function (path) {
|
|
1297
|
+
return _super.prototype.collection.call(this, path);
|
|
1298
|
+
};
|
|
1299
|
+
return SubCollectionMix;
|
|
1300
|
+
}(MixinBase));
|
|
1297
1301
|
};
|
|
1298
1302
|
|
|
1299
|
-
var withCrudFirestore = function (MixinBase) {
|
|
1300
|
-
return /** @class */ (function (_super) {
|
|
1301
|
-
__extends(CrudFirestore, _super);
|
|
1302
|
-
function CrudFirestore() {
|
|
1303
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1304
|
-
}
|
|
1305
|
-
return CrudFirestore;
|
|
1306
|
-
}(withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))))));
|
|
1303
|
+
var withCrudFirestore = function (MixinBase) {
|
|
1304
|
+
return /** @class */ (function (_super) {
|
|
1305
|
+
__extends(CrudFirestore, _super);
|
|
1306
|
+
function CrudFirestore() {
|
|
1307
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1308
|
+
}
|
|
1309
|
+
return CrudFirestore;
|
|
1310
|
+
}(withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))))));
|
|
1307
1311
|
};
|
|
1308
1312
|
|
|
1309
|
-
var SubscriptionFirestoreRepository = /** @class */ (function (_super) {
|
|
1310
|
-
__extends(SubscriptionFirestoreRepository, _super);
|
|
1311
|
-
function SubscriptionFirestoreRepository(firestore) {
|
|
1312
|
-
var _this = _super.call(this) || this;
|
|
1313
|
-
_this.firestore = firestore;
|
|
1314
|
-
_this.collectionName = 'subscription';
|
|
1315
|
-
_this.model = Subscription;
|
|
1316
|
-
return _this;
|
|
1317
|
-
}
|
|
1318
|
-
return SubscriptionFirestoreRepository;
|
|
1313
|
+
var SubscriptionFirestoreRepository = /** @class */ (function (_super) {
|
|
1314
|
+
__extends(SubscriptionFirestoreRepository, _super);
|
|
1315
|
+
function SubscriptionFirestoreRepository(firestore) {
|
|
1316
|
+
var _this = _super.call(this) || this;
|
|
1317
|
+
_this.firestore = firestore;
|
|
1318
|
+
_this.collectionName = 'subscription';
|
|
1319
|
+
_this.model = Subscription;
|
|
1320
|
+
return _this;
|
|
1321
|
+
}
|
|
1322
|
+
return SubscriptionFirestoreRepository;
|
|
1319
1323
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1320
1324
|
|
|
1321
|
-
var UserFirestoreRepository = /** @class */ (function (_super_1) {
|
|
1322
|
-
__extends(UserFirestoreRepository, _super_1);
|
|
1323
|
-
function UserFirestoreRepository(firestore) {
|
|
1324
|
-
var _this = _super_1.call(this) || this;
|
|
1325
|
-
_this.firestore = firestore;
|
|
1326
|
-
_this.collectionName = 'users';
|
|
1327
|
-
_this.model = User;
|
|
1328
|
-
return _this;
|
|
1329
|
-
}
|
|
1330
|
-
UserFirestoreRepository.prototype.get = function (identifiers) {
|
|
1331
|
-
var _super = Object.create(null, {
|
|
1332
|
-
get: { get: function () { return _super_1.prototype.get; } }
|
|
1333
|
-
});
|
|
1334
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1335
|
-
var user, _a;
|
|
1336
|
-
return __generator(this, function (_b) {
|
|
1337
|
-
switch (_b.label) {
|
|
1338
|
-
case 0: return [4 /*yield*/, _super.get.call(this, { id: identifiers.id })];
|
|
1339
|
-
case 1:
|
|
1340
|
-
user = _b.sent();
|
|
1341
|
-
_a = user;
|
|
1342
|
-
return [4 /*yield*/, this.getBeautyProfile(user.id)];
|
|
1343
|
-
case 2:
|
|
1344
|
-
_a.beautyProfile = _b.sent();
|
|
1345
|
-
return [2 /*return*/, user];
|
|
1346
|
-
}
|
|
1347
|
-
});
|
|
1348
|
-
});
|
|
1349
|
-
};
|
|
1350
|
-
UserFirestoreRepository.prototype.getBeautyProfile = function (userId) {
|
|
1351
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1352
|
-
var beautyProfile;
|
|
1353
|
-
return __generator(this, function (_a) {
|
|
1354
|
-
switch (_a.label) {
|
|
1355
|
-
case 0: return [4 /*yield*/, this.collection()
|
|
1356
|
-
.doc(userId)
|
|
1357
|
-
.collection('CX')
|
|
1358
|
-
.withConverter(this.buildBeautyProfileModelInstance())
|
|
1359
|
-
.doc('beautyProfile')
|
|
1360
|
-
.get()];
|
|
1361
|
-
case 1:
|
|
1362
|
-
beautyProfile = _a.sent();
|
|
1363
|
-
return [2 /*return*/, beautyProfile.data()];
|
|
1364
|
-
}
|
|
1365
|
-
});
|
|
1366
|
-
});
|
|
1367
|
-
};
|
|
1368
|
-
UserFirestoreRepository.prototype.buildBeautyProfileModelInstance = function () {
|
|
1369
|
-
return {
|
|
1370
|
-
toFirestore: function (data) { return data.toPlain(); },
|
|
1371
|
-
fromFirestore: function (snap) { return BeautyProfile.toInstance(snap.data()); },
|
|
1372
|
-
};
|
|
1373
|
-
};
|
|
1374
|
-
return UserFirestoreRepository;
|
|
1325
|
+
var UserFirestoreRepository = /** @class */ (function (_super_1) {
|
|
1326
|
+
__extends(UserFirestoreRepository, _super_1);
|
|
1327
|
+
function UserFirestoreRepository(firestore) {
|
|
1328
|
+
var _this = _super_1.call(this) || this;
|
|
1329
|
+
_this.firestore = firestore;
|
|
1330
|
+
_this.collectionName = 'users';
|
|
1331
|
+
_this.model = User;
|
|
1332
|
+
return _this;
|
|
1333
|
+
}
|
|
1334
|
+
UserFirestoreRepository.prototype.get = function (identifiers) {
|
|
1335
|
+
var _super = Object.create(null, {
|
|
1336
|
+
get: { get: function () { return _super_1.prototype.get; } }
|
|
1337
|
+
});
|
|
1338
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1339
|
+
var user, _a;
|
|
1340
|
+
return __generator(this, function (_b) {
|
|
1341
|
+
switch (_b.label) {
|
|
1342
|
+
case 0: return [4 /*yield*/, _super.get.call(this, { id: identifiers.id })];
|
|
1343
|
+
case 1:
|
|
1344
|
+
user = _b.sent();
|
|
1345
|
+
_a = user;
|
|
1346
|
+
return [4 /*yield*/, this.getBeautyProfile(user.id)];
|
|
1347
|
+
case 2:
|
|
1348
|
+
_a.beautyProfile = _b.sent();
|
|
1349
|
+
return [2 /*return*/, user];
|
|
1350
|
+
}
|
|
1351
|
+
});
|
|
1352
|
+
});
|
|
1353
|
+
};
|
|
1354
|
+
UserFirestoreRepository.prototype.getBeautyProfile = function (userId) {
|
|
1355
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1356
|
+
var beautyProfile;
|
|
1357
|
+
return __generator(this, function (_a) {
|
|
1358
|
+
switch (_a.label) {
|
|
1359
|
+
case 0: return [4 /*yield*/, this.collection()
|
|
1360
|
+
.doc(userId)
|
|
1361
|
+
.collection('CX')
|
|
1362
|
+
.withConverter(this.buildBeautyProfileModelInstance())
|
|
1363
|
+
.doc('beautyProfile')
|
|
1364
|
+
.get()];
|
|
1365
|
+
case 1:
|
|
1366
|
+
beautyProfile = _a.sent();
|
|
1367
|
+
return [2 /*return*/, beautyProfile.data()];
|
|
1368
|
+
}
|
|
1369
|
+
});
|
|
1370
|
+
});
|
|
1371
|
+
};
|
|
1372
|
+
UserFirestoreRepository.prototype.buildBeautyProfileModelInstance = function () {
|
|
1373
|
+
return {
|
|
1374
|
+
toFirestore: function (data) { return data.toPlain(); },
|
|
1375
|
+
fromFirestore: function (snap) { return BeautyProfile.toInstance(snap.data()); },
|
|
1376
|
+
};
|
|
1377
|
+
};
|
|
1378
|
+
return UserFirestoreRepository;
|
|
1375
1379
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1376
1380
|
|
|
1377
|
-
var SubscriptionEditionFirestoreRepository = /** @class */ (function (_super) {
|
|
1378
|
-
__extends(SubscriptionEditionFirestoreRepository, _super);
|
|
1379
|
-
function SubscriptionEditionFirestoreRepository(firestore, parentRepository) {
|
|
1380
|
-
var _this = _super.call(this) || this;
|
|
1381
|
-
_this.firestore = firestore;
|
|
1382
|
-
_this.parentRepository = parentRepository;
|
|
1383
|
-
_this.collectionName = 'editions';
|
|
1384
|
-
_this.parentIdField = 'subscriptionId';
|
|
1385
|
-
_this.model = Edition;
|
|
1386
|
-
return _this;
|
|
1387
|
-
}
|
|
1388
|
-
return SubscriptionEditionFirestoreRepository;
|
|
1381
|
+
var SubscriptionEditionFirestoreRepository = /** @class */ (function (_super) {
|
|
1382
|
+
__extends(SubscriptionEditionFirestoreRepository, _super);
|
|
1383
|
+
function SubscriptionEditionFirestoreRepository(firestore, parentRepository) {
|
|
1384
|
+
var _this = _super.call(this) || this;
|
|
1385
|
+
_this.firestore = firestore;
|
|
1386
|
+
_this.parentRepository = parentRepository;
|
|
1387
|
+
_this.collectionName = 'editions';
|
|
1388
|
+
_this.parentIdField = 'subscriptionId';
|
|
1389
|
+
_this.model = Edition;
|
|
1390
|
+
return _this;
|
|
1391
|
+
}
|
|
1392
|
+
return SubscriptionEditionFirestoreRepository;
|
|
1389
1393
|
}(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
|
|
1390
1394
|
|
|
1391
|
-
var UserBeautyProfileFirestoreRepository = /** @class */ (function (_super) {
|
|
1392
|
-
__extends(UserBeautyProfileFirestoreRepository, _super);
|
|
1393
|
-
function UserBeautyProfileFirestoreRepository(firestore, parentRepository) {
|
|
1394
|
-
var _this = _super.call(this) || this;
|
|
1395
|
-
_this.firestore = firestore;
|
|
1396
|
-
_this.parentRepository = parentRepository;
|
|
1397
|
-
_this.collectionName = 'CX';
|
|
1398
|
-
_this.parentIdField = 'userId';
|
|
1399
|
-
_this.model = BeautyProfile;
|
|
1400
|
-
return _this;
|
|
1401
|
-
}
|
|
1402
|
-
return UserBeautyProfileFirestoreRepository;
|
|
1395
|
+
var UserBeautyProfileFirestoreRepository = /** @class */ (function (_super) {
|
|
1396
|
+
__extends(UserBeautyProfileFirestoreRepository, _super);
|
|
1397
|
+
function UserBeautyProfileFirestoreRepository(firestore, parentRepository) {
|
|
1398
|
+
var _this = _super.call(this) || this;
|
|
1399
|
+
_this.firestore = firestore;
|
|
1400
|
+
_this.parentRepository = parentRepository;
|
|
1401
|
+
_this.collectionName = 'CX';
|
|
1402
|
+
_this.parentIdField = 'userId';
|
|
1403
|
+
_this.model = BeautyProfile;
|
|
1404
|
+
return _this;
|
|
1405
|
+
}
|
|
1406
|
+
return UserBeautyProfileFirestoreRepository;
|
|
1403
1407
|
}(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
|
|
1404
1408
|
|
|
1405
|
-
var UserAddressFirestoreRepository = /** @class */ (function (_super) {
|
|
1406
|
-
__extends(UserAddressFirestoreRepository, _super);
|
|
1407
|
-
function UserAddressFirestoreRepository(firestore, parentRepository) {
|
|
1408
|
-
var _this = _super.call(this) || this;
|
|
1409
|
-
_this.firestore = firestore;
|
|
1410
|
-
_this.parentRepository = parentRepository;
|
|
1411
|
-
_this.collectionName = 'address';
|
|
1412
|
-
_this.parentIdField = 'userId';
|
|
1413
|
-
_this.model = UserAddress;
|
|
1414
|
-
return _this;
|
|
1415
|
-
}
|
|
1416
|
-
return UserAddressFirestoreRepository;
|
|
1409
|
+
var UserAddressFirestoreRepository = /** @class */ (function (_super) {
|
|
1410
|
+
__extends(UserAddressFirestoreRepository, _super);
|
|
1411
|
+
function UserAddressFirestoreRepository(firestore, parentRepository) {
|
|
1412
|
+
var _this = _super.call(this) || this;
|
|
1413
|
+
_this.firestore = firestore;
|
|
1414
|
+
_this.parentRepository = parentRepository;
|
|
1415
|
+
_this.collectionName = 'address';
|
|
1416
|
+
_this.parentIdField = 'userId';
|
|
1417
|
+
_this.model = UserAddress;
|
|
1418
|
+
return _this;
|
|
1419
|
+
}
|
|
1420
|
+
return UserAddressFirestoreRepository;
|
|
1417
1421
|
}(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
|
|
1418
1422
|
|
|
1419
|
-
var SubscriptionPaymentFirestoreRepository = /** @class */ (function (_super) {
|
|
1420
|
-
__extends(SubscriptionPaymentFirestoreRepository, _super);
|
|
1421
|
-
function SubscriptionPaymentFirestoreRepository(firestore, parentRepository) {
|
|
1422
|
-
var _this = _super.call(this) || this;
|
|
1423
|
-
_this.firestore = firestore;
|
|
1424
|
-
_this.parentRepository = parentRepository;
|
|
1425
|
-
_this.collectionName = 'Payments';
|
|
1426
|
-
_this.parentIdField = 'subscriptionId';
|
|
1427
|
-
_this.model = SubscriptionPayment;
|
|
1428
|
-
return _this;
|
|
1429
|
-
}
|
|
1430
|
-
return SubscriptionPaymentFirestoreRepository;
|
|
1423
|
+
var SubscriptionPaymentFirestoreRepository = /** @class */ (function (_super) {
|
|
1424
|
+
__extends(SubscriptionPaymentFirestoreRepository, _super);
|
|
1425
|
+
function SubscriptionPaymentFirestoreRepository(firestore, parentRepository) {
|
|
1426
|
+
var _this = _super.call(this) || this;
|
|
1427
|
+
_this.firestore = firestore;
|
|
1428
|
+
_this.parentRepository = parentRepository;
|
|
1429
|
+
_this.collectionName = 'Payments';
|
|
1430
|
+
_this.parentIdField = 'subscriptionId';
|
|
1431
|
+
_this.model = SubscriptionPayment;
|
|
1432
|
+
return _this;
|
|
1433
|
+
}
|
|
1434
|
+
return SubscriptionPaymentFirestoreRepository;
|
|
1431
1435
|
}(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
|
|
1432
1436
|
|
|
1433
|
-
var CategoryFirestoreRepository = /** @class */ (function (_super) {
|
|
1434
|
-
__extends(CategoryFirestoreRepository, _super);
|
|
1435
|
-
function CategoryFirestoreRepository(firestore) {
|
|
1436
|
-
var _this = _super.call(this) || this;
|
|
1437
|
-
_this.firestore = firestore;
|
|
1438
|
-
_this.collectionName = 'categories';
|
|
1439
|
-
_this.model = Category;
|
|
1440
|
-
return _this;
|
|
1441
|
-
}
|
|
1442
|
-
return CategoryFirestoreRepository;
|
|
1437
|
+
var CategoryFirestoreRepository = /** @class */ (function (_super) {
|
|
1438
|
+
__extends(CategoryFirestoreRepository, _super);
|
|
1439
|
+
function CategoryFirestoreRepository(firestore) {
|
|
1440
|
+
var _this = _super.call(this) || this;
|
|
1441
|
+
_this.firestore = firestore;
|
|
1442
|
+
_this.collectionName = 'categories';
|
|
1443
|
+
_this.model = Category;
|
|
1444
|
+
return _this;
|
|
1445
|
+
}
|
|
1446
|
+
return CategoryFirestoreRepository;
|
|
1443
1447
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1444
1448
|
|
|
1445
|
-
var ProductFirestoreRepository = /** @class */ (function (_super) {
|
|
1446
|
-
__extends(ProductFirestoreRepository, _super);
|
|
1447
|
-
function ProductFirestoreRepository(firestore) {
|
|
1448
|
-
var _this = _super.call(this) || this;
|
|
1449
|
-
_this.firestore = firestore;
|
|
1450
|
-
_this.collectionName = 'products';
|
|
1451
|
-
_this.model = Product;
|
|
1452
|
-
return _this;
|
|
1453
|
-
}
|
|
1454
|
-
return ProductFirestoreRepository;
|
|
1449
|
+
var ProductFirestoreRepository = /** @class */ (function (_super) {
|
|
1450
|
+
__extends(ProductFirestoreRepository, _super);
|
|
1451
|
+
function ProductFirestoreRepository(firestore) {
|
|
1452
|
+
var _this = _super.call(this) || this;
|
|
1453
|
+
_this.firestore = firestore;
|
|
1454
|
+
_this.collectionName = 'products';
|
|
1455
|
+
_this.model = Product;
|
|
1456
|
+
return _this;
|
|
1457
|
+
}
|
|
1458
|
+
return ProductFirestoreRepository;
|
|
1455
1459
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1456
1460
|
|
|
1457
|
-
var ProductVariantFirestoreRepository = /** @class */ (function (_super) {
|
|
1458
|
-
__extends(ProductVariantFirestoreRepository, _super);
|
|
1459
|
-
function ProductVariantFirestoreRepository(firestore, parentRepository) {
|
|
1460
|
-
var _this = _super.call(this) || this;
|
|
1461
|
-
_this.firestore = firestore;
|
|
1462
|
-
_this.parentRepository = parentRepository;
|
|
1463
|
-
_this.collectionName = 'Variants';
|
|
1464
|
-
_this.parentIdField = 'productId';
|
|
1465
|
-
_this.model = Variant;
|
|
1466
|
-
return _this;
|
|
1467
|
-
}
|
|
1468
|
-
return ProductVariantFirestoreRepository;
|
|
1461
|
+
var ProductVariantFirestoreRepository = /** @class */ (function (_super) {
|
|
1462
|
+
__extends(ProductVariantFirestoreRepository, _super);
|
|
1463
|
+
function ProductVariantFirestoreRepository(firestore, parentRepository) {
|
|
1464
|
+
var _this = _super.call(this) || this;
|
|
1465
|
+
_this.firestore = firestore;
|
|
1466
|
+
_this.parentRepository = parentRepository;
|
|
1467
|
+
_this.collectionName = 'Variants';
|
|
1468
|
+
_this.parentIdField = 'productId';
|
|
1469
|
+
_this.model = Variant;
|
|
1470
|
+
return _this;
|
|
1471
|
+
}
|
|
1472
|
+
return ProductVariantFirestoreRepository;
|
|
1469
1473
|
}(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product)));
|
|
1470
1474
|
|
|
1471
|
-
var CheckoutFirestoreRepository = /** @class */ (function (_super) {
|
|
1472
|
-
__extends(CheckoutFirestoreRepository, _super);
|
|
1473
|
-
function CheckoutFirestoreRepository(firestore) {
|
|
1474
|
-
var _this = _super.call(this) || this;
|
|
1475
|
-
_this.firestore = firestore;
|
|
1476
|
-
_this.collectionName = 'checkouts';
|
|
1477
|
-
_this.model = Checkout;
|
|
1478
|
-
return _this;
|
|
1479
|
-
}
|
|
1480
|
-
return CheckoutFirestoreRepository;
|
|
1475
|
+
var CheckoutFirestoreRepository = /** @class */ (function (_super) {
|
|
1476
|
+
__extends(CheckoutFirestoreRepository, _super);
|
|
1477
|
+
function CheckoutFirestoreRepository(firestore) {
|
|
1478
|
+
var _this = _super.call(this) || this;
|
|
1479
|
+
_this.firestore = firestore;
|
|
1480
|
+
_this.collectionName = 'checkouts';
|
|
1481
|
+
_this.model = Checkout;
|
|
1482
|
+
return _this;
|
|
1483
|
+
}
|
|
1484
|
+
return CheckoutFirestoreRepository;
|
|
1481
1485
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1482
1486
|
|
|
1483
|
-
var CouponFirestoreRepository = /** @class */ (function (_super) {
|
|
1484
|
-
__extends(CouponFirestoreRepository, _super);
|
|
1485
|
-
function CouponFirestoreRepository(firestore) {
|
|
1486
|
-
var _this = _super.call(this) || this;
|
|
1487
|
-
_this.firestore = firestore;
|
|
1488
|
-
_this.collectionName = 'coupons';
|
|
1489
|
-
_this.model = Coupon;
|
|
1490
|
-
return _this;
|
|
1491
|
-
}
|
|
1492
|
-
return CouponFirestoreRepository;
|
|
1487
|
+
var CouponFirestoreRepository = /** @class */ (function (_super) {
|
|
1488
|
+
__extends(CouponFirestoreRepository, _super);
|
|
1489
|
+
function CouponFirestoreRepository(firestore) {
|
|
1490
|
+
var _this = _super.call(this) || this;
|
|
1491
|
+
_this.firestore = firestore;
|
|
1492
|
+
_this.collectionName = 'coupons';
|
|
1493
|
+
_this.model = Coupon;
|
|
1494
|
+
return _this;
|
|
1495
|
+
}
|
|
1496
|
+
return CouponFirestoreRepository;
|
|
1493
1497
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1494
1498
|
|
|
1495
|
-
var OrderFirestoreRepository = /** @class */ (function (_super) {
|
|
1496
|
-
__extends(OrderFirestoreRepository, _super);
|
|
1497
|
-
function OrderFirestoreRepository(firestore) {
|
|
1498
|
-
var _this = _super.call(this) || this;
|
|
1499
|
-
_this.firestore = firestore;
|
|
1500
|
-
_this.collectionName = 'orders';
|
|
1501
|
-
_this.model = Order;
|
|
1502
|
-
return _this;
|
|
1503
|
-
}
|
|
1504
|
-
return OrderFirestoreRepository;
|
|
1499
|
+
var OrderFirestoreRepository = /** @class */ (function (_super) {
|
|
1500
|
+
__extends(OrderFirestoreRepository, _super);
|
|
1501
|
+
function OrderFirestoreRepository(firestore) {
|
|
1502
|
+
var _this = _super.call(this) || this;
|
|
1503
|
+
_this.firestore = firestore;
|
|
1504
|
+
_this.collectionName = 'orders';
|
|
1505
|
+
_this.model = Order;
|
|
1506
|
+
return _this;
|
|
1507
|
+
}
|
|
1508
|
+
return OrderFirestoreRepository;
|
|
1505
1509
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1506
1510
|
|
|
1507
|
-
var PaymentFirestoreRepository = /** @class */ (function (_super) {
|
|
1508
|
-
__extends(PaymentFirestoreRepository, _super);
|
|
1509
|
-
function PaymentFirestoreRepository(firestore) {
|
|
1510
|
-
var _this = _super.call(this) || this;
|
|
1511
|
-
_this.firestore = firestore;
|
|
1512
|
-
_this.collectionName = 'payments';
|
|
1513
|
-
_this.model = Payment;
|
|
1514
|
-
return _this;
|
|
1515
|
-
}
|
|
1516
|
-
return PaymentFirestoreRepository;
|
|
1511
|
+
var PaymentFirestoreRepository = /** @class */ (function (_super) {
|
|
1512
|
+
__extends(PaymentFirestoreRepository, _super);
|
|
1513
|
+
function PaymentFirestoreRepository(firestore) {
|
|
1514
|
+
var _this = _super.call(this) || this;
|
|
1515
|
+
_this.firestore = firestore;
|
|
1516
|
+
_this.collectionName = 'payments';
|
|
1517
|
+
_this.model = Payment;
|
|
1518
|
+
return _this;
|
|
1519
|
+
}
|
|
1520
|
+
return PaymentFirestoreRepository;
|
|
1517
1521
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1518
1522
|
|
|
1519
|
-
var CheckoutSubscriptionFirestoreRepository = /** @class */ (function (_super) {
|
|
1520
|
-
__extends(CheckoutSubscriptionFirestoreRepository, _super);
|
|
1521
|
-
function CheckoutSubscriptionFirestoreRepository(firestore) {
|
|
1522
|
-
var _this = _super.call(this) || this;
|
|
1523
|
-
_this.firestore = firestore;
|
|
1524
|
-
_this.collectionName = 'checkoutsSubscription';
|
|
1525
|
-
_this.model = CheckoutSubscription;
|
|
1526
|
-
return _this;
|
|
1527
|
-
}
|
|
1528
|
-
return CheckoutSubscriptionFirestoreRepository;
|
|
1523
|
+
var CheckoutSubscriptionFirestoreRepository = /** @class */ (function (_super) {
|
|
1524
|
+
__extends(CheckoutSubscriptionFirestoreRepository, _super);
|
|
1525
|
+
function CheckoutSubscriptionFirestoreRepository(firestore) {
|
|
1526
|
+
var _this = _super.call(this) || this;
|
|
1527
|
+
_this.firestore = firestore;
|
|
1528
|
+
_this.collectionName = 'checkoutsSubscription';
|
|
1529
|
+
_this.model = CheckoutSubscription;
|
|
1530
|
+
return _this;
|
|
1531
|
+
}
|
|
1532
|
+
return CheckoutSubscriptionFirestoreRepository;
|
|
1529
1533
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1530
1534
|
|
|
1531
|
-
var SubscriptionPlanFirestoreRepository = /** @class */ (function (_super) {
|
|
1532
|
-
__extends(SubscriptionPlanFirestoreRepository, _super);
|
|
1533
|
-
function SubscriptionPlanFirestoreRepository(firestore) {
|
|
1534
|
-
var _this = _super.call(this) || this;
|
|
1535
|
-
_this.firestore = firestore;
|
|
1536
|
-
_this.collectionName = 'subscriptionPlans';
|
|
1537
|
-
_this.model = SubscriptionPlan;
|
|
1538
|
-
return _this;
|
|
1539
|
-
}
|
|
1540
|
-
return SubscriptionPlanFirestoreRepository;
|
|
1535
|
+
var SubscriptionPlanFirestoreRepository = /** @class */ (function (_super) {
|
|
1536
|
+
__extends(SubscriptionPlanFirestoreRepository, _super);
|
|
1537
|
+
function SubscriptionPlanFirestoreRepository(firestore) {
|
|
1538
|
+
var _this = _super.call(this) || this;
|
|
1539
|
+
_this.firestore = firestore;
|
|
1540
|
+
_this.collectionName = 'subscriptionPlans';
|
|
1541
|
+
_this.model = SubscriptionPlan;
|
|
1542
|
+
return _this;
|
|
1543
|
+
}
|
|
1544
|
+
return SubscriptionPlanFirestoreRepository;
|
|
1541
1545
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1542
1546
|
|
|
1543
|
-
var Buy2WinFirestoreRepository = /** @class */ (function (_super) {
|
|
1544
|
-
__extends(Buy2WinFirestoreRepository, _super);
|
|
1545
|
-
function Buy2WinFirestoreRepository(firestore) {
|
|
1546
|
-
var _this = _super.call(this) || this;
|
|
1547
|
-
_this.firestore = firestore;
|
|
1548
|
-
_this.collectionName = 'buy2win';
|
|
1549
|
-
_this.model = Buy2Win;
|
|
1550
|
-
return _this;
|
|
1551
|
-
}
|
|
1552
|
-
return Buy2WinFirestoreRepository;
|
|
1547
|
+
var Buy2WinFirestoreRepository = /** @class */ (function (_super) {
|
|
1548
|
+
__extends(Buy2WinFirestoreRepository, _super);
|
|
1549
|
+
function Buy2WinFirestoreRepository(firestore) {
|
|
1550
|
+
var _this = _super.call(this) || this;
|
|
1551
|
+
_this.firestore = firestore;
|
|
1552
|
+
_this.collectionName = 'buy2win';
|
|
1553
|
+
_this.model = Buy2Win;
|
|
1554
|
+
return _this;
|
|
1555
|
+
}
|
|
1556
|
+
return Buy2WinFirestoreRepository;
|
|
1553
1557
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1554
1558
|
|
|
1555
|
-
var HomeFirestoreRepository = /** @class */ (function (_super) {
|
|
1556
|
-
__extends(HomeFirestoreRepository, _super);
|
|
1557
|
-
function HomeFirestoreRepository(firestore) {
|
|
1558
|
-
var _this = _super.call(this) || this;
|
|
1559
|
-
_this.firestore = firestore;
|
|
1560
|
-
_this.collectionName = 'dms';
|
|
1561
|
-
_this.model = Home;
|
|
1562
|
-
return _this;
|
|
1563
|
-
}
|
|
1564
|
-
return HomeFirestoreRepository;
|
|
1559
|
+
var HomeFirestoreRepository = /** @class */ (function (_super) {
|
|
1560
|
+
__extends(HomeFirestoreRepository, _super);
|
|
1561
|
+
function HomeFirestoreRepository(firestore) {
|
|
1562
|
+
var _this = _super.call(this) || this;
|
|
1563
|
+
_this.firestore = firestore;
|
|
1564
|
+
_this.collectionName = 'dms';
|
|
1565
|
+
_this.model = Home;
|
|
1566
|
+
return _this;
|
|
1567
|
+
}
|
|
1568
|
+
return HomeFirestoreRepository;
|
|
1565
1569
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1566
1570
|
|
|
1567
|
-
var ShopMenuFirestoreRepository = /** @class */ (function (_super) {
|
|
1568
|
-
__extends(ShopMenuFirestoreRepository, _super);
|
|
1569
|
-
function ShopMenuFirestoreRepository(firestore) {
|
|
1570
|
-
var _this = _super.call(this) || this;
|
|
1571
|
-
_this.firestore = firestore;
|
|
1572
|
-
_this.collectionName = 'shopMenus';
|
|
1573
|
-
_this.model = ShopMenu;
|
|
1574
|
-
return _this;
|
|
1575
|
-
}
|
|
1576
|
-
return ShopMenuFirestoreRepository;
|
|
1571
|
+
var ShopMenuFirestoreRepository = /** @class */ (function (_super) {
|
|
1572
|
+
__extends(ShopMenuFirestoreRepository, _super);
|
|
1573
|
+
function ShopMenuFirestoreRepository(firestore) {
|
|
1574
|
+
var _this = _super.call(this) || this;
|
|
1575
|
+
_this.firestore = firestore;
|
|
1576
|
+
_this.collectionName = 'shopMenus';
|
|
1577
|
+
_this.model = ShopMenu;
|
|
1578
|
+
return _this;
|
|
1579
|
+
}
|
|
1580
|
+
return ShopMenuFirestoreRepository;
|
|
1577
1581
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1578
1582
|
|
|
1579
|
-
var AuthenticationFirebaseAuthService = /** @class */ (function () {
|
|
1580
|
-
function AuthenticationFirebaseAuthService(firebaseAuth) {
|
|
1581
|
-
this.firebaseAuth = firebaseAuth;
|
|
1582
|
-
}
|
|
1583
|
-
AuthenticationFirebaseAuthService.prototype.signInWithEmailAndPassword = function (data) {
|
|
1584
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1585
|
-
var credentials, user;
|
|
1586
|
-
return __generator(this, function (_a) {
|
|
1587
|
-
switch (_a.label) {
|
|
1588
|
-
case 0: return [4 /*yield*/, this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password)];
|
|
1589
|
-
case 1:
|
|
1590
|
-
credentials = _a.sent();
|
|
1591
|
-
user = credentials.user;
|
|
1592
|
-
return [2 /*return*/, { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber }];
|
|
1593
|
-
}
|
|
1594
|
-
});
|
|
1595
|
-
});
|
|
1596
|
-
};
|
|
1597
|
-
AuthenticationFirebaseAuthService.prototype.signInWithGoogle = function () {
|
|
1598
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1599
|
-
var credentials, user;
|
|
1600
|
-
return __generator(this, function (_a) {
|
|
1601
|
-
switch (_a.label) {
|
|
1602
|
-
case 0: return [4 /*yield*/, this.firebaseAuth.signInWithPopup(new firebase__default$1["default"].auth.GoogleAuthProvider())];
|
|
1603
|
-
case 1:
|
|
1604
|
-
credentials = _a.sent();
|
|
1605
|
-
user = credentials.user;
|
|
1606
|
-
return [2 /*return*/, { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber }];
|
|
1607
|
-
}
|
|
1608
|
-
});
|
|
1609
|
-
});
|
|
1610
|
-
};
|
|
1611
|
-
AuthenticationFirebaseAuthService.prototype.signOut = function () {
|
|
1612
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1613
|
-
return __generator(this, function (_a) {
|
|
1614
|
-
this.firebaseAuth.signOut();
|
|
1615
|
-
return [2 /*return*/];
|
|
1616
|
-
});
|
|
1617
|
-
});
|
|
1618
|
-
};
|
|
1619
|
-
return AuthenticationFirebaseAuthService;
|
|
1583
|
+
var AuthenticationFirebaseAuthService = /** @class */ (function () {
|
|
1584
|
+
function AuthenticationFirebaseAuthService(firebaseAuth) {
|
|
1585
|
+
this.firebaseAuth = firebaseAuth;
|
|
1586
|
+
}
|
|
1587
|
+
AuthenticationFirebaseAuthService.prototype.signInWithEmailAndPassword = function (data) {
|
|
1588
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1589
|
+
var credentials, user;
|
|
1590
|
+
return __generator(this, function (_a) {
|
|
1591
|
+
switch (_a.label) {
|
|
1592
|
+
case 0: return [4 /*yield*/, this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password)];
|
|
1593
|
+
case 1:
|
|
1594
|
+
credentials = _a.sent();
|
|
1595
|
+
user = credentials.user;
|
|
1596
|
+
return [2 /*return*/, { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber }];
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1599
|
+
});
|
|
1600
|
+
};
|
|
1601
|
+
AuthenticationFirebaseAuthService.prototype.signInWithGoogle = function () {
|
|
1602
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1603
|
+
var credentials, user;
|
|
1604
|
+
return __generator(this, function (_a) {
|
|
1605
|
+
switch (_a.label) {
|
|
1606
|
+
case 0: return [4 /*yield*/, this.firebaseAuth.signInWithPopup(new firebase__default$1["default"].auth.GoogleAuthProvider())];
|
|
1607
|
+
case 1:
|
|
1608
|
+
credentials = _a.sent();
|
|
1609
|
+
user = credentials.user;
|
|
1610
|
+
return [2 /*return*/, { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber }];
|
|
1611
|
+
}
|
|
1612
|
+
});
|
|
1613
|
+
});
|
|
1614
|
+
};
|
|
1615
|
+
AuthenticationFirebaseAuthService.prototype.signOut = function () {
|
|
1616
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1617
|
+
return __generator(this, function (_a) {
|
|
1618
|
+
this.firebaseAuth.signOut();
|
|
1619
|
+
return [2 /*return*/];
|
|
1620
|
+
});
|
|
1621
|
+
});
|
|
1622
|
+
};
|
|
1623
|
+
return AuthenticationFirebaseAuthService;
|
|
1620
1624
|
}());
|
|
1621
1625
|
|
|
1622
|
-
/**
|
|
1623
|
-
* Generated bundle index. Do not edit.
|
|
1626
|
+
/**
|
|
1627
|
+
* Generated bundle index. Do not edit.
|
|
1624
1628
|
*/
|
|
1625
1629
|
|
|
1626
1630
|
Object.defineProperty(exports, 'chunk', {
|