@infrab4a/connect 0.8.3 → 0.9.1
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 +1843 -1799
- 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 +11 -11
- 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 +14 -14
- package/esm2015/lib/domain/shopping/models/checkout.js +38 -38
- package/esm2015/lib/domain/shopping/models/coupons/coupon.js +23 -23
- 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 +11 -11
- package/esm2015/lib/domain/shopping/models/payment.js +169 -169
- package/esm2015/lib/domain/shopping/models/shipping-method.js +7 -7
- package/esm2015/lib/domain/shopping/models/subscription/checkout.js +28 -28
- 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 +8 -8
- package/esm2015/lib/domain/shopping/repositories/legacy-order.repository.js +2 -2
- 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 +7 -6
- package/esm2015/lib/domain/users/models/lead.js +7 -0
- 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 +14 -14
- package/esm2015/lib/domain/users/models/subscription/subscription.js +43 -43
- package/esm2015/lib/domain/users/models/user-address.js +7 -7
- package/esm2015/lib/domain/users/models/user.js +26 -26
- 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 +8 -7
- package/esm2015/lib/domain/users/repositories/lead.repository.js +2 -0
- 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/duplicated-results.error.js +7 -7
- package/esm2015/lib/errors/index.js +5 -5
- 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 +74 -70
- 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 -45
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +78 -78
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/index.js +4 -4
- package/esm2015/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +23 -23
- 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 +9 -9
- package/esm2015/lib/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.js +9 -9
- 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 +8 -7
- package/esm2015/lib/infra/firebase/firestore/repositories/users/lead-firestore.repository.js +12 -0
- 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 +62 -62
- 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 +3 -3
- package/fesm2015/infrab4a-connect.js +1080 -1061
- 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 +21 -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 +33 -33
- 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 +12 -12
- package/lib/domain/catalog/repositories/index.d.ts +3 -3
- package/lib/domain/catalog/repositories/product.repository.d.ts +5 -5
- 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 +14 -14
- 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 +28 -28
- 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 +8 -8
- package/lib/domain/shopping/models/order.d.ts +9 -9
- 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 +7 -7
- package/lib/domain/shopping/repositories/legacy-order.repository.d.ts +3 -3
- 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 +6 -5
- package/lib/domain/users/models/lead.d.ts +9 -0
- 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 +24 -24
- 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 +7 -6
- package/lib/domain/users/repositories/lead.repository.d.ts +4 -0
- 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/duplicated-results.error.d.ts +4 -4
- package/lib/errors/index.d.ts +4 -4
- 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 +55 -55
- package/lib/infra/firebase/firestore/repositories/catalog/index.d.ts +3 -3
- package/lib/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +50 -50
- 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 +8 -8
- package/lib/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.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 +7 -6
- package/lib/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +49 -0
- 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 +57 -57
- 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 +2 -2
- package/public-api.d.ts +2 -2
|
@@ -9,1961 +9,2003 @@
|
|
|
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 Payment = /** @class */ (function (_super) {
|
|
446
|
-
__extends(Payment, _super);
|
|
447
|
-
function Payment() {
|
|
448
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
449
|
-
}
|
|
450
|
-
Payment.prototype.identifierFields = function () {
|
|
451
|
-
return ['id'];
|
|
452
|
-
};
|
|
453
|
-
return Payment;
|
|
454
|
-
}(BaseModel));
|
|
455
|
-
__decorate([
|
|
456
|
-
classTransformer.Expose({ name: 'refuse_reason' }),
|
|
457
|
-
__metadata("design:type", String)
|
|
458
|
-
], Payment.prototype, "refuseReason", void 0);
|
|
459
|
-
__decorate([
|
|
460
|
-
classTransformer.Expose({ name: 'status_reason' }),
|
|
461
|
-
__metadata("design:type", String)
|
|
462
|
-
], Payment.prototype, "statusReason", void 0);
|
|
463
|
-
__decorate([
|
|
464
|
-
classTransformer.Expose({ name: 'acquirer_response_code' }),
|
|
465
|
-
__metadata("design:type", String)
|
|
466
|
-
], Payment.prototype, "acquirerResponseCode", void 0);
|
|
467
|
-
__decorate([
|
|
468
|
-
classTransformer.Expose({ name: 'acquirer_name' }),
|
|
469
|
-
__metadata("design:type", String)
|
|
470
|
-
], Payment.prototype, "acquirerName", void 0);
|
|
471
|
-
__decorate([
|
|
472
|
-
classTransformer.Expose({ name: 'acquirer_id' }),
|
|
473
|
-
__metadata("design:type", String)
|
|
474
|
-
], Payment.prototype, "acquirerId", void 0);
|
|
475
|
-
__decorate([
|
|
476
|
-
classTransformer.Expose({ name: 'authorization_code' }),
|
|
477
|
-
__metadata("design:type", String)
|
|
478
|
-
], Payment.prototype, "authorizationCode", void 0);
|
|
479
|
-
__decorate([
|
|
480
|
-
classTransformer.Expose({ name: 'soft_descriptor' }),
|
|
481
|
-
__metadata("design:type", String)
|
|
482
|
-
], Payment.prototype, "softDescriptor", void 0);
|
|
483
|
-
__decorate([
|
|
484
|
-
classTransformer.Expose({ name: 'date_created' }),
|
|
485
|
-
__metadata("design:type", String)
|
|
486
|
-
], Payment.prototype, "dateCreated", void 0);
|
|
487
|
-
__decorate([
|
|
488
|
-
classTransformer.Expose({ name: 'date_updated' }),
|
|
489
|
-
__metadata("design:type", String)
|
|
490
|
-
], Payment.prototype, "dateUpdated", void 0);
|
|
491
|
-
__decorate([
|
|
492
|
-
classTransformer.Expose({ name: 'authorized_amount' }),
|
|
493
|
-
__metadata("design:type", Number)
|
|
494
|
-
], Payment.prototype, "authorizedAmount", void 0);
|
|
495
|
-
__decorate([
|
|
496
|
-
classTransformer.Expose({ name: 'paid_amount' }),
|
|
497
|
-
__metadata("design:type", Number)
|
|
498
|
-
], Payment.prototype, "paidAmount", void 0);
|
|
499
|
-
__decorate([
|
|
500
|
-
classTransformer.Expose({ name: 'refunded_amount' }),
|
|
501
|
-
__metadata("design:type", Number)
|
|
502
|
-
], Payment.prototype, "refundedAmount", void 0);
|
|
503
|
-
__decorate([
|
|
504
|
-
classTransformer.Expose({ name: 'card_holder_name' }),
|
|
505
|
-
__metadata("design:type", String)
|
|
506
|
-
], Payment.prototype, "cardHolderName", void 0);
|
|
507
|
-
__decorate([
|
|
508
|
-
classTransformer.Expose({ name: 'card_last_digits' }),
|
|
509
|
-
__metadata("design:type", String)
|
|
510
|
-
], Payment.prototype, "cardLastDigits", void 0);
|
|
511
|
-
__decorate([
|
|
512
|
-
classTransformer.Expose({ name: 'card_first_digits' }),
|
|
513
|
-
__metadata("design:type", String)
|
|
514
|
-
], Payment.prototype, "cardFirstDigits", void 0);
|
|
515
|
-
__decorate([
|
|
516
|
-
classTransformer.Expose({ name: 'card_brand' }),
|
|
517
|
-
__metadata("design:type", String)
|
|
518
|
-
], Payment.prototype, "cardBrand", void 0);
|
|
519
|
-
__decorate([
|
|
520
|
-
classTransformer.Expose({ name: 'card_pin_mode' }),
|
|
521
|
-
__metadata("design:type", String)
|
|
522
|
-
], Payment.prototype, "cardPinMode", void 0);
|
|
523
|
-
__decorate([
|
|
524
|
-
classTransformer.Expose({ name: 'card_magstripe_fallback' }),
|
|
525
|
-
__metadata("design:type", Boolean)
|
|
526
|
-
], Payment.prototype, "cardMagstripeFallback", void 0);
|
|
527
|
-
__decorate([
|
|
528
|
-
classTransformer.Expose({ name: 'cvm_pin' }),
|
|
529
|
-
__metadata("design:type", Boolean)
|
|
530
|
-
], Payment.prototype, "cvmPin", void 0);
|
|
531
|
-
__decorate([
|
|
532
|
-
classTransformer.Expose({ name: 'postback_url' }),
|
|
533
|
-
__metadata("design:type", String)
|
|
534
|
-
], Payment.prototype, "postbackUrl", void 0);
|
|
535
|
-
__decorate([
|
|
536
|
-
classTransformer.Expose({ name: 'payment_method' }),
|
|
537
|
-
__metadata("design:type", String)
|
|
538
|
-
], Payment.prototype, "paymentMethod", void 0);
|
|
539
|
-
__decorate([
|
|
540
|
-
classTransformer.Expose({ name: 'capture_method' }),
|
|
541
|
-
__metadata("design:type", String)
|
|
542
|
-
], Payment.prototype, "captureMethod", void 0);
|
|
543
|
-
__decorate([
|
|
544
|
-
classTransformer.Expose({ name: 'antifraud_score' }),
|
|
545
|
-
__metadata("design:type", String)
|
|
546
|
-
], Payment.prototype, "antifraudScore", void 0);
|
|
547
|
-
__decorate([
|
|
548
|
-
classTransformer.Expose({ name: 'boleto_url' }),
|
|
549
|
-
__metadata("design:type", String)
|
|
550
|
-
], Payment.prototype, "boletoUrl", void 0);
|
|
551
|
-
__decorate([
|
|
552
|
-
classTransformer.Expose({ name: 'boleto_barcode' }),
|
|
553
|
-
__metadata("design:type", String)
|
|
554
|
-
], Payment.prototype, "boletoBarcode", void 0);
|
|
555
|
-
__decorate([
|
|
556
|
-
classTransformer.Expose({ name: 'boleto_expiration_date' }),
|
|
557
|
-
__metadata("design:type", String)
|
|
558
|
-
], Payment.prototype, "boletoExpirationDate", void 0);
|
|
559
|
-
__decorate([
|
|
560
|
-
classTransformer.Expose({ name: 'subscription_id' }),
|
|
561
|
-
__metadata("design:type", String)
|
|
562
|
-
], Payment.prototype, "subscriptionId", void 0);
|
|
563
|
-
__decorate([
|
|
564
|
-
classTransformer.Expose({ name: 'split_rules' }),
|
|
565
|
-
__metadata("design:type", String)
|
|
566
|
-
], Payment.prototype, "splitRules", void 0);
|
|
567
|
-
__decorate([
|
|
568
|
-
classTransformer.Expose({ name: 'antifraud_metadata' }),
|
|
569
|
-
__metadata("design:type", Object)
|
|
570
|
-
], Payment.prototype, "antifraudMetadata", void 0);
|
|
571
|
-
__decorate([
|
|
572
|
-
classTransformer.Expose({ name: 'reference_key' }),
|
|
573
|
-
__metadata("design:type", String)
|
|
574
|
-
], Payment.prototype, "referenceKey", void 0);
|
|
575
|
-
__decorate([
|
|
576
|
-
classTransformer.Expose({ name: 'local_transaction_id' }),
|
|
577
|
-
__metadata("design:type", String)
|
|
578
|
-
], Payment.prototype, "localTransactionId", void 0);
|
|
579
|
-
__decorate([
|
|
580
|
-
classTransformer.Expose({ name: 'local_time' }),
|
|
581
|
-
__metadata("design:type", String)
|
|
582
|
-
], Payment.prototype, "localTime", void 0);
|
|
583
|
-
__decorate([
|
|
584
|
-
classTransformer.Expose({ name: 'fraud_covered' }),
|
|
585
|
-
__metadata("design:type", Boolean)
|
|
586
|
-
], Payment.prototype, "fraudCovered", void 0);
|
|
587
|
-
__decorate([
|
|
588
|
-
classTransformer.Expose({ name: 'fraud_reimbursed' }),
|
|
589
|
-
__metadata("design:type", String)
|
|
590
|
-
], Payment.prototype, "fraudReimbursed", void 0);
|
|
591
|
-
__decorate([
|
|
592
|
-
classTransformer.Expose({ name: 'order_id' }),
|
|
593
|
-
__metadata("design:type", String)
|
|
594
|
-
], Payment.prototype, "orderId", void 0);
|
|
595
|
-
__decorate([
|
|
596
|
-
classTransformer.Expose({ name: 'risk_level' }),
|
|
597
|
-
__metadata("design:type", String)
|
|
598
|
-
], Payment.prototype, "riskLevel", void 0);
|
|
599
|
-
__decorate([
|
|
600
|
-
classTransformer.Expose({ name: 'receipt_url' }),
|
|
601
|
-
__metadata("design:type", String)
|
|
602
|
-
], Payment.prototype, "receiptUrl", void 0);
|
|
603
|
-
__decorate([
|
|
604
|
-
classTransformer.Expose({ name: 'private_label' }),
|
|
605
|
-
__metadata("design:type", String)
|
|
606
|
-
], Payment.prototype, "privateLabel", void 0);
|
|
607
|
-
__decorate([
|
|
608
|
-
classTransformer.Expose({ name: 'pix_qr_code' }),
|
|
609
|
-
__metadata("design:type", String)
|
|
610
|
-
], Payment.prototype, "pixQrCode", void 0);
|
|
611
|
-
__decorate([
|
|
612
|
-
classTransformer.Expose({ name: 'pix_expiration_date' }),
|
|
613
|
-
__metadata("design:type", String)
|
|
445
|
+
var Payment = /** @class */ (function (_super) {
|
|
446
|
+
__extends(Payment, _super);
|
|
447
|
+
function Payment() {
|
|
448
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
449
|
+
}
|
|
450
|
+
Payment.prototype.identifierFields = function () {
|
|
451
|
+
return ['id'];
|
|
452
|
+
};
|
|
453
|
+
return Payment;
|
|
454
|
+
}(BaseModel));
|
|
455
|
+
__decorate([
|
|
456
|
+
classTransformer.Expose({ name: 'refuse_reason' }),
|
|
457
|
+
__metadata("design:type", String)
|
|
458
|
+
], Payment.prototype, "refuseReason", void 0);
|
|
459
|
+
__decorate([
|
|
460
|
+
classTransformer.Expose({ name: 'status_reason' }),
|
|
461
|
+
__metadata("design:type", String)
|
|
462
|
+
], Payment.prototype, "statusReason", void 0);
|
|
463
|
+
__decorate([
|
|
464
|
+
classTransformer.Expose({ name: 'acquirer_response_code' }),
|
|
465
|
+
__metadata("design:type", String)
|
|
466
|
+
], Payment.prototype, "acquirerResponseCode", void 0);
|
|
467
|
+
__decorate([
|
|
468
|
+
classTransformer.Expose({ name: 'acquirer_name' }),
|
|
469
|
+
__metadata("design:type", String)
|
|
470
|
+
], Payment.prototype, "acquirerName", void 0);
|
|
471
|
+
__decorate([
|
|
472
|
+
classTransformer.Expose({ name: 'acquirer_id' }),
|
|
473
|
+
__metadata("design:type", String)
|
|
474
|
+
], Payment.prototype, "acquirerId", void 0);
|
|
475
|
+
__decorate([
|
|
476
|
+
classTransformer.Expose({ name: 'authorization_code' }),
|
|
477
|
+
__metadata("design:type", String)
|
|
478
|
+
], Payment.prototype, "authorizationCode", void 0);
|
|
479
|
+
__decorate([
|
|
480
|
+
classTransformer.Expose({ name: 'soft_descriptor' }),
|
|
481
|
+
__metadata("design:type", String)
|
|
482
|
+
], Payment.prototype, "softDescriptor", void 0);
|
|
483
|
+
__decorate([
|
|
484
|
+
classTransformer.Expose({ name: 'date_created' }),
|
|
485
|
+
__metadata("design:type", String)
|
|
486
|
+
], Payment.prototype, "dateCreated", void 0);
|
|
487
|
+
__decorate([
|
|
488
|
+
classTransformer.Expose({ name: 'date_updated' }),
|
|
489
|
+
__metadata("design:type", String)
|
|
490
|
+
], Payment.prototype, "dateUpdated", void 0);
|
|
491
|
+
__decorate([
|
|
492
|
+
classTransformer.Expose({ name: 'authorized_amount' }),
|
|
493
|
+
__metadata("design:type", Number)
|
|
494
|
+
], Payment.prototype, "authorizedAmount", void 0);
|
|
495
|
+
__decorate([
|
|
496
|
+
classTransformer.Expose({ name: 'paid_amount' }),
|
|
497
|
+
__metadata("design:type", Number)
|
|
498
|
+
], Payment.prototype, "paidAmount", void 0);
|
|
499
|
+
__decorate([
|
|
500
|
+
classTransformer.Expose({ name: 'refunded_amount' }),
|
|
501
|
+
__metadata("design:type", Number)
|
|
502
|
+
], Payment.prototype, "refundedAmount", void 0);
|
|
503
|
+
__decorate([
|
|
504
|
+
classTransformer.Expose({ name: 'card_holder_name' }),
|
|
505
|
+
__metadata("design:type", String)
|
|
506
|
+
], Payment.prototype, "cardHolderName", void 0);
|
|
507
|
+
__decorate([
|
|
508
|
+
classTransformer.Expose({ name: 'card_last_digits' }),
|
|
509
|
+
__metadata("design:type", String)
|
|
510
|
+
], Payment.prototype, "cardLastDigits", void 0);
|
|
511
|
+
__decorate([
|
|
512
|
+
classTransformer.Expose({ name: 'card_first_digits' }),
|
|
513
|
+
__metadata("design:type", String)
|
|
514
|
+
], Payment.prototype, "cardFirstDigits", void 0);
|
|
515
|
+
__decorate([
|
|
516
|
+
classTransformer.Expose({ name: 'card_brand' }),
|
|
517
|
+
__metadata("design:type", String)
|
|
518
|
+
], Payment.prototype, "cardBrand", void 0);
|
|
519
|
+
__decorate([
|
|
520
|
+
classTransformer.Expose({ name: 'card_pin_mode' }),
|
|
521
|
+
__metadata("design:type", String)
|
|
522
|
+
], Payment.prototype, "cardPinMode", void 0);
|
|
523
|
+
__decorate([
|
|
524
|
+
classTransformer.Expose({ name: 'card_magstripe_fallback' }),
|
|
525
|
+
__metadata("design:type", Boolean)
|
|
526
|
+
], Payment.prototype, "cardMagstripeFallback", void 0);
|
|
527
|
+
__decorate([
|
|
528
|
+
classTransformer.Expose({ name: 'cvm_pin' }),
|
|
529
|
+
__metadata("design:type", Boolean)
|
|
530
|
+
], Payment.prototype, "cvmPin", void 0);
|
|
531
|
+
__decorate([
|
|
532
|
+
classTransformer.Expose({ name: 'postback_url' }),
|
|
533
|
+
__metadata("design:type", String)
|
|
534
|
+
], Payment.prototype, "postbackUrl", void 0);
|
|
535
|
+
__decorate([
|
|
536
|
+
classTransformer.Expose({ name: 'payment_method' }),
|
|
537
|
+
__metadata("design:type", String)
|
|
538
|
+
], Payment.prototype, "paymentMethod", void 0);
|
|
539
|
+
__decorate([
|
|
540
|
+
classTransformer.Expose({ name: 'capture_method' }),
|
|
541
|
+
__metadata("design:type", String)
|
|
542
|
+
], Payment.prototype, "captureMethod", void 0);
|
|
543
|
+
__decorate([
|
|
544
|
+
classTransformer.Expose({ name: 'antifraud_score' }),
|
|
545
|
+
__metadata("design:type", String)
|
|
546
|
+
], Payment.prototype, "antifraudScore", void 0);
|
|
547
|
+
__decorate([
|
|
548
|
+
classTransformer.Expose({ name: 'boleto_url' }),
|
|
549
|
+
__metadata("design:type", String)
|
|
550
|
+
], Payment.prototype, "boletoUrl", void 0);
|
|
551
|
+
__decorate([
|
|
552
|
+
classTransformer.Expose({ name: 'boleto_barcode' }),
|
|
553
|
+
__metadata("design:type", String)
|
|
554
|
+
], Payment.prototype, "boletoBarcode", void 0);
|
|
555
|
+
__decorate([
|
|
556
|
+
classTransformer.Expose({ name: 'boleto_expiration_date' }),
|
|
557
|
+
__metadata("design:type", String)
|
|
558
|
+
], Payment.prototype, "boletoExpirationDate", void 0);
|
|
559
|
+
__decorate([
|
|
560
|
+
classTransformer.Expose({ name: 'subscription_id' }),
|
|
561
|
+
__metadata("design:type", String)
|
|
562
|
+
], Payment.prototype, "subscriptionId", void 0);
|
|
563
|
+
__decorate([
|
|
564
|
+
classTransformer.Expose({ name: 'split_rules' }),
|
|
565
|
+
__metadata("design:type", String)
|
|
566
|
+
], Payment.prototype, "splitRules", void 0);
|
|
567
|
+
__decorate([
|
|
568
|
+
classTransformer.Expose({ name: 'antifraud_metadata' }),
|
|
569
|
+
__metadata("design:type", Object)
|
|
570
|
+
], Payment.prototype, "antifraudMetadata", void 0);
|
|
571
|
+
__decorate([
|
|
572
|
+
classTransformer.Expose({ name: 'reference_key' }),
|
|
573
|
+
__metadata("design:type", String)
|
|
574
|
+
], Payment.prototype, "referenceKey", void 0);
|
|
575
|
+
__decorate([
|
|
576
|
+
classTransformer.Expose({ name: 'local_transaction_id' }),
|
|
577
|
+
__metadata("design:type", String)
|
|
578
|
+
], Payment.prototype, "localTransactionId", void 0);
|
|
579
|
+
__decorate([
|
|
580
|
+
classTransformer.Expose({ name: 'local_time' }),
|
|
581
|
+
__metadata("design:type", String)
|
|
582
|
+
], Payment.prototype, "localTime", void 0);
|
|
583
|
+
__decorate([
|
|
584
|
+
classTransformer.Expose({ name: 'fraud_covered' }),
|
|
585
|
+
__metadata("design:type", Boolean)
|
|
586
|
+
], Payment.prototype, "fraudCovered", void 0);
|
|
587
|
+
__decorate([
|
|
588
|
+
classTransformer.Expose({ name: 'fraud_reimbursed' }),
|
|
589
|
+
__metadata("design:type", String)
|
|
590
|
+
], Payment.prototype, "fraudReimbursed", void 0);
|
|
591
|
+
__decorate([
|
|
592
|
+
classTransformer.Expose({ name: 'order_id' }),
|
|
593
|
+
__metadata("design:type", String)
|
|
594
|
+
], Payment.prototype, "orderId", void 0);
|
|
595
|
+
__decorate([
|
|
596
|
+
classTransformer.Expose({ name: 'risk_level' }),
|
|
597
|
+
__metadata("design:type", String)
|
|
598
|
+
], Payment.prototype, "riskLevel", void 0);
|
|
599
|
+
__decorate([
|
|
600
|
+
classTransformer.Expose({ name: 'receipt_url' }),
|
|
601
|
+
__metadata("design:type", String)
|
|
602
|
+
], Payment.prototype, "receiptUrl", void 0);
|
|
603
|
+
__decorate([
|
|
604
|
+
classTransformer.Expose({ name: 'private_label' }),
|
|
605
|
+
__metadata("design:type", String)
|
|
606
|
+
], Payment.prototype, "privateLabel", void 0);
|
|
607
|
+
__decorate([
|
|
608
|
+
classTransformer.Expose({ name: 'pix_qr_code' }),
|
|
609
|
+
__metadata("design:type", String)
|
|
610
|
+
], Payment.prototype, "pixQrCode", void 0);
|
|
611
|
+
__decorate([
|
|
612
|
+
classTransformer.Expose({ name: 'pix_expiration_date' }),
|
|
613
|
+
__metadata("design:type", String)
|
|
614
614
|
], Payment.prototype, "pixExpirationDate", void 0);
|
|
615
615
|
|
|
616
|
-
var SubscriptionPayment = /** @class */ (function (_super) {
|
|
617
|
-
__extends(SubscriptionPayment, _super);
|
|
618
|
-
function SubscriptionPayment() {
|
|
619
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
620
|
-
}
|
|
621
|
-
SubscriptionPayment.prototype.identifierFields = function () {
|
|
622
|
-
return ['id'];
|
|
623
|
-
};
|
|
624
|
-
return SubscriptionPayment;
|
|
625
|
-
}(BaseModel));
|
|
626
|
-
__decorate([
|
|
627
|
-
classTransformer.Type(function () { return Payment; }),
|
|
628
|
-
__metadata("design:type", Payment)
|
|
616
|
+
var SubscriptionPayment = /** @class */ (function (_super) {
|
|
617
|
+
__extends(SubscriptionPayment, _super);
|
|
618
|
+
function SubscriptionPayment() {
|
|
619
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
620
|
+
}
|
|
621
|
+
SubscriptionPayment.prototype.identifierFields = function () {
|
|
622
|
+
return ['id'];
|
|
623
|
+
};
|
|
624
|
+
return SubscriptionPayment;
|
|
625
|
+
}(BaseModel));
|
|
626
|
+
__decorate([
|
|
627
|
+
classTransformer.Type(function () { return Payment; }),
|
|
628
|
+
__metadata("design:type", Payment)
|
|
629
629
|
], SubscriptionPayment.prototype, "payment", void 0);
|
|
630
630
|
|
|
631
|
-
var Address = /** @class */ (function (_super) {
|
|
632
|
-
__extends(Address, _super);
|
|
633
|
-
function Address() {
|
|
634
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
635
|
-
}
|
|
636
|
-
return Address;
|
|
631
|
+
var Address = /** @class */ (function (_super) {
|
|
632
|
+
__extends(Address, _super);
|
|
633
|
+
function Address() {
|
|
634
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
635
|
+
}
|
|
636
|
+
return Address;
|
|
637
637
|
}(BaseModel));
|
|
638
638
|
|
|
639
|
-
var Base = /** @class */ (function () {
|
|
640
|
-
function Base() {
|
|
641
|
-
var args = [];
|
|
642
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
643
|
-
args[_i] = arguments[_i];
|
|
644
|
-
}
|
|
645
|
-
Object.assign.apply(Object, __spreadArray([this], __read(args)));
|
|
646
|
-
}
|
|
647
|
-
return Base;
|
|
639
|
+
var Base = /** @class */ (function () {
|
|
640
|
+
function Base() {
|
|
641
|
+
var args = [];
|
|
642
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
643
|
+
args[_i] = arguments[_i];
|
|
644
|
+
}
|
|
645
|
+
Object.assign.apply(Object, __spreadArray([this], __read(args)));
|
|
646
|
+
}
|
|
647
|
+
return Base;
|
|
648
648
|
}());
|
|
649
649
|
|
|
650
|
-
var Coupon = /** @class */ (function (_super) {
|
|
651
|
-
__extends(Coupon, _super);
|
|
652
|
-
function Coupon() {
|
|
653
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
654
|
-
}
|
|
655
|
-
Object.defineProperty(Coupon.prototype, "isInfluencer", {
|
|
656
|
-
get: function () {
|
|
657
|
-
return !lodash.isNil(this.influencerEmail);
|
|
658
|
-
},
|
|
659
|
-
enumerable: false,
|
|
660
|
-
configurable: true
|
|
661
|
-
});
|
|
662
|
-
Coupon.prototype.identifierFields = function () {
|
|
663
|
-
return ['id'];
|
|
664
|
-
};
|
|
665
|
-
return Coupon;
|
|
666
|
-
}(BaseModel));
|
|
667
|
-
__decorate([
|
|
668
|
-
classTransformer.Expose({ name: 'checkout_type' }),
|
|
669
|
-
__metadata("design:type", Number)
|
|
670
|
-
], Coupon.prototype, "checkoutType", void 0);
|
|
671
|
-
__decorate([
|
|
672
|
-
classTransformer.Expose({ name: 'exclusivity_type' }),
|
|
673
|
-
__metadata("design:type", Number)
|
|
650
|
+
var Coupon = /** @class */ (function (_super) {
|
|
651
|
+
__extends(Coupon, _super);
|
|
652
|
+
function Coupon() {
|
|
653
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
654
|
+
}
|
|
655
|
+
Object.defineProperty(Coupon.prototype, "isInfluencer", {
|
|
656
|
+
get: function () {
|
|
657
|
+
return !lodash.isNil(this.influencerEmail);
|
|
658
|
+
},
|
|
659
|
+
enumerable: false,
|
|
660
|
+
configurable: true
|
|
661
|
+
});
|
|
662
|
+
Coupon.prototype.identifierFields = function () {
|
|
663
|
+
return ['id'];
|
|
664
|
+
};
|
|
665
|
+
return Coupon;
|
|
666
|
+
}(BaseModel));
|
|
667
|
+
__decorate([
|
|
668
|
+
classTransformer.Expose({ name: 'checkout_type' }),
|
|
669
|
+
__metadata("design:type", Number)
|
|
670
|
+
], Coupon.prototype, "checkoutType", void 0);
|
|
671
|
+
__decorate([
|
|
672
|
+
classTransformer.Expose({ name: 'exclusivity_type' }),
|
|
673
|
+
__metadata("design:type", Number)
|
|
674
674
|
], Coupon.prototype, "exclusivityType", void 0);
|
|
675
675
|
|
|
676
|
-
var SubscriptionPlan = /** @class */ (function (_super) {
|
|
677
|
-
__extends(SubscriptionPlan, _super);
|
|
678
|
-
function SubscriptionPlan() {
|
|
679
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
680
|
-
}
|
|
681
|
-
SubscriptionPlan.prototype.identifierFields = function () {
|
|
682
|
-
return ['id'];
|
|
683
|
-
};
|
|
684
|
-
return SubscriptionPlan;
|
|
676
|
+
var SubscriptionPlan = /** @class */ (function (_super) {
|
|
677
|
+
__extends(SubscriptionPlan, _super);
|
|
678
|
+
function SubscriptionPlan() {
|
|
679
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
680
|
+
}
|
|
681
|
+
SubscriptionPlan.prototype.identifierFields = function () {
|
|
682
|
+
return ['id'];
|
|
683
|
+
};
|
|
684
|
+
return SubscriptionPlan;
|
|
685
685
|
}(BaseModel));
|
|
686
686
|
|
|
687
|
-
var BeautyProfile = /** @class */ (function (_super) {
|
|
688
|
-
__extends(BeautyProfile, _super);
|
|
689
|
-
function BeautyProfile() {
|
|
690
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
691
|
-
}
|
|
692
|
-
BeautyProfile.prototype.toPlain = function () {
|
|
693
|
-
var plain = _super.prototype.toPlain.call(this);
|
|
694
|
-
delete plain.id;
|
|
695
|
-
return plain;
|
|
696
|
-
};
|
|
697
|
-
BeautyProfile.prototype.identifierFields = function () {
|
|
698
|
-
return ['id'];
|
|
699
|
-
};
|
|
700
|
-
return BeautyProfile;
|
|
687
|
+
var BeautyProfile = /** @class */ (function (_super) {
|
|
688
|
+
__extends(BeautyProfile, _super);
|
|
689
|
+
function BeautyProfile() {
|
|
690
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
691
|
+
}
|
|
692
|
+
BeautyProfile.prototype.toPlain = function () {
|
|
693
|
+
var plain = _super.prototype.toPlain.call(this);
|
|
694
|
+
delete plain.id;
|
|
695
|
+
return plain;
|
|
696
|
+
};
|
|
697
|
+
BeautyProfile.prototype.identifierFields = function () {
|
|
698
|
+
return ['id'];
|
|
699
|
+
};
|
|
700
|
+
return BeautyProfile;
|
|
701
701
|
}(BaseModel));
|
|
702
702
|
|
|
703
|
-
var User = /** @class */ (function (_super) {
|
|
704
|
-
__extends(User, _super);
|
|
705
|
-
function User() {
|
|
706
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
707
|
-
}
|
|
708
|
-
User.toInstance = function (data) {
|
|
709
|
-
var instance = _super.toInstance.call(this, data);
|
|
710
|
-
if (!lodash.isNil(data.firstName))
|
|
711
|
-
instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
|
|
712
|
-
return instance;
|
|
713
|
-
};
|
|
714
|
-
User.prototype.identifierFields = function () {
|
|
715
|
-
return ['id'];
|
|
716
|
-
};
|
|
717
|
-
User.prototype.toPlain = function () {
|
|
718
|
-
var plain = _super.prototype.toPlain.call(this);
|
|
719
|
-
delete plain.beautyProfile;
|
|
720
|
-
return plain;
|
|
721
|
-
};
|
|
722
|
-
return User;
|
|
723
|
-
}(BaseModel));
|
|
724
|
-
__decorate([
|
|
725
|
-
classTransformer.Type(function () { return BeautyProfile; }),
|
|
726
|
-
__metadata("design:type", BeautyProfile)
|
|
703
|
+
var User = /** @class */ (function (_super) {
|
|
704
|
+
__extends(User, _super);
|
|
705
|
+
function User() {
|
|
706
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
707
|
+
}
|
|
708
|
+
User.toInstance = function (data) {
|
|
709
|
+
var instance = _super.toInstance.call(this, data);
|
|
710
|
+
if (!lodash.isNil(data.firstName))
|
|
711
|
+
instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
|
|
712
|
+
return instance;
|
|
713
|
+
};
|
|
714
|
+
User.prototype.identifierFields = function () {
|
|
715
|
+
return ['id'];
|
|
716
|
+
};
|
|
717
|
+
User.prototype.toPlain = function () {
|
|
718
|
+
var plain = _super.prototype.toPlain.call(this);
|
|
719
|
+
delete plain.beautyProfile;
|
|
720
|
+
return plain;
|
|
721
|
+
};
|
|
722
|
+
return User;
|
|
723
|
+
}(BaseModel));
|
|
724
|
+
__decorate([
|
|
725
|
+
classTransformer.Type(function () { return BeautyProfile; }),
|
|
726
|
+
__metadata("design:type", BeautyProfile)
|
|
727
727
|
], User.prototype, "beautyProfile", void 0);
|
|
728
728
|
|
|
729
|
-
var Subscription = /** @class */ (function (_super) {
|
|
730
|
-
__extends(Subscription, _super);
|
|
731
|
-
function Subscription() {
|
|
732
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
733
|
-
}
|
|
734
|
-
Subscription.prototype.identifierFields = function () {
|
|
735
|
-
return ['id'];
|
|
736
|
-
};
|
|
737
|
-
return Subscription;
|
|
738
|
-
}(BaseModel));
|
|
739
|
-
__decorate([
|
|
740
|
-
classTransformer.Type(function () { return User; }),
|
|
741
|
-
__metadata("design:type", User)
|
|
742
|
-
], Subscription.prototype, "user", void 0);
|
|
743
|
-
__decorate([
|
|
744
|
-
classTransformer.Type(function () { return SubscriptionPlan; }),
|
|
745
|
-
__metadata("design:type", SubscriptionPlan)
|
|
746
|
-
], Subscription.prototype, "subscriptionPlan", void 0);
|
|
747
|
-
__decorate([
|
|
748
|
-
classTransformer.Type(function () { return Address; }),
|
|
749
|
-
__metadata("design:type", Address)
|
|
750
|
-
], Subscription.prototype, "shippingAddress", void 0);
|
|
751
|
-
__decorate([
|
|
752
|
-
classTransformer.Type(function () { return Address; }),
|
|
753
|
-
__metadata("design:type", Address)
|
|
754
|
-
], Subscription.prototype, "billingAddress", void 0);
|
|
755
|
-
__decorate([
|
|
756
|
-
classTransformer.Type(function () { return Coupon; }),
|
|
757
|
-
__metadata("design:type", Coupon)
|
|
758
|
-
], Subscription.prototype, "coupon", void 0);
|
|
759
|
-
__decorate([
|
|
760
|
-
classTransformer.Type(function () { return Edition; }),
|
|
761
|
-
__metadata("design:type", Array)
|
|
762
|
-
], Subscription.prototype, "editions", void 0);
|
|
763
|
-
__decorate([
|
|
764
|
-
classTransformer.Type(function () { return SubscriptionPayment; }),
|
|
765
|
-
__metadata("design:type", Array)
|
|
729
|
+
var Subscription = /** @class */ (function (_super) {
|
|
730
|
+
__extends(Subscription, _super);
|
|
731
|
+
function Subscription() {
|
|
732
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
733
|
+
}
|
|
734
|
+
Subscription.prototype.identifierFields = function () {
|
|
735
|
+
return ['id'];
|
|
736
|
+
};
|
|
737
|
+
return Subscription;
|
|
738
|
+
}(BaseModel));
|
|
739
|
+
__decorate([
|
|
740
|
+
classTransformer.Type(function () { return User; }),
|
|
741
|
+
__metadata("design:type", User)
|
|
742
|
+
], Subscription.prototype, "user", void 0);
|
|
743
|
+
__decorate([
|
|
744
|
+
classTransformer.Type(function () { return SubscriptionPlan; }),
|
|
745
|
+
__metadata("design:type", SubscriptionPlan)
|
|
746
|
+
], Subscription.prototype, "subscriptionPlan", void 0);
|
|
747
|
+
__decorate([
|
|
748
|
+
classTransformer.Type(function () { return Address; }),
|
|
749
|
+
__metadata("design:type", Address)
|
|
750
|
+
], Subscription.prototype, "shippingAddress", void 0);
|
|
751
|
+
__decorate([
|
|
752
|
+
classTransformer.Type(function () { return Address; }),
|
|
753
|
+
__metadata("design:type", Address)
|
|
754
|
+
], Subscription.prototype, "billingAddress", void 0);
|
|
755
|
+
__decorate([
|
|
756
|
+
classTransformer.Type(function () { return Coupon; }),
|
|
757
|
+
__metadata("design:type", Coupon)
|
|
758
|
+
], Subscription.prototype, "coupon", void 0);
|
|
759
|
+
__decorate([
|
|
760
|
+
classTransformer.Type(function () { return Edition; }),
|
|
761
|
+
__metadata("design:type", Array)
|
|
762
|
+
], Subscription.prototype, "editions", void 0);
|
|
763
|
+
__decorate([
|
|
764
|
+
classTransformer.Type(function () { return SubscriptionPayment; }),
|
|
765
|
+
__metadata("design:type", Array)
|
|
766
766
|
], Subscription.prototype, "payment", void 0);
|
|
767
767
|
|
|
768
|
-
var UserAddress = /** @class */ (function (_super) {
|
|
769
|
-
__extends(UserAddress, _super);
|
|
770
|
-
function UserAddress() {
|
|
771
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
772
|
-
}
|
|
773
|
-
UserAddress.prototype.identifierFields = function () {
|
|
774
|
-
return ['id'];
|
|
775
|
-
};
|
|
776
|
-
return UserAddress;
|
|
768
|
+
var UserAddress = /** @class */ (function (_super) {
|
|
769
|
+
__extends(UserAddress, _super);
|
|
770
|
+
function UserAddress() {
|
|
771
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
772
|
+
}
|
|
773
|
+
UserAddress.prototype.identifierFields = function () {
|
|
774
|
+
return ['id'];
|
|
775
|
+
};
|
|
776
|
+
return UserAddress;
|
|
777
777
|
}(Address));
|
|
778
778
|
|
|
779
|
-
var
|
|
780
|
-
__extends(
|
|
781
|
-
function
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
779
|
+
var Lead = /** @class */ (function (_super) {
|
|
780
|
+
__extends(Lead, _super);
|
|
781
|
+
function Lead() {
|
|
782
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
783
|
+
}
|
|
784
|
+
Lead.prototype.identifierFields = function () {
|
|
785
|
+
return ['id'];
|
|
786
|
+
};
|
|
787
|
+
return Lead;
|
|
788
|
+
}(BaseModel));
|
|
789
|
+
|
|
790
|
+
var UnauthorizedError = /** @class */ (function (_super) {
|
|
791
|
+
__extends(UnauthorizedError, _super);
|
|
792
|
+
function UnauthorizedError(message) {
|
|
793
|
+
var _this = _super.call(this, message) || this;
|
|
794
|
+
_this.message = message;
|
|
795
|
+
return _this;
|
|
796
|
+
}
|
|
797
|
+
return UnauthorizedError;
|
|
787
798
|
}(Error));
|
|
788
799
|
|
|
789
|
-
exports.SignInMethods = void 0;
|
|
790
|
-
(function (SignInMethods) {
|
|
791
|
-
SignInMethods["EMAIL_PASSWORD"] = "email_password";
|
|
792
|
-
SignInMethods["GOOGLE"] = "google";
|
|
793
|
-
})(exports.SignInMethods || (exports.SignInMethods = {}));
|
|
794
|
-
var Authentication = /** @class */ (function () {
|
|
795
|
-
function Authentication(authService, userRepository) {
|
|
796
|
-
this.authService = authService;
|
|
797
|
-
this.userRepository = userRepository;
|
|
798
|
-
}
|
|
799
|
-
Authentication.prototype.signIn = function (_b, signInMethod) {
|
|
800
|
-
var email = _b.email, password = _b.password;
|
|
801
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
802
|
-
var method, userAuth, user;
|
|
803
|
-
return __generator(this, function (_b) {
|
|
804
|
-
switch (_b.label) {
|
|
805
|
-
case 0:
|
|
806
|
-
method = this.getServiceByMethod(signInMethod);
|
|
807
|
-
return [4 /*yield*/, this.authService[method]({ email: email, password: password })];
|
|
808
|
-
case 1:
|
|
809
|
-
userAuth = _b.sent();
|
|
810
|
-
user = this.userRepository.get(userAuth);
|
|
811
|
-
if (!lodash.isNil(user))
|
|
812
|
-
return [2 /*return*/, user];
|
|
813
|
-
if (/^.+@b4a.com.br$/.test(userAuth.email))
|
|
814
|
-
return [2 /*return*/, this.createsUserByCredential(userAuth)];
|
|
815
|
-
throw new UnauthorizedError('Invalid credentials');
|
|
816
|
-
}
|
|
817
|
-
});
|
|
818
|
-
});
|
|
819
|
-
};
|
|
820
|
-
Authentication.prototype.getServiceByMethod = function (signInMethod) {
|
|
821
|
-
return signInMethod === exports.SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
|
|
822
|
-
};
|
|
823
|
-
Authentication.prototype.createsUserByCredential = function (user) {
|
|
824
|
-
var _a;
|
|
825
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
826
|
-
var _b, firstName, lastName, person;
|
|
827
|
-
return __generator(this, function (_c) {
|
|
828
|
-
_b = __read((_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/), 2), firstName = _b[0], lastName = _b[1];
|
|
829
|
-
person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName: firstName,
|
|
830
|
-
lastName: lastName, acceptsNewsletter: false, area: exports.Area.Transactional, officePosition: exports.OfficePosition.Intern, type: exports.UserType.Collaborator }));
|
|
831
|
-
return [2 /*return*/, this.userRepository.create(person)];
|
|
832
|
-
});
|
|
833
|
-
});
|
|
834
|
-
};
|
|
835
|
-
return Authentication;
|
|
800
|
+
exports.SignInMethods = void 0;
|
|
801
|
+
(function (SignInMethods) {
|
|
802
|
+
SignInMethods["EMAIL_PASSWORD"] = "email_password";
|
|
803
|
+
SignInMethods["GOOGLE"] = "google";
|
|
804
|
+
})(exports.SignInMethods || (exports.SignInMethods = {}));
|
|
805
|
+
var Authentication = /** @class */ (function () {
|
|
806
|
+
function Authentication(authService, userRepository) {
|
|
807
|
+
this.authService = authService;
|
|
808
|
+
this.userRepository = userRepository;
|
|
809
|
+
}
|
|
810
|
+
Authentication.prototype.signIn = function (_b, signInMethod) {
|
|
811
|
+
var email = _b.email, password = _b.password;
|
|
812
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
813
|
+
var method, userAuth, user;
|
|
814
|
+
return __generator(this, function (_b) {
|
|
815
|
+
switch (_b.label) {
|
|
816
|
+
case 0:
|
|
817
|
+
method = this.getServiceByMethod(signInMethod);
|
|
818
|
+
return [4 /*yield*/, this.authService[method]({ email: email, password: password })];
|
|
819
|
+
case 1:
|
|
820
|
+
userAuth = _b.sent();
|
|
821
|
+
user = this.userRepository.get(userAuth);
|
|
822
|
+
if (!lodash.isNil(user))
|
|
823
|
+
return [2 /*return*/, user];
|
|
824
|
+
if (/^.+@b4a.com.br$/.test(userAuth.email))
|
|
825
|
+
return [2 /*return*/, this.createsUserByCredential(userAuth)];
|
|
826
|
+
throw new UnauthorizedError('Invalid credentials');
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
});
|
|
830
|
+
};
|
|
831
|
+
Authentication.prototype.getServiceByMethod = function (signInMethod) {
|
|
832
|
+
return signInMethod === exports.SignInMethods.EMAIL_PASSWORD ? 'signInWithEmailAndPassword' : 'signInWithGoogle';
|
|
833
|
+
};
|
|
834
|
+
Authentication.prototype.createsUserByCredential = function (user) {
|
|
835
|
+
var _a;
|
|
836
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
837
|
+
var _b, firstName, lastName, person;
|
|
838
|
+
return __generator(this, function (_c) {
|
|
839
|
+
_b = __read((_a = user.displayName) === null || _a === void 0 ? void 0 : _a.split(/\s/), 2), firstName = _b[0], lastName = _b[1];
|
|
840
|
+
person = User.toInstance(Object.assign(Object.assign({}, user), { cpf: '', birthday: new Date(), firstName: firstName,
|
|
841
|
+
lastName: lastName, acceptsNewsletter: false, area: exports.Area.Transactional, officePosition: exports.OfficePosition.Intern, type: exports.UserType.Collaborator }));
|
|
842
|
+
return [2 /*return*/, this.userRepository.create(person)];
|
|
843
|
+
});
|
|
844
|
+
});
|
|
845
|
+
};
|
|
846
|
+
return Authentication;
|
|
836
847
|
}());
|
|
837
848
|
|
|
838
|
-
var SignOut = /** @class */ (function () {
|
|
839
|
-
function SignOut(authService) {
|
|
840
|
-
this.authService = authService;
|
|
841
|
-
}
|
|
842
|
-
SignOut.prototype.signOut = function () {
|
|
843
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
844
|
-
return __generator(this, function (_a) {
|
|
845
|
-
switch (_a.label) {
|
|
846
|
-
case 0: return [4 /*yield*/, this.authService.signOut()];
|
|
847
|
-
case 1:
|
|
848
|
-
_a.sent();
|
|
849
|
-
return [2 /*return*/];
|
|
850
|
-
}
|
|
851
|
-
});
|
|
852
|
-
});
|
|
853
|
-
};
|
|
854
|
-
return SignOut;
|
|
849
|
+
var SignOut = /** @class */ (function () {
|
|
850
|
+
function SignOut(authService) {
|
|
851
|
+
this.authService = authService;
|
|
852
|
+
}
|
|
853
|
+
SignOut.prototype.signOut = function () {
|
|
854
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
855
|
+
return __generator(this, function (_a) {
|
|
856
|
+
switch (_a.label) {
|
|
857
|
+
case 0: return [4 /*yield*/, this.authService.signOut()];
|
|
858
|
+
case 1:
|
|
859
|
+
_a.sent();
|
|
860
|
+
return [2 /*return*/];
|
|
861
|
+
}
|
|
862
|
+
});
|
|
863
|
+
});
|
|
864
|
+
};
|
|
865
|
+
return SignOut;
|
|
855
866
|
}());
|
|
856
867
|
|
|
857
|
-
exports.Shops = void 0;
|
|
858
|
-
(function (Shops) {
|
|
859
|
-
Shops["MENSMARKET"] = "mensmarket";
|
|
860
|
-
Shops["GLAMSHOP"] = "Glamshop";
|
|
868
|
+
exports.Shops = void 0;
|
|
869
|
+
(function (Shops) {
|
|
870
|
+
Shops["MENSMARKET"] = "mensmarket";
|
|
871
|
+
Shops["GLAMSHOP"] = "Glamshop";
|
|
861
872
|
})(exports.Shops || (exports.Shops = {}));
|
|
862
873
|
|
|
863
|
-
var Category = /** @class */ (function (_super) {
|
|
864
|
-
__extends(Category, _super);
|
|
865
|
-
function Category() {
|
|
866
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
867
|
-
}
|
|
868
|
-
Category.prototype.identifierFields = function () {
|
|
869
|
-
return ['id'];
|
|
870
|
-
};
|
|
871
|
-
return Category;
|
|
874
|
+
var Category = /** @class */ (function (_super) {
|
|
875
|
+
__extends(Category, _super);
|
|
876
|
+
function Category() {
|
|
877
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
878
|
+
}
|
|
879
|
+
Category.prototype.identifierFields = function () {
|
|
880
|
+
return ['id'];
|
|
881
|
+
};
|
|
882
|
+
return Category;
|
|
872
883
|
}(BaseModel));
|
|
873
884
|
|
|
874
|
-
var Product = /** @class */ (function (_super) {
|
|
875
|
-
__extends(Product, _super);
|
|
876
|
-
function Product() {
|
|
877
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
878
|
-
}
|
|
879
|
-
Product.prototype.identifierFields = function () {
|
|
880
|
-
return ['id'];
|
|
881
|
-
};
|
|
882
|
-
Product.prototype.getInfoByShop = function (shop) {
|
|
883
|
-
var _a, _b, _c, _d, _e, _f;
|
|
884
|
-
return Object.assign(Object.assign(Object.assign({}, (((_b = (_a = this.description) === null || _a === void 0 ? void 0 : _a[shop]) === null || _b === void 0 ? void 0 : _b.description) ? { description: (_d = (_c = this.description) === null || _c === void 0 ? void 0 : _c[shop]) === null || _d === void 0 ? void 0 : _d.description } : {})), (((_e = this.price) === null || _e === void 0 ? void 0 : _e[shop]) || {})), (((_f = this.stock) === null || _f === void 0 ? void 0 : _f[shop]) || {}));
|
|
885
|
-
};
|
|
886
|
-
return Product;
|
|
885
|
+
var Product = /** @class */ (function (_super) {
|
|
886
|
+
__extends(Product, _super);
|
|
887
|
+
function Product() {
|
|
888
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
889
|
+
}
|
|
890
|
+
Product.prototype.identifierFields = function () {
|
|
891
|
+
return ['id'];
|
|
892
|
+
};
|
|
893
|
+
Product.prototype.getInfoByShop = function (shop) {
|
|
894
|
+
var _a, _b, _c, _d, _e, _f;
|
|
895
|
+
return Object.assign(Object.assign(Object.assign({}, (((_b = (_a = this.description) === null || _a === void 0 ? void 0 : _a[shop]) === null || _b === void 0 ? void 0 : _b.description) ? { description: (_d = (_c = this.description) === null || _c === void 0 ? void 0 : _c[shop]) === null || _d === void 0 ? void 0 : _d.description } : {})), (((_e = this.price) === null || _e === void 0 ? void 0 : _e[shop]) || {})), (((_f = this.stock) === null || _f === void 0 ? void 0 : _f[shop]) || {}));
|
|
896
|
+
};
|
|
897
|
+
return Product;
|
|
887
898
|
}(BaseModel));
|
|
888
899
|
|
|
889
|
-
var Variant = /** @class */ (function (_super) {
|
|
890
|
-
__extends(Variant, _super);
|
|
891
|
-
function Variant() {
|
|
892
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
893
|
-
}
|
|
894
|
-
Variant.prototype.identifierFields = function () {
|
|
895
|
-
return ['id'];
|
|
896
|
-
};
|
|
897
|
-
return Variant;
|
|
900
|
+
var Variant = /** @class */ (function (_super) {
|
|
901
|
+
__extends(Variant, _super);
|
|
902
|
+
function Variant() {
|
|
903
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
904
|
+
}
|
|
905
|
+
Variant.prototype.identifierFields = function () {
|
|
906
|
+
return ['id'];
|
|
907
|
+
};
|
|
908
|
+
return Variant;
|
|
898
909
|
}(BaseModel));
|
|
899
910
|
|
|
900
|
-
exports.CouponTypes = void 0;
|
|
901
|
-
(function (CouponTypes) {
|
|
902
|
-
CouponTypes[CouponTypes["FINANCIAL"] = 1] = "FINANCIAL";
|
|
903
|
-
CouponTypes[CouponTypes["PRODUCT"] = 2] = "PRODUCT";
|
|
904
|
-
CouponTypes[CouponTypes["GIFTCARD"] = 3] = "GIFTCARD";
|
|
905
|
-
CouponTypes[CouponTypes["VOUCHER"] = 4] = "VOUCHER";
|
|
911
|
+
exports.CouponTypes = void 0;
|
|
912
|
+
(function (CouponTypes) {
|
|
913
|
+
CouponTypes[CouponTypes["FINANCIAL"] = 1] = "FINANCIAL";
|
|
914
|
+
CouponTypes[CouponTypes["PRODUCT"] = 2] = "PRODUCT";
|
|
915
|
+
CouponTypes[CouponTypes["GIFTCARD"] = 3] = "GIFTCARD";
|
|
916
|
+
CouponTypes[CouponTypes["VOUCHER"] = 4] = "VOUCHER";
|
|
906
917
|
})(exports.CouponTypes || (exports.CouponTypes = {}));
|
|
907
918
|
|
|
908
|
-
exports.CouponSubtypes = void 0;
|
|
909
|
-
(function (CouponSubtypes) {
|
|
910
|
-
CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
|
|
911
|
-
CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
|
|
919
|
+
exports.CouponSubtypes = void 0;
|
|
920
|
+
(function (CouponSubtypes) {
|
|
921
|
+
CouponSubtypes[CouponSubtypes["ABSOLUTE"] = 1] = "ABSOLUTE";
|
|
922
|
+
CouponSubtypes[CouponSubtypes["PERCENTAGE"] = 2] = "PERCENTAGE";
|
|
912
923
|
})(exports.CouponSubtypes || (exports.CouponSubtypes = {}));
|
|
913
924
|
|
|
914
|
-
exports.Exclusivities = void 0;
|
|
915
|
-
(function (Exclusivities) {
|
|
916
|
-
Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
|
|
917
|
-
Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
|
|
918
|
-
Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
|
|
925
|
+
exports.Exclusivities = void 0;
|
|
926
|
+
(function (Exclusivities) {
|
|
927
|
+
Exclusivities[Exclusivities["ALL_USERS"] = 1] = "ALL_USERS";
|
|
928
|
+
Exclusivities[Exclusivities["SPECIFIC_USER"] = 2] = "SPECIFIC_USER";
|
|
929
|
+
Exclusivities[Exclusivities["COLLABORATORS"] = 3] = "COLLABORATORS";
|
|
919
930
|
})(exports.Exclusivities || (exports.Exclusivities = {}));
|
|
920
931
|
|
|
921
|
-
exports.CheckoutTypes = void 0;
|
|
922
|
-
(function (CheckoutTypes) {
|
|
923
|
-
CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
|
|
924
|
-
CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
|
|
932
|
+
exports.CheckoutTypes = void 0;
|
|
933
|
+
(function (CheckoutTypes) {
|
|
934
|
+
CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
|
|
935
|
+
CheckoutTypes[CheckoutTypes["SUBSCRIPTION"] = 2] = "SUBSCRIPTION";
|
|
925
936
|
})(exports.CheckoutTypes || (exports.CheckoutTypes = {}));
|
|
926
937
|
|
|
927
|
-
var COUPON_EXPIRATION = 60 * 60 * 24 * 30;
|
|
928
|
-
var FinancialCoupon = /** @class */ (function (_super) {
|
|
929
|
-
__extends(FinancialCoupon, _super);
|
|
930
|
-
function FinancialCoupon() {
|
|
931
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
932
|
-
_this.type = exports.CouponTypes.FINANCIAL;
|
|
933
|
-
return _this;
|
|
934
|
-
}
|
|
935
|
-
FinancialCoupon.isFinancialCoupon = function (coupon) {
|
|
936
|
-
return coupon.type === exports.CouponTypes.FINANCIAL && !!coupon.subtype;
|
|
937
|
-
};
|
|
938
|
-
FinancialCoupon.createCoupon = function (userId) {
|
|
939
|
-
return this.toInstance({
|
|
940
|
-
name: tsMd5.Md5.hashStr(userId + "_" + Date.now).toString(),
|
|
941
|
-
nickname: "" + Date.now(),
|
|
942
|
-
type: exports.CouponTypes.FINANCIAL,
|
|
943
|
-
subtype: exports.CouponSubtypes.PERCENTAGE,
|
|
944
|
-
checkoutType: exports.CheckoutTypes.ECOMMERCE,
|
|
945
|
-
discount: 30,
|
|
946
|
-
user: userId,
|
|
947
|
-
createdAt: new Date(Date.now()),
|
|
948
|
-
expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
|
|
949
|
-
});
|
|
950
|
-
};
|
|
951
|
-
return FinancialCoupon;
|
|
938
|
+
var COUPON_EXPIRATION = 60 * 60 * 24 * 30;
|
|
939
|
+
var FinancialCoupon = /** @class */ (function (_super) {
|
|
940
|
+
__extends(FinancialCoupon, _super);
|
|
941
|
+
function FinancialCoupon() {
|
|
942
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
943
|
+
_this.type = exports.CouponTypes.FINANCIAL;
|
|
944
|
+
return _this;
|
|
945
|
+
}
|
|
946
|
+
FinancialCoupon.isFinancialCoupon = function (coupon) {
|
|
947
|
+
return coupon.type === exports.CouponTypes.FINANCIAL && !!coupon.subtype;
|
|
948
|
+
};
|
|
949
|
+
FinancialCoupon.createCoupon = function (userId) {
|
|
950
|
+
return this.toInstance({
|
|
951
|
+
name: tsMd5.Md5.hashStr(userId + "_" + Date.now).toString(),
|
|
952
|
+
nickname: "" + Date.now(),
|
|
953
|
+
type: exports.CouponTypes.FINANCIAL,
|
|
954
|
+
subtype: exports.CouponSubtypes.PERCENTAGE,
|
|
955
|
+
checkoutType: exports.CheckoutTypes.ECOMMERCE,
|
|
956
|
+
discount: 30,
|
|
957
|
+
user: userId,
|
|
958
|
+
createdAt: new Date(Date.now()),
|
|
959
|
+
expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
|
|
960
|
+
});
|
|
961
|
+
};
|
|
962
|
+
return FinancialCoupon;
|
|
952
963
|
}(Coupon));
|
|
953
964
|
|
|
954
|
-
exports.OrderStatus = void 0;
|
|
955
|
-
(function (OrderStatus) {
|
|
956
|
-
OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
|
|
957
|
-
OrderStatus["EM_PREPARO"] = "Preparando pedido";
|
|
958
|
-
OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
|
|
959
|
-
OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
|
|
960
|
-
OrderStatus["ENVIADO"] = "Pedido Enviado";
|
|
961
|
-
OrderStatus["ENTREGUE"] = "Pedido entregue";
|
|
962
|
-
OrderStatus["CANCELADO"] = "Cancelado";
|
|
963
|
-
OrderStatus["CREDIT_CARD"] = "credit_card";
|
|
965
|
+
exports.OrderStatus = void 0;
|
|
966
|
+
(function (OrderStatus) {
|
|
967
|
+
OrderStatus["AGUARDANDO_PAGAMENTO"] = "Aguardando pagamento";
|
|
968
|
+
OrderStatus["EM_PREPARO"] = "Preparando pedido";
|
|
969
|
+
OrderStatus["NF_EMITIDA"] = "Nota Fiscal Emitida";
|
|
970
|
+
OrderStatus["AGUARDANDO_ENVIO"] = "Aguardando Transaportadora";
|
|
971
|
+
OrderStatus["ENVIADO"] = "Pedido Enviado";
|
|
972
|
+
OrderStatus["ENTREGUE"] = "Pedido entregue";
|
|
973
|
+
OrderStatus["CANCELADO"] = "Cancelado";
|
|
974
|
+
OrderStatus["CREDIT_CARD"] = "credit_card";
|
|
964
975
|
})(exports.OrderStatus || (exports.OrderStatus = {}));
|
|
965
976
|
|
|
966
|
-
var LineItem = /** @class */ (function (_super) {
|
|
967
|
-
__extends(LineItem, _super);
|
|
968
|
-
function LineItem() {
|
|
969
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
970
|
-
}
|
|
971
|
-
return LineItem;
|
|
977
|
+
var LineItem = /** @class */ (function (_super) {
|
|
978
|
+
__extends(LineItem, _super);
|
|
979
|
+
function LineItem() {
|
|
980
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
981
|
+
}
|
|
982
|
+
return LineItem;
|
|
972
983
|
}(Product));
|
|
973
984
|
|
|
974
|
-
var ShippingMethod = /** @class */ (function (_super) {
|
|
975
|
-
__extends(ShippingMethod, _super);
|
|
976
|
-
function ShippingMethod() {
|
|
977
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
978
|
-
}
|
|
979
|
-
ShippingMethod.prototype.identifierFields = function () {
|
|
980
|
-
return ['id'];
|
|
981
|
-
};
|
|
982
|
-
return ShippingMethod;
|
|
985
|
+
var ShippingMethod = /** @class */ (function (_super) {
|
|
986
|
+
__extends(ShippingMethod, _super);
|
|
987
|
+
function ShippingMethod() {
|
|
988
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
989
|
+
}
|
|
990
|
+
ShippingMethod.prototype.identifierFields = function () {
|
|
991
|
+
return ['id'];
|
|
992
|
+
};
|
|
993
|
+
return ShippingMethod;
|
|
983
994
|
}(BaseModel));
|
|
984
995
|
|
|
985
|
-
var Checkout = /** @class */ (function (_super) {
|
|
986
|
-
__extends(Checkout, _super);
|
|
987
|
-
function Checkout() {
|
|
988
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
989
|
-
}
|
|
990
|
-
Checkout.prototype.identifierFields = function () {
|
|
991
|
-
return ['id'];
|
|
992
|
-
};
|
|
993
|
-
return Checkout;
|
|
994
|
-
}(BaseModel));
|
|
995
|
-
__decorate([
|
|
996
|
-
classTransformer.Type(function () { return LineItem; }),
|
|
997
|
-
__metadata("design:type", Array)
|
|
998
|
-
], Checkout.prototype, "lineItems", void 0);
|
|
999
|
-
__decorate([
|
|
1000
|
-
classTransformer.Type(function () { return User; }),
|
|
1001
|
-
__metadata("design:type", User)
|
|
1002
|
-
], Checkout.prototype, "user", void 0);
|
|
1003
|
-
__decorate([
|
|
1004
|
-
classTransformer.Type(function () { return Address; }),
|
|
1005
|
-
__metadata("design:type", Address)
|
|
1006
|
-
], Checkout.prototype, "shippingAddress", void 0);
|
|
1007
|
-
__decorate([
|
|
1008
|
-
classTransformer.Type(function () { return Address; }),
|
|
1009
|
-
__metadata("design:type", Address)
|
|
1010
|
-
], Checkout.prototype, "billingAddress", void 0);
|
|
1011
|
-
__decorate([
|
|
1012
|
-
classTransformer.Type(function () { return ShippingMethod; }),
|
|
1013
|
-
__metadata("design:type", ShippingMethod)
|
|
1014
|
-
], Checkout.prototype, "shipping", void 0);
|
|
1015
|
-
__decorate([
|
|
1016
|
-
classTransformer.Type(function () { return Coupon; }),
|
|
1017
|
-
__metadata("design:type", Coupon)
|
|
996
|
+
var Checkout = /** @class */ (function (_super) {
|
|
997
|
+
__extends(Checkout, _super);
|
|
998
|
+
function Checkout() {
|
|
999
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1000
|
+
}
|
|
1001
|
+
Checkout.prototype.identifierFields = function () {
|
|
1002
|
+
return ['id'];
|
|
1003
|
+
};
|
|
1004
|
+
return Checkout;
|
|
1005
|
+
}(BaseModel));
|
|
1006
|
+
__decorate([
|
|
1007
|
+
classTransformer.Type(function () { return LineItem; }),
|
|
1008
|
+
__metadata("design:type", Array)
|
|
1009
|
+
], Checkout.prototype, "lineItems", void 0);
|
|
1010
|
+
__decorate([
|
|
1011
|
+
classTransformer.Type(function () { return User; }),
|
|
1012
|
+
__metadata("design:type", User)
|
|
1013
|
+
], Checkout.prototype, "user", void 0);
|
|
1014
|
+
__decorate([
|
|
1015
|
+
classTransformer.Type(function () { return Address; }),
|
|
1016
|
+
__metadata("design:type", Address)
|
|
1017
|
+
], Checkout.prototype, "shippingAddress", void 0);
|
|
1018
|
+
__decorate([
|
|
1019
|
+
classTransformer.Type(function () { return Address; }),
|
|
1020
|
+
__metadata("design:type", Address)
|
|
1021
|
+
], Checkout.prototype, "billingAddress", void 0);
|
|
1022
|
+
__decorate([
|
|
1023
|
+
classTransformer.Type(function () { return ShippingMethod; }),
|
|
1024
|
+
__metadata("design:type", ShippingMethod)
|
|
1025
|
+
], Checkout.prototype, "shipping", void 0);
|
|
1026
|
+
__decorate([
|
|
1027
|
+
classTransformer.Type(function () { return Coupon; }),
|
|
1028
|
+
__metadata("design:type", Coupon)
|
|
1018
1029
|
], Checkout.prototype, "coupon", void 0);
|
|
1019
1030
|
|
|
1020
|
-
var Order = /** @class */ (function (_super) {
|
|
1021
|
-
__extends(Order, _super);
|
|
1022
|
-
function Order() {
|
|
1023
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1024
|
-
}
|
|
1025
|
-
return Order;
|
|
1026
|
-
}(Checkout));
|
|
1027
|
-
__decorate([
|
|
1028
|
-
classTransformer.Type(function () { return Payment; }),
|
|
1029
|
-
__metadata("design:type", Payment)
|
|
1031
|
+
var Order = /** @class */ (function (_super) {
|
|
1032
|
+
__extends(Order, _super);
|
|
1033
|
+
function Order() {
|
|
1034
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1035
|
+
}
|
|
1036
|
+
return Order;
|
|
1037
|
+
}(Checkout));
|
|
1038
|
+
__decorate([
|
|
1039
|
+
classTransformer.Type(function () { return Payment; }),
|
|
1040
|
+
__metadata("design:type", Payment)
|
|
1030
1041
|
], Order.prototype, "payment", void 0);
|
|
1031
1042
|
|
|
1032
|
-
var CheckoutSubscription = /** @class */ (function (_super) {
|
|
1033
|
-
__extends(CheckoutSubscription, _super);
|
|
1034
|
-
function CheckoutSubscription() {
|
|
1035
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1036
|
-
}
|
|
1037
|
-
CheckoutSubscription.prototype.identifierFields = function () {
|
|
1038
|
-
return ['id'];
|
|
1039
|
-
};
|
|
1040
|
-
return CheckoutSubscription;
|
|
1041
|
-
}(BaseModel));
|
|
1042
|
-
__decorate([
|
|
1043
|
-
classTransformer.Type(function () { return Address; }),
|
|
1044
|
-
__metadata("design:type", Address)
|
|
1045
|
-
], CheckoutSubscription.prototype, "shippingAddress", void 0);
|
|
1046
|
-
__decorate([
|
|
1047
|
-
classTransformer.Type(function () { return Address; }),
|
|
1048
|
-
__metadata("design:type", Address)
|
|
1049
|
-
], CheckoutSubscription.prototype, "billingAddress", void 0);
|
|
1050
|
-
__decorate([
|
|
1051
|
-
classTransformer.Type(function () { return SubscriptionPlan; }),
|
|
1052
|
-
__metadata("design:type", SubscriptionPlan)
|
|
1053
|
-
], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
|
|
1054
|
-
__decorate([
|
|
1055
|
-
classTransformer.Type(function () { return Coupon; }),
|
|
1056
|
-
__metadata("design:type", Coupon)
|
|
1043
|
+
var CheckoutSubscription = /** @class */ (function (_super) {
|
|
1044
|
+
__extends(CheckoutSubscription, _super);
|
|
1045
|
+
function CheckoutSubscription() {
|
|
1046
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1047
|
+
}
|
|
1048
|
+
CheckoutSubscription.prototype.identifierFields = function () {
|
|
1049
|
+
return ['id'];
|
|
1050
|
+
};
|
|
1051
|
+
return CheckoutSubscription;
|
|
1052
|
+
}(BaseModel));
|
|
1053
|
+
__decorate([
|
|
1054
|
+
classTransformer.Type(function () { return Address; }),
|
|
1055
|
+
__metadata("design:type", Address)
|
|
1056
|
+
], CheckoutSubscription.prototype, "shippingAddress", void 0);
|
|
1057
|
+
__decorate([
|
|
1058
|
+
classTransformer.Type(function () { return Address; }),
|
|
1059
|
+
__metadata("design:type", Address)
|
|
1060
|
+
], CheckoutSubscription.prototype, "billingAddress", void 0);
|
|
1061
|
+
__decorate([
|
|
1062
|
+
classTransformer.Type(function () { return SubscriptionPlan; }),
|
|
1063
|
+
__metadata("design:type", SubscriptionPlan)
|
|
1064
|
+
], CheckoutSubscription.prototype, "subscriptionPlan", void 0);
|
|
1065
|
+
__decorate([
|
|
1066
|
+
classTransformer.Type(function () { return Coupon; }),
|
|
1067
|
+
__metadata("design:type", Coupon)
|
|
1057
1068
|
], CheckoutSubscription.prototype, "coupon", void 0);
|
|
1058
1069
|
|
|
1059
|
-
var Buy2Win = /** @class */ (function (_super) {
|
|
1060
|
-
__extends(Buy2Win, _super);
|
|
1061
|
-
function Buy2Win() {
|
|
1062
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1063
|
-
}
|
|
1064
|
-
Buy2Win.prototype.identifierFields = function () {
|
|
1065
|
-
return ['id'];
|
|
1066
|
-
};
|
|
1067
|
-
return Buy2Win;
|
|
1068
|
-
}(BaseModel));
|
|
1069
|
-
__decorate([
|
|
1070
|
-
classTransformer.Type(function () { return Category; }),
|
|
1071
|
-
__metadata("design:type", Array)
|
|
1070
|
+
var Buy2Win = /** @class */ (function (_super) {
|
|
1071
|
+
__extends(Buy2Win, _super);
|
|
1072
|
+
function Buy2Win() {
|
|
1073
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1074
|
+
}
|
|
1075
|
+
Buy2Win.prototype.identifierFields = function () {
|
|
1076
|
+
return ['id'];
|
|
1077
|
+
};
|
|
1078
|
+
return Buy2Win;
|
|
1079
|
+
}(BaseModel));
|
|
1080
|
+
__decorate([
|
|
1081
|
+
classTransformer.Type(function () { return Category; }),
|
|
1082
|
+
__metadata("design:type", Array)
|
|
1072
1083
|
], Buy2Win.prototype, "categories", void 0);
|
|
1073
1084
|
|
|
1074
|
-
var Home = /** @class */ (function (_super) {
|
|
1075
|
-
__extends(Home, _super);
|
|
1076
|
-
function Home() {
|
|
1077
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1078
|
-
}
|
|
1079
|
-
Home.prototype.identifierFields = function () {
|
|
1080
|
-
return ['id'];
|
|
1081
|
-
};
|
|
1082
|
-
return Home;
|
|
1085
|
+
var Home = /** @class */ (function (_super) {
|
|
1086
|
+
__extends(Home, _super);
|
|
1087
|
+
function Home() {
|
|
1088
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1089
|
+
}
|
|
1090
|
+
Home.prototype.identifierFields = function () {
|
|
1091
|
+
return ['id'];
|
|
1092
|
+
};
|
|
1093
|
+
return Home;
|
|
1083
1094
|
}(BaseModel));
|
|
1084
1095
|
|
|
1085
|
-
var ShopMenu = /** @class */ (function (_super) {
|
|
1086
|
-
__extends(ShopMenu, _super);
|
|
1087
|
-
function ShopMenu() {
|
|
1088
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1089
|
-
}
|
|
1090
|
-
ShopMenu.prototype.identifierFields = function () {
|
|
1091
|
-
return ['id'];
|
|
1092
|
-
};
|
|
1093
|
-
return ShopMenu;
|
|
1096
|
+
var ShopMenu = /** @class */ (function (_super) {
|
|
1097
|
+
__extends(ShopMenu, _super);
|
|
1098
|
+
function ShopMenu() {
|
|
1099
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1100
|
+
}
|
|
1101
|
+
ShopMenu.prototype.identifierFields = function () {
|
|
1102
|
+
return ['id'];
|
|
1103
|
+
};
|
|
1104
|
+
return ShopMenu;
|
|
1094
1105
|
}(BaseModel));
|
|
1095
1106
|
|
|
1096
|
-
var InvalidArgumentError = /** @class */ (function (_super) {
|
|
1097
|
-
__extends(InvalidArgumentError, _super);
|
|
1098
|
-
function InvalidArgumentError(message) {
|
|
1099
|
-
var _this = _super.call(this, message) || this;
|
|
1100
|
-
_this.message = message;
|
|
1101
|
-
return _this;
|
|
1102
|
-
}
|
|
1103
|
-
return InvalidArgumentError;
|
|
1107
|
+
var InvalidArgumentError = /** @class */ (function (_super) {
|
|
1108
|
+
__extends(InvalidArgumentError, _super);
|
|
1109
|
+
function InvalidArgumentError(message) {
|
|
1110
|
+
var _this = _super.call(this, message) || this;
|
|
1111
|
+
_this.message = message;
|
|
1112
|
+
return _this;
|
|
1113
|
+
}
|
|
1114
|
+
return InvalidArgumentError;
|
|
1104
1115
|
}(Error));
|
|
1105
1116
|
|
|
1106
|
-
var RequiredArgumentError = /** @class */ (function (_super) {
|
|
1107
|
-
__extends(RequiredArgumentError, _super);
|
|
1108
|
-
function RequiredArgumentError(args) {
|
|
1109
|
-
var _this = _super.call(this, "Required arguments: " + args.join(', ')) || this;
|
|
1110
|
-
_this.args = args;
|
|
1111
|
-
_this.arguments = args;
|
|
1112
|
-
return _this;
|
|
1113
|
-
}
|
|
1114
|
-
return RequiredArgumentError;
|
|
1117
|
+
var RequiredArgumentError = /** @class */ (function (_super) {
|
|
1118
|
+
__extends(RequiredArgumentError, _super);
|
|
1119
|
+
function RequiredArgumentError(args) {
|
|
1120
|
+
var _this = _super.call(this, "Required arguments: " + args.join(', ')) || this;
|
|
1121
|
+
_this.args = args;
|
|
1122
|
+
_this.arguments = args;
|
|
1123
|
+
return _this;
|
|
1124
|
+
}
|
|
1125
|
+
return RequiredArgumentError;
|
|
1115
1126
|
}(Error));
|
|
1116
1127
|
|
|
1117
|
-
var NotFoundError = /** @class */ (function (_super) {
|
|
1118
|
-
__extends(NotFoundError, _super);
|
|
1119
|
-
function NotFoundError(message) {
|
|
1120
|
-
var _this = _super.call(this, message) || this;
|
|
1121
|
-
_this.message = message;
|
|
1122
|
-
return _this;
|
|
1123
|
-
}
|
|
1124
|
-
return NotFoundError;
|
|
1128
|
+
var NotFoundError = /** @class */ (function (_super) {
|
|
1129
|
+
__extends(NotFoundError, _super);
|
|
1130
|
+
function NotFoundError(message) {
|
|
1131
|
+
var _this = _super.call(this, message) || this;
|
|
1132
|
+
_this.message = message;
|
|
1133
|
+
return _this;
|
|
1134
|
+
}
|
|
1135
|
+
return NotFoundError;
|
|
1125
1136
|
}(Error));
|
|
1126
1137
|
|
|
1127
|
-
var DuplicatedResultsError = /** @class */ (function (_super) {
|
|
1128
|
-
__extends(DuplicatedResultsError, _super);
|
|
1129
|
-
function DuplicatedResultsError(message) {
|
|
1130
|
-
var _this = _super.call(this, message) || this;
|
|
1131
|
-
_this.message = message;
|
|
1132
|
-
return _this;
|
|
1133
|
-
}
|
|
1134
|
-
return DuplicatedResultsError;
|
|
1138
|
+
var DuplicatedResultsError = /** @class */ (function (_super) {
|
|
1139
|
+
__extends(DuplicatedResultsError, _super);
|
|
1140
|
+
function DuplicatedResultsError(message) {
|
|
1141
|
+
var _this = _super.call(this, message) || this;
|
|
1142
|
+
_this.message = message;
|
|
1143
|
+
return _this;
|
|
1144
|
+
}
|
|
1145
|
+
return DuplicatedResultsError;
|
|
1135
1146
|
}(Error));
|
|
1136
1147
|
|
|
1137
|
-
var withFirestore = function (MixinBase) {
|
|
1138
|
-
return /** @class */ (function (_super) {
|
|
1139
|
-
__extends(class_1, _super);
|
|
1140
|
-
function class_1() {
|
|
1141
|
-
var args = [];
|
|
1142
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1143
|
-
args[_i] = arguments[_i];
|
|
1144
|
-
}
|
|
1145
|
-
return _super.call(this, args) || this;
|
|
1146
|
-
}
|
|
1147
|
-
class_1.prototype.collection = function (path) {
|
|
1148
|
-
return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
|
|
1149
|
-
};
|
|
1150
|
-
class_1.prototype.buildModelInstance = function () {
|
|
1151
|
-
var _this = this;
|
|
1152
|
-
return {
|
|
1153
|
-
toFirestore: function (data) { return ((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data); },
|
|
1154
|
-
fromFirestore: function (snap) {
|
|
1155
|
-
var data = snap.data();
|
|
1156
|
-
Object.keys(data).forEach(function (key) {
|
|
1157
|
-
if (data[key] instanceof firebase__default["default"].firestore.Timestamp) {
|
|
1158
|
-
data[key] = data[key].toDate();
|
|
1159
|
-
}
|
|
1160
|
-
});
|
|
1161
|
-
return _this.model.toInstance(Object.assign({ id: snap.id }, data));
|
|
1162
|
-
},
|
|
1163
|
-
};
|
|
1164
|
-
};
|
|
1165
|
-
return class_1;
|
|
1166
|
-
}(MixinBase));
|
|
1148
|
+
var withFirestore = function (MixinBase) {
|
|
1149
|
+
return /** @class */ (function (_super) {
|
|
1150
|
+
__extends(class_1, _super);
|
|
1151
|
+
function class_1() {
|
|
1152
|
+
var args = [];
|
|
1153
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1154
|
+
args[_i] = arguments[_i];
|
|
1155
|
+
}
|
|
1156
|
+
return _super.call(this, args) || this;
|
|
1157
|
+
}
|
|
1158
|
+
class_1.prototype.collection = function (path) {
|
|
1159
|
+
return this.firestore.collection(path || this.collectionName).withConverter(this.buildModelInstance());
|
|
1160
|
+
};
|
|
1161
|
+
class_1.prototype.buildModelInstance = function () {
|
|
1162
|
+
var _this = this;
|
|
1163
|
+
return {
|
|
1164
|
+
toFirestore: function (data) { return ((data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data); },
|
|
1165
|
+
fromFirestore: function (snap) {
|
|
1166
|
+
var data = snap.data();
|
|
1167
|
+
Object.keys(data).forEach(function (key) {
|
|
1168
|
+
if (data[key] instanceof firebase__default["default"].firestore.Timestamp) {
|
|
1169
|
+
data[key] = data[key].toDate();
|
|
1170
|
+
}
|
|
1171
|
+
});
|
|
1172
|
+
return _this.model.toInstance(Object.assign({ id: snap.id }, data));
|
|
1173
|
+
},
|
|
1174
|
+
};
|
|
1175
|
+
};
|
|
1176
|
+
return class_1;
|
|
1177
|
+
}(MixinBase));
|
|
1167
1178
|
};
|
|
1168
1179
|
|
|
1169
|
-
var withHelpers = function (MixinBase) {
|
|
1170
|
-
return /** @class */ (function (_super) {
|
|
1171
|
-
__extends(class_1, _super);
|
|
1172
|
-
function class_1() {
|
|
1173
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1174
|
-
}
|
|
1175
|
-
class_1.prototype.toArray = function (snapShot) {
|
|
1176
|
-
if (Array.isArray(snapShot)) {
|
|
1177
|
-
return snapShot.map(function (doc) { return doc.data(); });
|
|
1178
|
-
}
|
|
1179
|
-
else {
|
|
1180
|
-
return snapShot.docs.map(function (doc) { return doc.data(); });
|
|
1181
|
-
}
|
|
1182
|
-
};
|
|
1183
|
-
class_1.prototype.isSubCollection = function (repository) {
|
|
1184
|
-
return !lodash.isNil(Object.keys(this).find(function (key) { return key === 'parentRepository'; }));
|
|
1185
|
-
};
|
|
1186
|
-
return class_1;
|
|
1187
|
-
}(MixinBase));
|
|
1180
|
+
var withHelpers = function (MixinBase) {
|
|
1181
|
+
return /** @class */ (function (_super) {
|
|
1182
|
+
__extends(class_1, _super);
|
|
1183
|
+
function class_1() {
|
|
1184
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1185
|
+
}
|
|
1186
|
+
class_1.prototype.toArray = function (snapShot) {
|
|
1187
|
+
if (Array.isArray(snapShot)) {
|
|
1188
|
+
return snapShot.map(function (doc) { return doc.data(); });
|
|
1189
|
+
}
|
|
1190
|
+
else {
|
|
1191
|
+
return snapShot.docs.map(function (doc) { return doc.data(); });
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
class_1.prototype.isSubCollection = function (repository) {
|
|
1195
|
+
return !lodash.isNil(Object.keys(this).find(function (key) { return key === 'parentRepository'; }));
|
|
1196
|
+
};
|
|
1197
|
+
return class_1;
|
|
1198
|
+
}(MixinBase));
|
|
1188
1199
|
};
|
|
1189
1200
|
|
|
1190
|
-
var withGetFirestore = function (MixinBase) {
|
|
1191
|
-
return /** @class */ (function (_super) {
|
|
1192
|
-
__extends(GetFirestore, _super);
|
|
1193
|
-
function GetFirestore() {
|
|
1194
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1195
|
-
}
|
|
1196
|
-
GetFirestore.prototype.get = function (identifiers) {
|
|
1197
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1198
|
-
var doc, data;
|
|
1199
|
-
return __generator(this, function (_a) {
|
|
1200
|
-
switch (_a.label) {
|
|
1201
|
-
case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForGet(identifiers))
|
|
1202
|
-
.doc(Object.values(identifiers).shift().toString())
|
|
1203
|
-
.get()];
|
|
1204
|
-
case 1:
|
|
1205
|
-
doc = _a.sent();
|
|
1206
|
-
data = doc.data();
|
|
1207
|
-
if (lodash.isNil(data))
|
|
1208
|
-
throw new NotFoundError("Document " + JSON.stringify(identifiers) + " not found");
|
|
1209
|
-
return [2 /*return*/, data];
|
|
1210
|
-
}
|
|
1211
|
-
});
|
|
1212
|
-
});
|
|
1213
|
-
};
|
|
1214
|
-
GetFirestore.prototype.buildCollectionPathForGet = function (identifiers) {
|
|
1215
|
-
return this.isSubCollection(this)
|
|
1216
|
-
? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
|
|
1217
|
-
: this.collectionName;
|
|
1218
|
-
};
|
|
1219
|
-
return GetFirestore;
|
|
1220
|
-
}(MixinBase));
|
|
1201
|
+
var withGetFirestore = function (MixinBase) {
|
|
1202
|
+
return /** @class */ (function (_super) {
|
|
1203
|
+
__extends(GetFirestore, _super);
|
|
1204
|
+
function GetFirestore() {
|
|
1205
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1206
|
+
}
|
|
1207
|
+
GetFirestore.prototype.get = function (identifiers) {
|
|
1208
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1209
|
+
var doc, data;
|
|
1210
|
+
return __generator(this, function (_a) {
|
|
1211
|
+
switch (_a.label) {
|
|
1212
|
+
case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForGet(identifiers))
|
|
1213
|
+
.doc(Object.values(identifiers).shift().toString())
|
|
1214
|
+
.get()];
|
|
1215
|
+
case 1:
|
|
1216
|
+
doc = _a.sent();
|
|
1217
|
+
data = doc.data();
|
|
1218
|
+
if (lodash.isNil(data))
|
|
1219
|
+
throw new NotFoundError("Document " + JSON.stringify(identifiers) + " not found");
|
|
1220
|
+
return [2 /*return*/, data];
|
|
1221
|
+
}
|
|
1222
|
+
});
|
|
1223
|
+
});
|
|
1224
|
+
};
|
|
1225
|
+
GetFirestore.prototype.buildCollectionPathForGet = function (identifiers) {
|
|
1226
|
+
return this.isSubCollection(this)
|
|
1227
|
+
? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
|
|
1228
|
+
: this.collectionName;
|
|
1229
|
+
};
|
|
1230
|
+
return GetFirestore;
|
|
1231
|
+
}(MixinBase));
|
|
1221
1232
|
};
|
|
1222
1233
|
|
|
1223
|
-
var withFindFirestore = function (MixinBase) {
|
|
1224
|
-
var checkIfIsFilterOption = function (filter) { return !lodash.isNil(filter === null || filter === void 0 ? void 0 : filter.operator); };
|
|
1225
|
-
var getValueFromFilter = function (filter) {
|
|
1226
|
-
return checkIfIsFilterOption(filter) ? filter.value : filter;
|
|
1227
|
-
};
|
|
1228
|
-
return /** @class */ (function (_super) {
|
|
1229
|
-
__extends(FindFirestore, _super);
|
|
1230
|
-
function FindFirestore() {
|
|
1231
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1232
|
-
_this.makeFirestoreWhere = function (queryReference, filter) { return Object.keys(filter).reduce(function (query, fieldName) { return _this.buildWhereSentence(query, fieldName, filter[fieldName]); }, queryReference); };
|
|
1233
|
-
_this.buildWhereSentence = function (queryReference, fieldName, options) {
|
|
1234
|
-
if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
|
|
1235
|
-
return queryReference;
|
|
1236
|
-
if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.LIKE) {
|
|
1237
|
-
queryReference = queryReference.where(fieldName.toString(), '>=', options.value);
|
|
1238
|
-
queryReference = queryReference.where(fieldName.toString(), '<=', options.value + "~");
|
|
1239
|
-
return queryReference;
|
|
1240
|
-
}
|
|
1241
|
-
if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1242
|
-
return queryReference.where(fieldName.toString(), 'array-contains-any', options.value);
|
|
1243
|
-
if (lodash.isObject(options) && lodash.isNil(options === null || options === void 0 ? void 0 : options.operator) && lodash.isNil(options === null || options === void 0 ? void 0 : options.value))
|
|
1244
|
-
return Object.keys(options).reduce(function (queryReferenceWithWhere, key) { return _this.buildWhereSentence(queryReferenceWithWhere, fieldName + "." + key, options[key]); }, queryReference);
|
|
1245
|
-
return queryReference.where(fieldName.toString(), (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
|
|
1246
|
-
};
|
|
1247
|
-
return _this;
|
|
1248
|
-
}
|
|
1249
|
-
FindFirestore.prototype.find = function (filters, limits, orderBy) {
|
|
1250
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1251
|
-
var query, docs, data;
|
|
1252
|
-
var _this = this;
|
|
1253
|
-
return __generator(this, function (_b) {
|
|
1254
|
-
switch (_b.label) {
|
|
1255
|
-
case 0:
|
|
1256
|
-
query = this.collection(this.buildCollectionPathForFind(filters));
|
|
1257
|
-
filters === null || filters === void 0 ? void 0 : filters.forEach(function (filterer) { return (query = _this.makeFirestoreWhere(query, filterer)); });
|
|
1258
|
-
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])); }); });
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1234
|
+
var withFindFirestore = function (MixinBase) {
|
|
1235
|
+
var checkIfIsFilterOption = function (filter) { return !lodash.isNil(filter === null || filter === void 0 ? void 0 : filter.operator); };
|
|
1236
|
+
var getValueFromFilter = function (filter) {
|
|
1237
|
+
return checkIfIsFilterOption(filter) ? filter.value : filter;
|
|
1238
|
+
};
|
|
1239
|
+
return /** @class */ (function (_super) {
|
|
1240
|
+
__extends(FindFirestore, _super);
|
|
1241
|
+
function FindFirestore() {
|
|
1242
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1243
|
+
_this.makeFirestoreWhere = function (queryReference, filter) { return Object.keys(filter).reduce(function (query, fieldName) { return _this.buildWhereSentence(query, fieldName, filter[fieldName]); }, queryReference); };
|
|
1244
|
+
_this.buildWhereSentence = function (queryReference, fieldName, options) {
|
|
1245
|
+
if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
|
|
1246
|
+
return queryReference;
|
|
1247
|
+
if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.LIKE) {
|
|
1248
|
+
queryReference = queryReference.where(fieldName.toString(), '>=', options.value);
|
|
1249
|
+
queryReference = queryReference.where(fieldName.toString(), '<=', options.value + "~");
|
|
1250
|
+
return queryReference;
|
|
1251
|
+
}
|
|
1252
|
+
if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1253
|
+
return queryReference.where(fieldName.toString(), 'array-contains-any', options.value);
|
|
1254
|
+
if (lodash.isObject(options) && lodash.isNil(options === null || options === void 0 ? void 0 : options.operator) && lodash.isNil(options === null || options === void 0 ? void 0 : options.value))
|
|
1255
|
+
return Object.keys(options).reduce(function (queryReferenceWithWhere, key) { return _this.buildWhereSentence(queryReferenceWithWhere, fieldName + "." + key, options[key]); }, queryReference);
|
|
1256
|
+
return queryReference.where(fieldName.toString(), (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
|
|
1257
|
+
};
|
|
1258
|
+
return _this;
|
|
1259
|
+
}
|
|
1260
|
+
FindFirestore.prototype.find = function (filters, limits, orderBy) {
|
|
1261
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1262
|
+
var query, docs, data;
|
|
1263
|
+
var _this = this;
|
|
1264
|
+
return __generator(this, function (_b) {
|
|
1265
|
+
switch (_b.label) {
|
|
1266
|
+
case 0:
|
|
1267
|
+
query = this.collection(this.buildCollectionPathForFind(filters));
|
|
1268
|
+
filters === null || filters === void 0 ? void 0 : filters.forEach(function (filterer) { return (query = _this.makeFirestoreWhere(query, filterer)); });
|
|
1269
|
+
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])); }); });
|
|
1270
|
+
return [4 /*yield*/, this.defineLimits(query, filters, limits)];
|
|
1271
|
+
case 1:
|
|
1272
|
+
query = _b.sent();
|
|
1273
|
+
return [4 /*yield*/, query.get()];
|
|
1274
|
+
case 2:
|
|
1275
|
+
docs = _b.sent();
|
|
1276
|
+
data = docs.docs.map(function (doc) { return doc.data(); });
|
|
1277
|
+
return [2 /*return*/, {
|
|
1278
|
+
data: data,
|
|
1279
|
+
count: this.calculateCount(data, limits),
|
|
1280
|
+
}];
|
|
1281
|
+
}
|
|
1282
|
+
});
|
|
1283
|
+
});
|
|
1284
|
+
};
|
|
1285
|
+
FindFirestore.prototype.buildCollectionPathForFind = function (filters) {
|
|
1286
|
+
var _a;
|
|
1287
|
+
if (!this.isSubCollection(this))
|
|
1288
|
+
return this.collectionName;
|
|
1289
|
+
var parentIdField = this.parentIdField;
|
|
1290
|
+
var parentId = getValueFromFilter((_a = filters.find(function (groupFilter) { return Boolean(getValueFromFilter(groupFilter[parentIdField])); })) === null || _a === void 0 ? void 0 : _a[parentIdField]);
|
|
1291
|
+
return this.parentRepository.collectionName + "/" + parentId + "/" + this.collectionName;
|
|
1292
|
+
};
|
|
1293
|
+
FindFirestore.prototype.defineLimits = function (query, filters, limits) {
|
|
1294
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1295
|
+
var _b, _c;
|
|
1296
|
+
return __generator(this, function (_d) {
|
|
1297
|
+
switch (_d.label) {
|
|
1298
|
+
case 0:
|
|
1299
|
+
if (!(limits === null || limits === void 0 ? void 0 : limits.offset)) return [3 /*break*/, 3];
|
|
1300
|
+
if (!(limits.offset instanceof this.model)) return [3 /*break*/, 2];
|
|
1301
|
+
_c = (_b = query).startAfter;
|
|
1302
|
+
return [4 /*yield*/, this.collection(this.buildCollectionPathForFind(filters))
|
|
1303
|
+
.doc(limits.offset[limits.offset.identifierFields().shift()])
|
|
1304
|
+
.get()];
|
|
1305
|
+
case 1:
|
|
1306
|
+
query = _c.apply(_b, [_d.sent()]);
|
|
1307
|
+
return [3 /*break*/, 3];
|
|
1308
|
+
case 2:
|
|
1309
|
+
if (lodash.isNumber(limits.offset) || lodash.isString(limits.offset))
|
|
1310
|
+
query = query.startAt(limits.offset);
|
|
1311
|
+
_d.label = 3;
|
|
1312
|
+
case 3:
|
|
1313
|
+
if (limits === null || limits === void 0 ? void 0 : limits.limit)
|
|
1314
|
+
query = query.limit(limits.limit);
|
|
1315
|
+
return [2 /*return*/, query];
|
|
1316
|
+
}
|
|
1317
|
+
});
|
|
1318
|
+
});
|
|
1319
|
+
};
|
|
1320
|
+
FindFirestore.prototype.calculateCount = function (data, limits) {
|
|
1321
|
+
if (data.length <= 0)
|
|
1322
|
+
return 0;
|
|
1323
|
+
if (data.length < (limits === null || limits === void 0 ? void 0 : limits.limit))
|
|
1324
|
+
return data.length;
|
|
1325
|
+
return Infinity;
|
|
1326
|
+
};
|
|
1327
|
+
return FindFirestore;
|
|
1328
|
+
}(MixinBase));
|
|
1300
1329
|
};
|
|
1301
1330
|
|
|
1302
|
-
var withCreateFirestore = function (MixinBase) {
|
|
1303
|
-
return /** @class */ (function (_super) {
|
|
1304
|
-
__extends(CreateFirestore, _super);
|
|
1305
|
-
function CreateFirestore() {
|
|
1306
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1307
|
-
}
|
|
1308
|
-
CreateFirestore.prototype.create = function (data) {
|
|
1309
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1310
|
-
var docRef, doc;
|
|
1311
|
-
return __generator(this, function (_b) {
|
|
1312
|
-
switch (_b.label) {
|
|
1313
|
-
case 0: return [4 /*yield*/, this.save(this.model.toInstance(data))];
|
|
1314
|
-
case 1:
|
|
1315
|
-
docRef = _b.sent();
|
|
1316
|
-
return [4 /*yield*/, docRef.get()];
|
|
1317
|
-
case 2:
|
|
1318
|
-
doc = _b.sent();
|
|
1319
|
-
return [2 /*return*/, doc.data()];
|
|
1320
|
-
}
|
|
1321
|
-
});
|
|
1322
|
-
});
|
|
1323
|
-
};
|
|
1324
|
-
CreateFirestore.prototype.save = function (data) {
|
|
1325
|
-
var _a;
|
|
1326
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1327
|
-
var id, docRef;
|
|
1328
|
-
return __generator(this, function (_b) {
|
|
1329
|
-
switch (_b.label) {
|
|
1330
|
-
case 0:
|
|
1331
|
-
id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
|
|
1332
|
-
if (lodash.isEmpty(id))
|
|
1333
|
-
return [2 /*return*/, this.collection(this.buildCollectionPathForAdd(data)).add(data)];
|
|
1334
|
-
docRef = this.collection().doc(id);
|
|
1335
|
-
return [4 /*yield*/, docRef.set(data)];
|
|
1336
|
-
case 1:
|
|
1337
|
-
_b.sent();
|
|
1338
|
-
return [2 /*return*/, docRef];
|
|
1339
|
-
}
|
|
1340
|
-
});
|
|
1341
|
-
});
|
|
1342
|
-
};
|
|
1343
|
-
CreateFirestore.prototype.buildCollectionPathForAdd = function (identifiers) {
|
|
1344
|
-
return this.isSubCollection(this)
|
|
1345
|
-
? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
|
|
1346
|
-
: this.collectionName;
|
|
1347
|
-
};
|
|
1348
|
-
return CreateFirestore;
|
|
1349
|
-
}(MixinBase));
|
|
1331
|
+
var withCreateFirestore = function (MixinBase) {
|
|
1332
|
+
return /** @class */ (function (_super) {
|
|
1333
|
+
__extends(CreateFirestore, _super);
|
|
1334
|
+
function CreateFirestore() {
|
|
1335
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1336
|
+
}
|
|
1337
|
+
CreateFirestore.prototype.create = function (data) {
|
|
1338
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1339
|
+
var docRef, doc;
|
|
1340
|
+
return __generator(this, function (_b) {
|
|
1341
|
+
switch (_b.label) {
|
|
1342
|
+
case 0: return [4 /*yield*/, this.save(this.model.toInstance(data))];
|
|
1343
|
+
case 1:
|
|
1344
|
+
docRef = _b.sent();
|
|
1345
|
+
return [4 /*yield*/, docRef.get()];
|
|
1346
|
+
case 2:
|
|
1347
|
+
doc = _b.sent();
|
|
1348
|
+
return [2 /*return*/, doc.data()];
|
|
1349
|
+
}
|
|
1350
|
+
});
|
|
1351
|
+
});
|
|
1352
|
+
};
|
|
1353
|
+
CreateFirestore.prototype.save = function (data) {
|
|
1354
|
+
var _a;
|
|
1355
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1356
|
+
var id, docRef;
|
|
1357
|
+
return __generator(this, function (_b) {
|
|
1358
|
+
switch (_b.label) {
|
|
1359
|
+
case 0:
|
|
1360
|
+
id = (_a = data[data.identifierFields().shift()]) === null || _a === void 0 ? void 0 : _a.toString();
|
|
1361
|
+
if (lodash.isEmpty(id))
|
|
1362
|
+
return [2 /*return*/, this.collection(this.buildCollectionPathForAdd(data)).add(data)];
|
|
1363
|
+
docRef = this.collection().doc(id);
|
|
1364
|
+
return [4 /*yield*/, docRef.set(data)];
|
|
1365
|
+
case 1:
|
|
1366
|
+
_b.sent();
|
|
1367
|
+
return [2 /*return*/, docRef];
|
|
1368
|
+
}
|
|
1369
|
+
});
|
|
1370
|
+
});
|
|
1371
|
+
};
|
|
1372
|
+
CreateFirestore.prototype.buildCollectionPathForAdd = function (identifiers) {
|
|
1373
|
+
return this.isSubCollection(this)
|
|
1374
|
+
? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
|
|
1375
|
+
: this.collectionName;
|
|
1376
|
+
};
|
|
1377
|
+
return CreateFirestore;
|
|
1378
|
+
}(MixinBase));
|
|
1350
1379
|
};
|
|
1351
1380
|
|
|
1352
|
-
var withUpdateFirestore = function (MixinBase) {
|
|
1353
|
-
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; };
|
|
1354
|
-
var getValueByAction = function (options) {
|
|
1355
|
-
var fieldValues = firebase__default["default"].firestore.FieldValue;
|
|
1356
|
-
if (lodash.isNil(options.action))
|
|
1357
|
-
return options;
|
|
1358
|
-
if (options.action === exports.UpdateOptionActions.REMOVE_FIELD)
|
|
1359
|
-
return fieldValues.delete();
|
|
1360
|
-
if (Array.isArray(options.value)) {
|
|
1361
|
-
if (options.action === exports.UpdateOptionActions.MERGE)
|
|
1362
|
-
return fieldValues.arrayUnion.apply(fieldValues, __spreadArray([], __read(options.value)));
|
|
1363
|
-
if (options.action === exports.UpdateOptionActions.REMOVE)
|
|
1364
|
-
return fieldValues.arrayRemove.apply(fieldValues, __spreadArray([], __read(options.value)));
|
|
1365
|
-
}
|
|
1366
|
-
return options.value;
|
|
1367
|
-
};
|
|
1368
|
-
return /** @class */ (function (_super) {
|
|
1369
|
-
__extends(UpdateFirestore, _super);
|
|
1370
|
-
function UpdateFirestore() {
|
|
1371
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1372
|
-
}
|
|
1373
|
-
UpdateFirestore.prototype.update = function (data) {
|
|
1374
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1375
|
-
var model, keyField, docRef, doc;
|
|
1376
|
-
return __generator(this, function (_b) {
|
|
1377
|
-
switch (_b.label) {
|
|
1378
|
-
case 0:
|
|
1379
|
-
model = new this.model();
|
|
1380
|
-
keyField = model.identifierFields().shift();
|
|
1381
|
-
docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
|
|
1382
|
-
return [4 /*yield*/, docRef.set(this.paramsToPlain(data), { merge: true })];
|
|
1383
|
-
case 1:
|
|
1384
|
-
_b.sent();
|
|
1385
|
-
return [4 /*yield*/, docRef.get()];
|
|
1386
|
-
case 2:
|
|
1387
|
-
doc = _b.sent();
|
|
1388
|
-
return [2 /*return*/, doc.data()];
|
|
1389
|
-
}
|
|
1390
|
-
});
|
|
1391
|
-
});
|
|
1392
|
-
};
|
|
1393
|
-
UpdateFirestore.prototype.buildCollectionPathForUpdate = function (identifiers) {
|
|
1394
|
-
return this.isSubCollection(this)
|
|
1395
|
-
? this.parentRepository.collectionName + "/" + getValueFromParams(identifiers, this.parentIdField) + "/" + this.collectionName
|
|
1396
|
-
: this.collectionName;
|
|
1397
|
-
};
|
|
1398
|
-
UpdateFirestore.prototype.paramsToPlain = function (params) {
|
|
1399
|
-
var model = this.model;
|
|
1400
|
-
if (params instanceof model)
|
|
1401
|
-
return params;
|
|
1402
|
-
return Object.keys(params).reduce(function (data, currentKey) {
|
|
1403
|
-
var _b;
|
|
1404
|
-
return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
|
|
1405
|
-
}, {});
|
|
1406
|
-
};
|
|
1407
|
-
return UpdateFirestore;
|
|
1408
|
-
}(MixinBase));
|
|
1381
|
+
var withUpdateFirestore = function (MixinBase) {
|
|
1382
|
+
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; };
|
|
1383
|
+
var getValueByAction = function (options) {
|
|
1384
|
+
var fieldValues = firebase__default["default"].firestore.FieldValue;
|
|
1385
|
+
if (lodash.isNil(options.action))
|
|
1386
|
+
return options;
|
|
1387
|
+
if (options.action === exports.UpdateOptionActions.REMOVE_FIELD)
|
|
1388
|
+
return fieldValues.delete();
|
|
1389
|
+
if (Array.isArray(options.value)) {
|
|
1390
|
+
if (options.action === exports.UpdateOptionActions.MERGE)
|
|
1391
|
+
return fieldValues.arrayUnion.apply(fieldValues, __spreadArray([], __read(options.value)));
|
|
1392
|
+
if (options.action === exports.UpdateOptionActions.REMOVE)
|
|
1393
|
+
return fieldValues.arrayRemove.apply(fieldValues, __spreadArray([], __read(options.value)));
|
|
1394
|
+
}
|
|
1395
|
+
return options.value;
|
|
1396
|
+
};
|
|
1397
|
+
return /** @class */ (function (_super) {
|
|
1398
|
+
__extends(UpdateFirestore, _super);
|
|
1399
|
+
function UpdateFirestore() {
|
|
1400
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1401
|
+
}
|
|
1402
|
+
UpdateFirestore.prototype.update = function (data) {
|
|
1403
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1404
|
+
var model, keyField, docRef, doc;
|
|
1405
|
+
return __generator(this, function (_b) {
|
|
1406
|
+
switch (_b.label) {
|
|
1407
|
+
case 0:
|
|
1408
|
+
model = new this.model();
|
|
1409
|
+
keyField = model.identifierFields().shift();
|
|
1410
|
+
docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
|
|
1411
|
+
return [4 /*yield*/, docRef.set(this.paramsToPlain(data), { merge: true })];
|
|
1412
|
+
case 1:
|
|
1413
|
+
_b.sent();
|
|
1414
|
+
return [4 /*yield*/, docRef.get()];
|
|
1415
|
+
case 2:
|
|
1416
|
+
doc = _b.sent();
|
|
1417
|
+
return [2 /*return*/, doc.data()];
|
|
1418
|
+
}
|
|
1419
|
+
});
|
|
1420
|
+
});
|
|
1421
|
+
};
|
|
1422
|
+
UpdateFirestore.prototype.buildCollectionPathForUpdate = function (identifiers) {
|
|
1423
|
+
return this.isSubCollection(this)
|
|
1424
|
+
? this.parentRepository.collectionName + "/" + getValueFromParams(identifiers, this.parentIdField) + "/" + this.collectionName
|
|
1425
|
+
: this.collectionName;
|
|
1426
|
+
};
|
|
1427
|
+
UpdateFirestore.prototype.paramsToPlain = function (params) {
|
|
1428
|
+
var model = this.model;
|
|
1429
|
+
if (params instanceof model)
|
|
1430
|
+
return params;
|
|
1431
|
+
return Object.keys(params).reduce(function (data, currentKey) {
|
|
1432
|
+
var _b;
|
|
1433
|
+
return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
|
|
1434
|
+
}, {});
|
|
1435
|
+
};
|
|
1436
|
+
return UpdateFirestore;
|
|
1437
|
+
}(MixinBase));
|
|
1409
1438
|
};
|
|
1410
1439
|
|
|
1411
|
-
var withDeleteFirestore = function (MixinBase) {
|
|
1412
|
-
return /** @class */ (function (_super) {
|
|
1413
|
-
__extends(DeleteFirestore, _super);
|
|
1414
|
-
function DeleteFirestore() {
|
|
1415
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1416
|
-
}
|
|
1417
|
-
DeleteFirestore.prototype.delete = function (identifiers) {
|
|
1418
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1419
|
-
return __generator(this, function (_a) {
|
|
1420
|
-
switch (_a.label) {
|
|
1421
|
-
case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForRemove(identifiers))
|
|
1422
|
-
.doc(Object.values(identifiers).shift().toString())
|
|
1423
|
-
.delete()];
|
|
1424
|
-
case 1:
|
|
1425
|
-
_a.sent();
|
|
1426
|
-
return [2 /*return*/];
|
|
1427
|
-
}
|
|
1428
|
-
});
|
|
1429
|
-
});
|
|
1430
|
-
};
|
|
1431
|
-
DeleteFirestore.prototype.buildCollectionPathForRemove = function (identifiers) {
|
|
1432
|
-
return this.isSubCollection(this)
|
|
1433
|
-
? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
|
|
1434
|
-
: this.collectionName;
|
|
1435
|
-
};
|
|
1436
|
-
return DeleteFirestore;
|
|
1437
|
-
}(MixinBase));
|
|
1440
|
+
var withDeleteFirestore = function (MixinBase) {
|
|
1441
|
+
return /** @class */ (function (_super) {
|
|
1442
|
+
__extends(DeleteFirestore, _super);
|
|
1443
|
+
function DeleteFirestore() {
|
|
1444
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1445
|
+
}
|
|
1446
|
+
DeleteFirestore.prototype.delete = function (identifiers) {
|
|
1447
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1448
|
+
return __generator(this, function (_a) {
|
|
1449
|
+
switch (_a.label) {
|
|
1450
|
+
case 0: return [4 /*yield*/, this.collection(this.buildCollectionPathForRemove(identifiers))
|
|
1451
|
+
.doc(Object.values(identifiers).shift().toString())
|
|
1452
|
+
.delete()];
|
|
1453
|
+
case 1:
|
|
1454
|
+
_a.sent();
|
|
1455
|
+
return [2 /*return*/];
|
|
1456
|
+
}
|
|
1457
|
+
});
|
|
1458
|
+
});
|
|
1459
|
+
};
|
|
1460
|
+
DeleteFirestore.prototype.buildCollectionPathForRemove = function (identifiers) {
|
|
1461
|
+
return this.isSubCollection(this)
|
|
1462
|
+
? this.parentRepository.collectionName + "/" + identifiers[this.parentIdField] + "/" + this.collectionName
|
|
1463
|
+
: this.collectionName;
|
|
1464
|
+
};
|
|
1465
|
+
return DeleteFirestore;
|
|
1466
|
+
}(MixinBase));
|
|
1438
1467
|
};
|
|
1439
1468
|
|
|
1440
|
-
var withSubCollection = function (MixinBase, ParentModel) {
|
|
1441
|
-
return /** @class */ (function (_super) {
|
|
1442
|
-
__extends(SubCollectionMix, _super);
|
|
1443
|
-
function SubCollectionMix() {
|
|
1444
|
-
var args = [];
|
|
1445
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1446
|
-
args[_i] = arguments[_i];
|
|
1447
|
-
}
|
|
1448
|
-
return _super.call(this, args) || this;
|
|
1449
|
-
}
|
|
1450
|
-
SubCollectionMix.prototype.collection = function (path) {
|
|
1451
|
-
return _super.prototype.collection.call(this, path);
|
|
1452
|
-
};
|
|
1453
|
-
return SubCollectionMix;
|
|
1454
|
-
}(MixinBase));
|
|
1469
|
+
var withSubCollection = function (MixinBase, ParentModel) {
|
|
1470
|
+
return /** @class */ (function (_super) {
|
|
1471
|
+
__extends(SubCollectionMix, _super);
|
|
1472
|
+
function SubCollectionMix() {
|
|
1473
|
+
var args = [];
|
|
1474
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1475
|
+
args[_i] = arguments[_i];
|
|
1476
|
+
}
|
|
1477
|
+
return _super.call(this, args) || this;
|
|
1478
|
+
}
|
|
1479
|
+
SubCollectionMix.prototype.collection = function (path) {
|
|
1480
|
+
return _super.prototype.collection.call(this, path);
|
|
1481
|
+
};
|
|
1482
|
+
return SubCollectionMix;
|
|
1483
|
+
}(MixinBase));
|
|
1455
1484
|
};
|
|
1456
1485
|
|
|
1457
|
-
var withCrudFirestore = function (MixinBase) {
|
|
1458
|
-
return /** @class */ (function (_super) {
|
|
1459
|
-
__extends(CrudFirestore, _super);
|
|
1460
|
-
function CrudFirestore() {
|
|
1461
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1462
|
-
}
|
|
1463
|
-
return CrudFirestore;
|
|
1464
|
-
}(withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))))));
|
|
1486
|
+
var withCrudFirestore = function (MixinBase) {
|
|
1487
|
+
return /** @class */ (function (_super) {
|
|
1488
|
+
__extends(CrudFirestore, _super);
|
|
1489
|
+
function CrudFirestore() {
|
|
1490
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1491
|
+
}
|
|
1492
|
+
return CrudFirestore;
|
|
1493
|
+
}(withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))))));
|
|
1465
1494
|
};
|
|
1466
1495
|
|
|
1467
|
-
var SubscriptionFirestoreRepository = /** @class */ (function (_super) {
|
|
1468
|
-
__extends(SubscriptionFirestoreRepository, _super);
|
|
1469
|
-
function SubscriptionFirestoreRepository(firestore) {
|
|
1470
|
-
var _this = _super.call(this) || this;
|
|
1471
|
-
_this.firestore = firestore;
|
|
1472
|
-
_this.collectionName = 'subscription';
|
|
1473
|
-
_this.model = Subscription;
|
|
1474
|
-
return _this;
|
|
1475
|
-
}
|
|
1476
|
-
return SubscriptionFirestoreRepository;
|
|
1496
|
+
var SubscriptionFirestoreRepository = /** @class */ (function (_super) {
|
|
1497
|
+
__extends(SubscriptionFirestoreRepository, _super);
|
|
1498
|
+
function SubscriptionFirestoreRepository(firestore) {
|
|
1499
|
+
var _this = _super.call(this) || this;
|
|
1500
|
+
_this.firestore = firestore;
|
|
1501
|
+
_this.collectionName = 'subscription';
|
|
1502
|
+
_this.model = Subscription;
|
|
1503
|
+
return _this;
|
|
1504
|
+
}
|
|
1505
|
+
return SubscriptionFirestoreRepository;
|
|
1477
1506
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1478
1507
|
|
|
1479
|
-
var UserFirestoreRepository = /** @class */ (function (_super_1) {
|
|
1480
|
-
__extends(UserFirestoreRepository, _super_1);
|
|
1481
|
-
function UserFirestoreRepository(firestore) {
|
|
1482
|
-
var _this = _super_1.call(this) || this;
|
|
1483
|
-
_this.firestore = firestore;
|
|
1484
|
-
_this.collectionName = 'users';
|
|
1485
|
-
_this.model = User;
|
|
1486
|
-
return _this;
|
|
1487
|
-
}
|
|
1488
|
-
UserFirestoreRepository.prototype.get = function (identifiers) {
|
|
1489
|
-
var _super = Object.create(null, {
|
|
1490
|
-
get: { get: function () { return _super_1.prototype.get; } }
|
|
1491
|
-
});
|
|
1492
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1493
|
-
var user, _a, _b;
|
|
1494
|
-
return __generator(this, function (_c) {
|
|
1495
|
-
switch (_c.label) {
|
|
1496
|
-
case 0: return [4 /*yield*/, _super.get.call(this, { id: identifiers.id })];
|
|
1497
|
-
case 1:
|
|
1498
|
-
user = _c.sent();
|
|
1499
|
-
_a = user;
|
|
1500
|
-
return [4 /*yield*/, this.getBeautyProfile(user.id)];
|
|
1501
|
-
case 2:
|
|
1502
|
-
_a.beautyProfile = _c.sent();
|
|
1503
|
-
_b = user;
|
|
1504
|
-
return [4 /*yield*/, this.checkIfIsSubscriber(user.id)];
|
|
1505
|
-
case 3:
|
|
1506
|
-
_b.isSubscriber = _c.sent();
|
|
1507
|
-
return [2 /*return*/, user];
|
|
1508
|
-
}
|
|
1509
|
-
});
|
|
1510
|
-
});
|
|
1511
|
-
};
|
|
1512
|
-
UserFirestoreRepository.prototype.buildModelInstance = function () {
|
|
1513
|
-
var _a = _super_1.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
|
|
1514
|
-
return {
|
|
1515
|
-
toFirestore: function (data) {
|
|
1516
|
-
var plain = toFirestore(data);
|
|
1517
|
-
delete plain.isSubscriber;
|
|
1518
|
-
return plain;
|
|
1519
|
-
},
|
|
1520
|
-
fromFirestore: fromFirestore,
|
|
1521
|
-
};
|
|
1522
|
-
};
|
|
1523
|
-
UserFirestoreRepository.prototype.getBeautyProfile = function (userId) {
|
|
1524
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1525
|
-
var beautyProfile;
|
|
1526
|
-
return __generator(this, function (_a) {
|
|
1527
|
-
switch (_a.label) {
|
|
1528
|
-
case 0: return [4 /*yield*/, this.collection()
|
|
1529
|
-
.doc(userId)
|
|
1530
|
-
.collection('CX')
|
|
1531
|
-
.withConverter(this.buildBeautyProfileModelInstance())
|
|
1532
|
-
.doc('beautyProfile')
|
|
1533
|
-
.get()];
|
|
1534
|
-
case 1:
|
|
1535
|
-
beautyProfile = _a.sent();
|
|
1536
|
-
return [2 /*return*/, beautyProfile.data()];
|
|
1537
|
-
}
|
|
1538
|
-
});
|
|
1539
|
-
});
|
|
1540
|
-
};
|
|
1541
|
-
UserFirestoreRepository.prototype.checkIfIsSubscriber = function (userId) {
|
|
1542
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1543
|
-
var docs;
|
|
1544
|
-
return __generator(this, function (_a) {
|
|
1545
|
-
switch (_a.label) {
|
|
1546
|
-
case 0: return [4 /*yield*/, this.firestore
|
|
1547
|
-
.collection('subscription')
|
|
1548
|
-
.where('user.id', '==', userId)
|
|
1549
|
-
.where('status', '==', 'active')
|
|
1550
|
-
.get()];
|
|
1551
|
-
case 1:
|
|
1552
|
-
docs = _a.sent();
|
|
1553
|
-
return [2 /*return*/, !!docs && !!docs.size];
|
|
1554
|
-
}
|
|
1555
|
-
});
|
|
1556
|
-
});
|
|
1557
|
-
};
|
|
1558
|
-
UserFirestoreRepository.prototype.buildBeautyProfileModelInstance = function () {
|
|
1559
|
-
return {
|
|
1560
|
-
toFirestore: function (data) { return data.toPlain(); },
|
|
1561
|
-
fromFirestore: function (snap) { return BeautyProfile.toInstance(snap.data()); },
|
|
1562
|
-
};
|
|
1563
|
-
};
|
|
1564
|
-
return UserFirestoreRepository;
|
|
1508
|
+
var UserFirestoreRepository = /** @class */ (function (_super_1) {
|
|
1509
|
+
__extends(UserFirestoreRepository, _super_1);
|
|
1510
|
+
function UserFirestoreRepository(firestore) {
|
|
1511
|
+
var _this = _super_1.call(this) || this;
|
|
1512
|
+
_this.firestore = firestore;
|
|
1513
|
+
_this.collectionName = 'users';
|
|
1514
|
+
_this.model = User;
|
|
1515
|
+
return _this;
|
|
1516
|
+
}
|
|
1517
|
+
UserFirestoreRepository.prototype.get = function (identifiers) {
|
|
1518
|
+
var _super = Object.create(null, {
|
|
1519
|
+
get: { get: function () { return _super_1.prototype.get; } }
|
|
1520
|
+
});
|
|
1521
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1522
|
+
var user, _a, _b;
|
|
1523
|
+
return __generator(this, function (_c) {
|
|
1524
|
+
switch (_c.label) {
|
|
1525
|
+
case 0: return [4 /*yield*/, _super.get.call(this, { id: identifiers.id })];
|
|
1526
|
+
case 1:
|
|
1527
|
+
user = _c.sent();
|
|
1528
|
+
_a = user;
|
|
1529
|
+
return [4 /*yield*/, this.getBeautyProfile(user.id)];
|
|
1530
|
+
case 2:
|
|
1531
|
+
_a.beautyProfile = _c.sent();
|
|
1532
|
+
_b = user;
|
|
1533
|
+
return [4 /*yield*/, this.checkIfIsSubscriber(user.id)];
|
|
1534
|
+
case 3:
|
|
1535
|
+
_b.isSubscriber = _c.sent();
|
|
1536
|
+
return [2 /*return*/, user];
|
|
1537
|
+
}
|
|
1538
|
+
});
|
|
1539
|
+
});
|
|
1540
|
+
};
|
|
1541
|
+
UserFirestoreRepository.prototype.buildModelInstance = function () {
|
|
1542
|
+
var _a = _super_1.prototype.buildModelInstance.call(this), fromFirestore = _a.fromFirestore, toFirestore = _a.toFirestore;
|
|
1543
|
+
return {
|
|
1544
|
+
toFirestore: function (data) {
|
|
1545
|
+
var plain = toFirestore(data);
|
|
1546
|
+
delete plain.isSubscriber;
|
|
1547
|
+
return plain;
|
|
1548
|
+
},
|
|
1549
|
+
fromFirestore: fromFirestore,
|
|
1550
|
+
};
|
|
1551
|
+
};
|
|
1552
|
+
UserFirestoreRepository.prototype.getBeautyProfile = function (userId) {
|
|
1553
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1554
|
+
var beautyProfile;
|
|
1555
|
+
return __generator(this, function (_a) {
|
|
1556
|
+
switch (_a.label) {
|
|
1557
|
+
case 0: return [4 /*yield*/, this.collection()
|
|
1558
|
+
.doc(userId)
|
|
1559
|
+
.collection('CX')
|
|
1560
|
+
.withConverter(this.buildBeautyProfileModelInstance())
|
|
1561
|
+
.doc('beautyProfile')
|
|
1562
|
+
.get()];
|
|
1563
|
+
case 1:
|
|
1564
|
+
beautyProfile = _a.sent();
|
|
1565
|
+
return [2 /*return*/, beautyProfile.data()];
|
|
1566
|
+
}
|
|
1567
|
+
});
|
|
1568
|
+
});
|
|
1569
|
+
};
|
|
1570
|
+
UserFirestoreRepository.prototype.checkIfIsSubscriber = function (userId) {
|
|
1571
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1572
|
+
var docs;
|
|
1573
|
+
return __generator(this, function (_a) {
|
|
1574
|
+
switch (_a.label) {
|
|
1575
|
+
case 0: return [4 /*yield*/, this.firestore
|
|
1576
|
+
.collection('subscription')
|
|
1577
|
+
.where('user.id', '==', userId)
|
|
1578
|
+
.where('status', '==', 'active')
|
|
1579
|
+
.get()];
|
|
1580
|
+
case 1:
|
|
1581
|
+
docs = _a.sent();
|
|
1582
|
+
return [2 /*return*/, !!docs && !!docs.size];
|
|
1583
|
+
}
|
|
1584
|
+
});
|
|
1585
|
+
});
|
|
1586
|
+
};
|
|
1587
|
+
UserFirestoreRepository.prototype.buildBeautyProfileModelInstance = function () {
|
|
1588
|
+
return {
|
|
1589
|
+
toFirestore: function (data) { return data.toPlain(); },
|
|
1590
|
+
fromFirestore: function (snap) { return BeautyProfile.toInstance(snap.data()); },
|
|
1591
|
+
};
|
|
1592
|
+
};
|
|
1593
|
+
return UserFirestoreRepository;
|
|
1565
1594
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1566
1595
|
|
|
1567
|
-
var SubscriptionEditionFirestoreRepository = /** @class */ (function (_super) {
|
|
1568
|
-
__extends(SubscriptionEditionFirestoreRepository, _super);
|
|
1569
|
-
function SubscriptionEditionFirestoreRepository(firestore, parentRepository) {
|
|
1570
|
-
var _this = _super.call(this) || this;
|
|
1571
|
-
_this.firestore = firestore;
|
|
1572
|
-
_this.parentRepository = parentRepository;
|
|
1573
|
-
_this.collectionName = 'editions';
|
|
1574
|
-
_this.parentIdField = 'subscriptionId';
|
|
1575
|
-
_this.model = Edition;
|
|
1576
|
-
return _this;
|
|
1577
|
-
}
|
|
1578
|
-
return SubscriptionEditionFirestoreRepository;
|
|
1596
|
+
var SubscriptionEditionFirestoreRepository = /** @class */ (function (_super) {
|
|
1597
|
+
__extends(SubscriptionEditionFirestoreRepository, _super);
|
|
1598
|
+
function SubscriptionEditionFirestoreRepository(firestore, parentRepository) {
|
|
1599
|
+
var _this = _super.call(this) || this;
|
|
1600
|
+
_this.firestore = firestore;
|
|
1601
|
+
_this.parentRepository = parentRepository;
|
|
1602
|
+
_this.collectionName = 'editions';
|
|
1603
|
+
_this.parentIdField = 'subscriptionId';
|
|
1604
|
+
_this.model = Edition;
|
|
1605
|
+
return _this;
|
|
1606
|
+
}
|
|
1607
|
+
return SubscriptionEditionFirestoreRepository;
|
|
1579
1608
|
}(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
|
|
1580
1609
|
|
|
1581
|
-
var UserBeautyProfileFirestoreRepository = /** @class */ (function (_super) {
|
|
1582
|
-
__extends(UserBeautyProfileFirestoreRepository, _super);
|
|
1583
|
-
function UserBeautyProfileFirestoreRepository(firestore, parentRepository) {
|
|
1584
|
-
var _this = _super.call(this) || this;
|
|
1585
|
-
_this.firestore = firestore;
|
|
1586
|
-
_this.parentRepository = parentRepository;
|
|
1587
|
-
_this.collectionName = 'CX';
|
|
1588
|
-
_this.parentIdField = 'userId';
|
|
1589
|
-
_this.model = BeautyProfile;
|
|
1590
|
-
return _this;
|
|
1591
|
-
}
|
|
1592
|
-
return UserBeautyProfileFirestoreRepository;
|
|
1610
|
+
var UserBeautyProfileFirestoreRepository = /** @class */ (function (_super) {
|
|
1611
|
+
__extends(UserBeautyProfileFirestoreRepository, _super);
|
|
1612
|
+
function UserBeautyProfileFirestoreRepository(firestore, parentRepository) {
|
|
1613
|
+
var _this = _super.call(this) || this;
|
|
1614
|
+
_this.firestore = firestore;
|
|
1615
|
+
_this.parentRepository = parentRepository;
|
|
1616
|
+
_this.collectionName = 'CX';
|
|
1617
|
+
_this.parentIdField = 'userId';
|
|
1618
|
+
_this.model = BeautyProfile;
|
|
1619
|
+
return _this;
|
|
1620
|
+
}
|
|
1621
|
+
return UserBeautyProfileFirestoreRepository;
|
|
1593
1622
|
}(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
|
|
1594
1623
|
|
|
1595
|
-
var UserAddressFirestoreRepository = /** @class */ (function (_super) {
|
|
1596
|
-
__extends(UserAddressFirestoreRepository, _super);
|
|
1597
|
-
function UserAddressFirestoreRepository(firestore, parentRepository) {
|
|
1598
|
-
var _this = _super.call(this) || this;
|
|
1599
|
-
_this.firestore = firestore;
|
|
1600
|
-
_this.parentRepository = parentRepository;
|
|
1601
|
-
_this.collectionName = 'address';
|
|
1602
|
-
_this.parentIdField = 'userId';
|
|
1603
|
-
_this.model = UserAddress;
|
|
1604
|
-
return _this;
|
|
1605
|
-
}
|
|
1606
|
-
return UserAddressFirestoreRepository;
|
|
1624
|
+
var UserAddressFirestoreRepository = /** @class */ (function (_super) {
|
|
1625
|
+
__extends(UserAddressFirestoreRepository, _super);
|
|
1626
|
+
function UserAddressFirestoreRepository(firestore, parentRepository) {
|
|
1627
|
+
var _this = _super.call(this) || this;
|
|
1628
|
+
_this.firestore = firestore;
|
|
1629
|
+
_this.parentRepository = parentRepository;
|
|
1630
|
+
_this.collectionName = 'address';
|
|
1631
|
+
_this.parentIdField = 'userId';
|
|
1632
|
+
_this.model = UserAddress;
|
|
1633
|
+
return _this;
|
|
1634
|
+
}
|
|
1635
|
+
return UserAddressFirestoreRepository;
|
|
1607
1636
|
}(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
|
|
1608
1637
|
|
|
1609
|
-
var SubscriptionPaymentFirestoreRepository = /** @class */ (function (_super) {
|
|
1610
|
-
__extends(SubscriptionPaymentFirestoreRepository, _super);
|
|
1611
|
-
function SubscriptionPaymentFirestoreRepository(firestore, parentRepository) {
|
|
1612
|
-
var _this = _super.call(this) || this;
|
|
1613
|
-
_this.firestore = firestore;
|
|
1614
|
-
_this.parentRepository = parentRepository;
|
|
1615
|
-
_this.collectionName = 'Payments';
|
|
1616
|
-
_this.parentIdField = 'subscriptionId';
|
|
1617
|
-
_this.model = SubscriptionPayment;
|
|
1618
|
-
return _this;
|
|
1619
|
-
}
|
|
1620
|
-
return SubscriptionPaymentFirestoreRepository;
|
|
1638
|
+
var SubscriptionPaymentFirestoreRepository = /** @class */ (function (_super) {
|
|
1639
|
+
__extends(SubscriptionPaymentFirestoreRepository, _super);
|
|
1640
|
+
function SubscriptionPaymentFirestoreRepository(firestore, parentRepository) {
|
|
1641
|
+
var _this = _super.call(this) || this;
|
|
1642
|
+
_this.firestore = firestore;
|
|
1643
|
+
_this.parentRepository = parentRepository;
|
|
1644
|
+
_this.collectionName = 'Payments';
|
|
1645
|
+
_this.parentIdField = 'subscriptionId';
|
|
1646
|
+
_this.model = SubscriptionPayment;
|
|
1647
|
+
return _this;
|
|
1648
|
+
}
|
|
1649
|
+
return SubscriptionPaymentFirestoreRepository;
|
|
1621
1650
|
}(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
|
|
1622
1651
|
|
|
1623
|
-
var
|
|
1624
|
-
__extends(
|
|
1625
|
-
function
|
|
1626
|
-
var _this = _super.call(this) || this;
|
|
1627
|
-
_this.firestore = firestore;
|
|
1628
|
-
_this.collectionName = '
|
|
1629
|
-
_this.model =
|
|
1630
|
-
return _this;
|
|
1631
|
-
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
return [
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
case
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
case
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
_b.label =
|
|
1738
|
-
case
|
|
1739
|
-
chunks_1_1
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1652
|
+
var LeadFirestoreRepository = /** @class */ (function (_super) {
|
|
1653
|
+
__extends(LeadFirestoreRepository, _super);
|
|
1654
|
+
function LeadFirestoreRepository(firestore) {
|
|
1655
|
+
var _this = _super.call(this) || this;
|
|
1656
|
+
_this.firestore = firestore;
|
|
1657
|
+
_this.collectionName = 'leads';
|
|
1658
|
+
_this.model = Lead;
|
|
1659
|
+
return _this;
|
|
1660
|
+
}
|
|
1661
|
+
return LeadFirestoreRepository;
|
|
1662
|
+
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1663
|
+
|
|
1664
|
+
var CategoryFirestoreRepository = /** @class */ (function (_super) {
|
|
1665
|
+
__extends(CategoryFirestoreRepository, _super);
|
|
1666
|
+
function CategoryFirestoreRepository(firestore) {
|
|
1667
|
+
var _this = _super.call(this) || this;
|
|
1668
|
+
_this.firestore = firestore;
|
|
1669
|
+
_this.collectionName = 'categories';
|
|
1670
|
+
_this.model = Category;
|
|
1671
|
+
return _this;
|
|
1672
|
+
}
|
|
1673
|
+
CategoryFirestoreRepository.prototype.getCategoryBySlug = function (slug, shop) {
|
|
1674
|
+
return this.collection(this.collectionName)
|
|
1675
|
+
.where('slug', '==', slug)
|
|
1676
|
+
.where('shop', '==', shop)
|
|
1677
|
+
.where('published', '==', true)
|
|
1678
|
+
.get()
|
|
1679
|
+
.then(function (snap) {
|
|
1680
|
+
if (snap.size > 1)
|
|
1681
|
+
throw new DuplicatedResultsError('Query returned duplicated values');
|
|
1682
|
+
if (snap.empty)
|
|
1683
|
+
throw new NotFoundError("Document with slug " + slug + " not found");
|
|
1684
|
+
return snap.docs[0].data();
|
|
1685
|
+
})
|
|
1686
|
+
.catch(function (error) { return error; });
|
|
1687
|
+
};
|
|
1688
|
+
CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
|
|
1689
|
+
if (limit === void 0) { limit = 4; }
|
|
1690
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1691
|
+
var categorySnap, categories, homeSections, categories_1, categories_1_1, category, publishedField, productSnap, products, e_1_1;
|
|
1692
|
+
var e_1, _a;
|
|
1693
|
+
return __generator(this, function (_b) {
|
|
1694
|
+
switch (_b.label) {
|
|
1695
|
+
case 0: return [4 /*yield*/, this.collection(this.collectionName)
|
|
1696
|
+
.where('id', 'in', categoryIds)
|
|
1697
|
+
.where('published', '==', true)
|
|
1698
|
+
.get()];
|
|
1699
|
+
case 1:
|
|
1700
|
+
categorySnap = _b.sent();
|
|
1701
|
+
if (categorySnap.empty)
|
|
1702
|
+
throw new NotFoundError('Categories not found');
|
|
1703
|
+
categories = categorySnap.docs.map(function (doc) { return doc.data(); });
|
|
1704
|
+
homeSections = [];
|
|
1705
|
+
_b.label = 2;
|
|
1706
|
+
case 2:
|
|
1707
|
+
_b.trys.push([2, 7, 8, 9]);
|
|
1708
|
+
categories_1 = __values(categories), categories_1_1 = categories_1.next();
|
|
1709
|
+
_b.label = 3;
|
|
1710
|
+
case 3:
|
|
1711
|
+
if (!!categories_1_1.done) return [3 /*break*/, 6];
|
|
1712
|
+
category = categories_1_1.value;
|
|
1713
|
+
publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
1714
|
+
return [4 /*yield*/, this.collection('products')
|
|
1715
|
+
.where('categories', 'array-contains', category.id)
|
|
1716
|
+
.where(publishedField, '==', true)
|
|
1717
|
+
.where('stock.quantity', '>', 1)
|
|
1718
|
+
.limit(limit)
|
|
1719
|
+
.get()];
|
|
1720
|
+
case 4:
|
|
1721
|
+
productSnap = _b.sent();
|
|
1722
|
+
products = productSnap.docs.map(function (doc) { return doc.data(); });
|
|
1723
|
+
homeSections.push({ category: category, products: products });
|
|
1724
|
+
_b.label = 5;
|
|
1725
|
+
case 5:
|
|
1726
|
+
categories_1_1 = categories_1.next();
|
|
1727
|
+
return [3 /*break*/, 3];
|
|
1728
|
+
case 6: return [3 /*break*/, 9];
|
|
1729
|
+
case 7:
|
|
1730
|
+
e_1_1 = _b.sent();
|
|
1731
|
+
e_1 = { error: e_1_1 };
|
|
1732
|
+
return [3 /*break*/, 9];
|
|
1733
|
+
case 8:
|
|
1734
|
+
try {
|
|
1735
|
+
if (categories_1_1 && !categories_1_1.done && (_a = categories_1.return)) _a.call(categories_1);
|
|
1736
|
+
}
|
|
1737
|
+
finally { if (e_1) throw e_1.error; }
|
|
1738
|
+
return [7 /*endfinally*/];
|
|
1739
|
+
case 9: return [2 /*return*/, homeSections];
|
|
1740
|
+
}
|
|
1741
|
+
});
|
|
1742
|
+
});
|
|
1743
|
+
};
|
|
1744
|
+
CategoryFirestoreRepository.prototype.mountCategory = function (category) {
|
|
1745
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1746
|
+
var chunks, products, publishedField, chunks_1, chunks_1_1, productIds, productSnap, e_2_1;
|
|
1747
|
+
var e_2, _a;
|
|
1748
|
+
return __generator(this, function (_b) {
|
|
1749
|
+
switch (_b.label) {
|
|
1750
|
+
case 0:
|
|
1751
|
+
if (!category.products)
|
|
1752
|
+
throw new RequiredArgumentError(['Category products is empty']);
|
|
1753
|
+
chunks = category.products.reduce(function (resultArray, item, index) {
|
|
1754
|
+
var chunkIndex = Math.floor(index / 10);
|
|
1755
|
+
if (!resultArray[chunkIndex])
|
|
1756
|
+
resultArray[chunkIndex] = [];
|
|
1757
|
+
resultArray[chunkIndex].push(item);
|
|
1758
|
+
return resultArray;
|
|
1759
|
+
}, []);
|
|
1760
|
+
products = [];
|
|
1761
|
+
publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
|
|
1762
|
+
_b.label = 1;
|
|
1763
|
+
case 1:
|
|
1764
|
+
_b.trys.push([1, 6, 7, 8]);
|
|
1765
|
+
chunks_1 = __values(chunks), chunks_1_1 = chunks_1.next();
|
|
1766
|
+
_b.label = 2;
|
|
1767
|
+
case 2:
|
|
1768
|
+
if (!!chunks_1_1.done) return [3 /*break*/, 5];
|
|
1769
|
+
productIds = chunks_1_1.value;
|
|
1770
|
+
return [4 /*yield*/, this.collection('products')
|
|
1771
|
+
.where(publishedField, '==', true)
|
|
1772
|
+
.where('id', 'in', productIds)
|
|
1773
|
+
.get()];
|
|
1774
|
+
case 3:
|
|
1775
|
+
productSnap = _b.sent();
|
|
1776
|
+
if (productSnap.empty)
|
|
1777
|
+
return [3 /*break*/, 4];
|
|
1778
|
+
products.push.apply(products, __spreadArray([], __read(productSnap.docs.map(function (doc) { return doc.data(); }))));
|
|
1779
|
+
_b.label = 4;
|
|
1780
|
+
case 4:
|
|
1781
|
+
chunks_1_1 = chunks_1.next();
|
|
1782
|
+
return [3 /*break*/, 2];
|
|
1783
|
+
case 5: return [3 /*break*/, 8];
|
|
1784
|
+
case 6:
|
|
1785
|
+
e_2_1 = _b.sent();
|
|
1786
|
+
e_2 = { error: e_2_1 };
|
|
1787
|
+
return [3 /*break*/, 8];
|
|
1788
|
+
case 7:
|
|
1789
|
+
try {
|
|
1790
|
+
if (chunks_1_1 && !chunks_1_1.done && (_a = chunks_1.return)) _a.call(chunks_1);
|
|
1791
|
+
}
|
|
1792
|
+
finally { if (e_2) throw e_2.error; }
|
|
1793
|
+
return [7 /*endfinally*/];
|
|
1794
|
+
case 8: return [2 /*return*/, products];
|
|
1795
|
+
}
|
|
1796
|
+
});
|
|
1797
|
+
});
|
|
1798
|
+
};
|
|
1799
|
+
return CategoryFirestoreRepository;
|
|
1758
1800
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1759
1801
|
|
|
1760
|
-
var ProductFirestoreRepository = /** @class */ (function (_super) {
|
|
1761
|
-
__extends(ProductFirestoreRepository, _super);
|
|
1762
|
-
function ProductFirestoreRepository(firestore) {
|
|
1763
|
-
var _this = _super.call(this) || this;
|
|
1764
|
-
_this.firestore = firestore;
|
|
1765
|
-
_this.collectionName = 'products';
|
|
1766
|
-
_this.model = Product;
|
|
1767
|
-
return _this;
|
|
1768
|
-
}
|
|
1769
|
-
ProductFirestoreRepository.prototype.getBySlug = function (slug, shop) {
|
|
1770
|
-
var _a;
|
|
1771
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1772
|
-
var result;
|
|
1773
|
-
return __generator(this, function (_b) {
|
|
1774
|
-
switch (_b.label) {
|
|
1775
|
-
case 0: return [4 /*yield*/, this.find([
|
|
1776
|
-
{ slug: { operator: exports.Where.EQUALS, value: slug } },
|
|
1777
|
-
{ shopAvailability: { operator: exports.Where.IN, value: [shop] } },
|
|
1778
|
-
])];
|
|
1779
|
-
case 1:
|
|
1780
|
-
result = _b.sent();
|
|
1781
|
-
return [2 /*return*/, (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift()];
|
|
1782
|
-
}
|
|
1783
|
-
});
|
|
1784
|
-
});
|
|
1785
|
-
};
|
|
1786
|
-
return ProductFirestoreRepository;
|
|
1802
|
+
var ProductFirestoreRepository = /** @class */ (function (_super) {
|
|
1803
|
+
__extends(ProductFirestoreRepository, _super);
|
|
1804
|
+
function ProductFirestoreRepository(firestore) {
|
|
1805
|
+
var _this = _super.call(this) || this;
|
|
1806
|
+
_this.firestore = firestore;
|
|
1807
|
+
_this.collectionName = 'products';
|
|
1808
|
+
_this.model = Product;
|
|
1809
|
+
return _this;
|
|
1810
|
+
}
|
|
1811
|
+
ProductFirestoreRepository.prototype.getBySlug = function (slug, shop) {
|
|
1812
|
+
var _a;
|
|
1813
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1814
|
+
var result;
|
|
1815
|
+
return __generator(this, function (_b) {
|
|
1816
|
+
switch (_b.label) {
|
|
1817
|
+
case 0: return [4 /*yield*/, this.find([
|
|
1818
|
+
{ slug: { operator: exports.Where.EQUALS, value: slug } },
|
|
1819
|
+
{ shopAvailability: { operator: exports.Where.IN, value: [shop] } },
|
|
1820
|
+
])];
|
|
1821
|
+
case 1:
|
|
1822
|
+
result = _b.sent();
|
|
1823
|
+
return [2 /*return*/, (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift()];
|
|
1824
|
+
}
|
|
1825
|
+
});
|
|
1826
|
+
});
|
|
1827
|
+
};
|
|
1828
|
+
return ProductFirestoreRepository;
|
|
1787
1829
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1788
1830
|
|
|
1789
|
-
var ProductVariantFirestoreRepository = /** @class */ (function (_super) {
|
|
1790
|
-
__extends(ProductVariantFirestoreRepository, _super);
|
|
1791
|
-
function ProductVariantFirestoreRepository(firestore, parentRepository) {
|
|
1792
|
-
var _this = _super.call(this) || this;
|
|
1793
|
-
_this.firestore = firestore;
|
|
1794
|
-
_this.parentRepository = parentRepository;
|
|
1795
|
-
_this.collectionName = 'variants';
|
|
1796
|
-
_this.parentIdField = 'productId';
|
|
1797
|
-
_this.model = Variant;
|
|
1798
|
-
return _this;
|
|
1799
|
-
}
|
|
1800
|
-
return ProductVariantFirestoreRepository;
|
|
1831
|
+
var ProductVariantFirestoreRepository = /** @class */ (function (_super) {
|
|
1832
|
+
__extends(ProductVariantFirestoreRepository, _super);
|
|
1833
|
+
function ProductVariantFirestoreRepository(firestore, parentRepository) {
|
|
1834
|
+
var _this = _super.call(this) || this;
|
|
1835
|
+
_this.firestore = firestore;
|
|
1836
|
+
_this.parentRepository = parentRepository;
|
|
1837
|
+
_this.collectionName = 'variants';
|
|
1838
|
+
_this.parentIdField = 'productId';
|
|
1839
|
+
_this.model = Variant;
|
|
1840
|
+
return _this;
|
|
1841
|
+
}
|
|
1842
|
+
return ProductVariantFirestoreRepository;
|
|
1801
1843
|
}(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Product)));
|
|
1802
1844
|
|
|
1803
|
-
var CheckoutFirestoreRepository = /** @class */ (function (_super) {
|
|
1804
|
-
__extends(CheckoutFirestoreRepository, _super);
|
|
1805
|
-
function CheckoutFirestoreRepository(firestore) {
|
|
1806
|
-
var _this = _super.call(this) || this;
|
|
1807
|
-
_this.firestore = firestore;
|
|
1808
|
-
_this.collectionName = 'checkouts';
|
|
1809
|
-
_this.model = Checkout;
|
|
1810
|
-
return _this;
|
|
1811
|
-
}
|
|
1812
|
-
return CheckoutFirestoreRepository;
|
|
1845
|
+
var CheckoutFirestoreRepository = /** @class */ (function (_super) {
|
|
1846
|
+
__extends(CheckoutFirestoreRepository, _super);
|
|
1847
|
+
function CheckoutFirestoreRepository(firestore) {
|
|
1848
|
+
var _this = _super.call(this) || this;
|
|
1849
|
+
_this.firestore = firestore;
|
|
1850
|
+
_this.collectionName = 'checkouts';
|
|
1851
|
+
_this.model = Checkout;
|
|
1852
|
+
return _this;
|
|
1853
|
+
}
|
|
1854
|
+
return CheckoutFirestoreRepository;
|
|
1813
1855
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1814
1856
|
|
|
1815
|
-
var CouponFirestoreRepository = /** @class */ (function (_super) {
|
|
1816
|
-
__extends(CouponFirestoreRepository, _super);
|
|
1817
|
-
function CouponFirestoreRepository(firestore) {
|
|
1818
|
-
var _this = _super.call(this) || this;
|
|
1819
|
-
_this.firestore = firestore;
|
|
1820
|
-
_this.collectionName = 'coupons';
|
|
1821
|
-
_this.model = Coupon;
|
|
1822
|
-
return _this;
|
|
1823
|
-
}
|
|
1824
|
-
return CouponFirestoreRepository;
|
|
1857
|
+
var CouponFirestoreRepository = /** @class */ (function (_super) {
|
|
1858
|
+
__extends(CouponFirestoreRepository, _super);
|
|
1859
|
+
function CouponFirestoreRepository(firestore) {
|
|
1860
|
+
var _this = _super.call(this) || this;
|
|
1861
|
+
_this.firestore = firestore;
|
|
1862
|
+
_this.collectionName = 'coupons';
|
|
1863
|
+
_this.model = Coupon;
|
|
1864
|
+
return _this;
|
|
1865
|
+
}
|
|
1866
|
+
return CouponFirestoreRepository;
|
|
1825
1867
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1826
1868
|
|
|
1827
|
-
var OrderFirestoreRepository = /** @class */ (function (_super) {
|
|
1828
|
-
__extends(OrderFirestoreRepository, _super);
|
|
1829
|
-
function OrderFirestoreRepository(firestore) {
|
|
1830
|
-
var _this = _super.call(this) || this;
|
|
1831
|
-
_this.firestore = firestore;
|
|
1832
|
-
_this.collectionName = 'orders';
|
|
1833
|
-
_this.model = Order;
|
|
1834
|
-
return _this;
|
|
1835
|
-
}
|
|
1836
|
-
return OrderFirestoreRepository;
|
|
1869
|
+
var OrderFirestoreRepository = /** @class */ (function (_super) {
|
|
1870
|
+
__extends(OrderFirestoreRepository, _super);
|
|
1871
|
+
function OrderFirestoreRepository(firestore) {
|
|
1872
|
+
var _this = _super.call(this) || this;
|
|
1873
|
+
_this.firestore = firestore;
|
|
1874
|
+
_this.collectionName = 'orders';
|
|
1875
|
+
_this.model = Order;
|
|
1876
|
+
return _this;
|
|
1877
|
+
}
|
|
1878
|
+
return OrderFirestoreRepository;
|
|
1837
1879
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1838
1880
|
|
|
1839
|
-
var PaymentFirestoreRepository = /** @class */ (function (_super) {
|
|
1840
|
-
__extends(PaymentFirestoreRepository, _super);
|
|
1841
|
-
function PaymentFirestoreRepository(firestore) {
|
|
1842
|
-
var _this = _super.call(this) || this;
|
|
1843
|
-
_this.firestore = firestore;
|
|
1844
|
-
_this.collectionName = 'payments';
|
|
1845
|
-
_this.model = Payment;
|
|
1846
|
-
return _this;
|
|
1847
|
-
}
|
|
1848
|
-
return PaymentFirestoreRepository;
|
|
1881
|
+
var PaymentFirestoreRepository = /** @class */ (function (_super) {
|
|
1882
|
+
__extends(PaymentFirestoreRepository, _super);
|
|
1883
|
+
function PaymentFirestoreRepository(firestore) {
|
|
1884
|
+
var _this = _super.call(this) || this;
|
|
1885
|
+
_this.firestore = firestore;
|
|
1886
|
+
_this.collectionName = 'payments';
|
|
1887
|
+
_this.model = Payment;
|
|
1888
|
+
return _this;
|
|
1889
|
+
}
|
|
1890
|
+
return PaymentFirestoreRepository;
|
|
1849
1891
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1850
1892
|
|
|
1851
|
-
var CheckoutSubscriptionFirestoreRepository = /** @class */ (function (_super) {
|
|
1852
|
-
__extends(CheckoutSubscriptionFirestoreRepository, _super);
|
|
1853
|
-
function CheckoutSubscriptionFirestoreRepository(firestore) {
|
|
1854
|
-
var _this = _super.call(this) || this;
|
|
1855
|
-
_this.firestore = firestore;
|
|
1856
|
-
_this.collectionName = 'checkoutsSubscription';
|
|
1857
|
-
_this.model = CheckoutSubscription;
|
|
1858
|
-
return _this;
|
|
1859
|
-
}
|
|
1860
|
-
return CheckoutSubscriptionFirestoreRepository;
|
|
1893
|
+
var CheckoutSubscriptionFirestoreRepository = /** @class */ (function (_super) {
|
|
1894
|
+
__extends(CheckoutSubscriptionFirestoreRepository, _super);
|
|
1895
|
+
function CheckoutSubscriptionFirestoreRepository(firestore) {
|
|
1896
|
+
var _this = _super.call(this) || this;
|
|
1897
|
+
_this.firestore = firestore;
|
|
1898
|
+
_this.collectionName = 'checkoutsSubscription';
|
|
1899
|
+
_this.model = CheckoutSubscription;
|
|
1900
|
+
return _this;
|
|
1901
|
+
}
|
|
1902
|
+
return CheckoutSubscriptionFirestoreRepository;
|
|
1861
1903
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1862
1904
|
|
|
1863
|
-
var SubscriptionPlanFirestoreRepository = /** @class */ (function (_super) {
|
|
1864
|
-
__extends(SubscriptionPlanFirestoreRepository, _super);
|
|
1865
|
-
function SubscriptionPlanFirestoreRepository(firestore) {
|
|
1866
|
-
var _this = _super.call(this) || this;
|
|
1867
|
-
_this.firestore = firestore;
|
|
1868
|
-
_this.collectionName = 'subscriptionPlans';
|
|
1869
|
-
_this.model = SubscriptionPlan;
|
|
1870
|
-
return _this;
|
|
1871
|
-
}
|
|
1872
|
-
return SubscriptionPlanFirestoreRepository;
|
|
1905
|
+
var SubscriptionPlanFirestoreRepository = /** @class */ (function (_super) {
|
|
1906
|
+
__extends(SubscriptionPlanFirestoreRepository, _super);
|
|
1907
|
+
function SubscriptionPlanFirestoreRepository(firestore) {
|
|
1908
|
+
var _this = _super.call(this) || this;
|
|
1909
|
+
_this.firestore = firestore;
|
|
1910
|
+
_this.collectionName = 'subscriptionPlans';
|
|
1911
|
+
_this.model = SubscriptionPlan;
|
|
1912
|
+
return _this;
|
|
1913
|
+
}
|
|
1914
|
+
return SubscriptionPlanFirestoreRepository;
|
|
1873
1915
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1874
1916
|
|
|
1875
|
-
var Buy2WinFirestoreRepository = /** @class */ (function (_super) {
|
|
1876
|
-
__extends(Buy2WinFirestoreRepository, _super);
|
|
1877
|
-
function Buy2WinFirestoreRepository(firestore) {
|
|
1878
|
-
var _this = _super.call(this) || this;
|
|
1879
|
-
_this.firestore = firestore;
|
|
1880
|
-
_this.collectionName = 'buy2win';
|
|
1881
|
-
_this.model = Buy2Win;
|
|
1882
|
-
return _this;
|
|
1883
|
-
}
|
|
1884
|
-
return Buy2WinFirestoreRepository;
|
|
1917
|
+
var Buy2WinFirestoreRepository = /** @class */ (function (_super) {
|
|
1918
|
+
__extends(Buy2WinFirestoreRepository, _super);
|
|
1919
|
+
function Buy2WinFirestoreRepository(firestore) {
|
|
1920
|
+
var _this = _super.call(this) || this;
|
|
1921
|
+
_this.firestore = firestore;
|
|
1922
|
+
_this.collectionName = 'buy2win';
|
|
1923
|
+
_this.model = Buy2Win;
|
|
1924
|
+
return _this;
|
|
1925
|
+
}
|
|
1926
|
+
return Buy2WinFirestoreRepository;
|
|
1885
1927
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1886
1928
|
|
|
1887
|
-
var LegacyOrderFirestoreRepository = /** @class */ (function (_super) {
|
|
1888
|
-
__extends(LegacyOrderFirestoreRepository, _super);
|
|
1889
|
-
function LegacyOrderFirestoreRepository(firestore) {
|
|
1890
|
-
var _this = _super.call(this, firestore) || this;
|
|
1891
|
-
_this.firestore = firestore;
|
|
1892
|
-
_this.collectionName = 'legacyOrders';
|
|
1893
|
-
return _this;
|
|
1894
|
-
}
|
|
1895
|
-
return LegacyOrderFirestoreRepository;
|
|
1929
|
+
var LegacyOrderFirestoreRepository = /** @class */ (function (_super) {
|
|
1930
|
+
__extends(LegacyOrderFirestoreRepository, _super);
|
|
1931
|
+
function LegacyOrderFirestoreRepository(firestore) {
|
|
1932
|
+
var _this = _super.call(this, firestore) || this;
|
|
1933
|
+
_this.firestore = firestore;
|
|
1934
|
+
_this.collectionName = 'legacyOrders';
|
|
1935
|
+
return _this;
|
|
1936
|
+
}
|
|
1937
|
+
return LegacyOrderFirestoreRepository;
|
|
1896
1938
|
}(OrderFirestoreRepository));
|
|
1897
1939
|
|
|
1898
|
-
var HomeFirestoreRepository = /** @class */ (function (_super) {
|
|
1899
|
-
__extends(HomeFirestoreRepository, _super);
|
|
1900
|
-
function HomeFirestoreRepository(firestore) {
|
|
1901
|
-
var _this = _super.call(this) || this;
|
|
1902
|
-
_this.firestore = firestore;
|
|
1903
|
-
_this.collectionName = 'dms';
|
|
1904
|
-
_this.model = Home;
|
|
1905
|
-
return _this;
|
|
1906
|
-
}
|
|
1907
|
-
return HomeFirestoreRepository;
|
|
1940
|
+
var HomeFirestoreRepository = /** @class */ (function (_super) {
|
|
1941
|
+
__extends(HomeFirestoreRepository, _super);
|
|
1942
|
+
function HomeFirestoreRepository(firestore) {
|
|
1943
|
+
var _this = _super.call(this) || this;
|
|
1944
|
+
_this.firestore = firestore;
|
|
1945
|
+
_this.collectionName = 'dms';
|
|
1946
|
+
_this.model = Home;
|
|
1947
|
+
return _this;
|
|
1948
|
+
}
|
|
1949
|
+
return HomeFirestoreRepository;
|
|
1908
1950
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1909
1951
|
|
|
1910
|
-
var ShopMenuFirestoreRepository = /** @class */ (function (_super) {
|
|
1911
|
-
__extends(ShopMenuFirestoreRepository, _super);
|
|
1912
|
-
function ShopMenuFirestoreRepository(firestore) {
|
|
1913
|
-
var _this = _super.call(this) || this;
|
|
1914
|
-
_this.firestore = firestore;
|
|
1915
|
-
_this.collectionName = 'shopMenus';
|
|
1916
|
-
_this.model = ShopMenu;
|
|
1917
|
-
return _this;
|
|
1918
|
-
}
|
|
1919
|
-
return ShopMenuFirestoreRepository;
|
|
1952
|
+
var ShopMenuFirestoreRepository = /** @class */ (function (_super) {
|
|
1953
|
+
__extends(ShopMenuFirestoreRepository, _super);
|
|
1954
|
+
function ShopMenuFirestoreRepository(firestore) {
|
|
1955
|
+
var _this = _super.call(this) || this;
|
|
1956
|
+
_this.firestore = firestore;
|
|
1957
|
+
_this.collectionName = 'shopMenus';
|
|
1958
|
+
_this.model = ShopMenu;
|
|
1959
|
+
return _this;
|
|
1960
|
+
}
|
|
1961
|
+
return ShopMenuFirestoreRepository;
|
|
1920
1962
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
1921
1963
|
|
|
1922
|
-
var AuthenticationFirebaseAuthService = /** @class */ (function () {
|
|
1923
|
-
function AuthenticationFirebaseAuthService(firebaseAuth) {
|
|
1924
|
-
this.firebaseAuth = firebaseAuth;
|
|
1925
|
-
}
|
|
1926
|
-
AuthenticationFirebaseAuthService.prototype.signInWithEmailAndPassword = function (data) {
|
|
1927
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1928
|
-
var credentials, user;
|
|
1929
|
-
return __generator(this, function (_a) {
|
|
1930
|
-
switch (_a.label) {
|
|
1931
|
-
case 0: return [4 /*yield*/, this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password)];
|
|
1932
|
-
case 1:
|
|
1933
|
-
credentials = _a.sent();
|
|
1934
|
-
user = credentials.user;
|
|
1935
|
-
return [2 /*return*/, { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber }];
|
|
1936
|
-
}
|
|
1937
|
-
});
|
|
1938
|
-
});
|
|
1939
|
-
};
|
|
1940
|
-
AuthenticationFirebaseAuthService.prototype.signInWithGoogle = function () {
|
|
1941
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1942
|
-
var credentials, user;
|
|
1943
|
-
return __generator(this, function (_a) {
|
|
1944
|
-
switch (_a.label) {
|
|
1945
|
-
case 0: return [4 /*yield*/, this.firebaseAuth.signInWithPopup(new firebase__default$1["default"].auth.GoogleAuthProvider())];
|
|
1946
|
-
case 1:
|
|
1947
|
-
credentials = _a.sent();
|
|
1948
|
-
user = credentials.user;
|
|
1949
|
-
return [2 /*return*/, { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber }];
|
|
1950
|
-
}
|
|
1951
|
-
});
|
|
1952
|
-
});
|
|
1953
|
-
};
|
|
1954
|
-
AuthenticationFirebaseAuthService.prototype.signOut = function () {
|
|
1955
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1956
|
-
return __generator(this, function (_a) {
|
|
1957
|
-
this.firebaseAuth.signOut();
|
|
1958
|
-
return [2 /*return*/];
|
|
1959
|
-
});
|
|
1960
|
-
});
|
|
1961
|
-
};
|
|
1962
|
-
return AuthenticationFirebaseAuthService;
|
|
1964
|
+
var AuthenticationFirebaseAuthService = /** @class */ (function () {
|
|
1965
|
+
function AuthenticationFirebaseAuthService(firebaseAuth) {
|
|
1966
|
+
this.firebaseAuth = firebaseAuth;
|
|
1967
|
+
}
|
|
1968
|
+
AuthenticationFirebaseAuthService.prototype.signInWithEmailAndPassword = function (data) {
|
|
1969
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1970
|
+
var credentials, user;
|
|
1971
|
+
return __generator(this, function (_a) {
|
|
1972
|
+
switch (_a.label) {
|
|
1973
|
+
case 0: return [4 /*yield*/, this.firebaseAuth.signInWithEmailAndPassword(data.email, data.password)];
|
|
1974
|
+
case 1:
|
|
1975
|
+
credentials = _a.sent();
|
|
1976
|
+
user = credentials.user;
|
|
1977
|
+
return [2 /*return*/, { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber }];
|
|
1978
|
+
}
|
|
1979
|
+
});
|
|
1980
|
+
});
|
|
1981
|
+
};
|
|
1982
|
+
AuthenticationFirebaseAuthService.prototype.signInWithGoogle = function () {
|
|
1983
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1984
|
+
var credentials, user;
|
|
1985
|
+
return __generator(this, function (_a) {
|
|
1986
|
+
switch (_a.label) {
|
|
1987
|
+
case 0: return [4 /*yield*/, this.firebaseAuth.signInWithPopup(new firebase__default$1["default"].auth.GoogleAuthProvider())];
|
|
1988
|
+
case 1:
|
|
1989
|
+
credentials = _a.sent();
|
|
1990
|
+
user = credentials.user;
|
|
1991
|
+
return [2 /*return*/, { id: user.uid, displayName: user.displayName, email: user.email, phone: user.phoneNumber }];
|
|
1992
|
+
}
|
|
1993
|
+
});
|
|
1994
|
+
});
|
|
1995
|
+
};
|
|
1996
|
+
AuthenticationFirebaseAuthService.prototype.signOut = function () {
|
|
1997
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1998
|
+
return __generator(this, function (_a) {
|
|
1999
|
+
this.firebaseAuth.signOut();
|
|
2000
|
+
return [2 /*return*/];
|
|
2001
|
+
});
|
|
2002
|
+
});
|
|
2003
|
+
};
|
|
2004
|
+
return AuthenticationFirebaseAuthService;
|
|
1963
2005
|
}());
|
|
1964
2006
|
|
|
1965
|
-
/**
|
|
1966
|
-
* Generated bundle index. Do not edit.
|
|
2007
|
+
/**
|
|
2008
|
+
* Generated bundle index. Do not edit.
|
|
1967
2009
|
*/
|
|
1968
2010
|
|
|
1969
2011
|
Object.defineProperty(exports, 'chunk', {
|
|
@@ -2016,6 +2058,8 @@
|
|
|
2016
2058
|
exports.Home = Home;
|
|
2017
2059
|
exports.HomeFirestoreRepository = HomeFirestoreRepository;
|
|
2018
2060
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
2061
|
+
exports.Lead = Lead;
|
|
2062
|
+
exports.LeadFirestoreRepository = LeadFirestoreRepository;
|
|
2019
2063
|
exports.LegacyOrderFirestoreRepository = LegacyOrderFirestoreRepository;
|
|
2020
2064
|
exports.LineItem = LineItem;
|
|
2021
2065
|
exports.NotFoundError = NotFoundError;
|