@infrab4a/connect 4.0.0-beta.28 → 4.0.0-beta.3
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/domain/catalog/index.d.ts +0 -1
- package/domain/catalog/models/category.d.ts +5 -10
- package/domain/catalog/models/index.d.ts +0 -4
- package/domain/catalog/models/kit-product.d.ts +1 -1
- package/domain/catalog/models/product.d.ts +3 -8
- package/domain/catalog/models/types/category-filter.type.d.ts +4 -0
- package/domain/catalog/models/types/index.d.ts +1 -2
- package/domain/catalog/models/variant.d.ts +2 -1
- package/domain/catalog/repositories/category.repository.d.ts +3 -4
- package/domain/catalog/repositories/index.d.ts +0 -4
- package/domain/catalog/repositories/product.repository.d.ts +0 -1
- package/domain/generic/model/base.model.d.ts +5 -9
- package/domain/generic/model/types/base-model-builder.type.d.ts +2 -4
- package/domain/generic/model/types/identifier-model.type.d.ts +5 -6
- package/domain/generic/model/types/model-base-structure.type.d.ts +3 -9
- package/domain/generic/model/types/non-function-property-name.type.d.ts +3 -12
- package/domain/generic/repository/find.repository.d.ts +0 -3
- package/domain/generic/repository/get.repository.d.ts +2 -2
- package/domain/generic/repository/types/repository-find-filters.type.d.ts +3 -3
- package/domain/generic/repository/types/repository-order-by-list.type.d.ts +2 -2
- package/domain/generic/repository/types/repository-update-params.type.d.ts +2 -2
- package/domain/location/models/address.d.ts +3 -5
- package/domain/shop-settings/models/index.d.ts +0 -1
- package/domain/shop-settings/models/types/index.d.ts +1 -6
- package/domain/shop-settings/repositories/index.d.ts +0 -1
- package/domain/shopping/models/buy-2-win.d.ts +1 -3
- package/domain/shopping/models/checkout.d.ts +6 -5
- package/domain/shopping/models/index.d.ts +4 -5
- package/domain/shopping/models/subscription/checkout.d.ts +4 -3
- package/domain/shopping/repositories/index.d.ts +2 -4
- package/domain/users/models/lead.d.ts +0 -1
- package/domain/users/models/subscription/subscription.d.ts +3 -3
- package/domain/users/models/user-address.d.ts +2 -1
- package/domain/users/models/user.d.ts +3 -2
- package/esm2020/domain/catalog/index.mjs +1 -2
- package/esm2020/domain/catalog/models/category.mjs +4 -12
- package/esm2020/domain/catalog/models/index.mjs +1 -5
- package/esm2020/domain/catalog/models/kit-product.mjs +2 -2
- package/esm2020/domain/catalog/models/product.mjs +3 -23
- package/esm2020/domain/catalog/models/types/category-filter.type.mjs +2 -0
- package/esm2020/domain/catalog/models/types/index.mjs +2 -3
- package/esm2020/domain/catalog/models/variant.mjs +4 -1
- package/esm2020/domain/catalog/repositories/category.repository.mjs +1 -1
- package/esm2020/domain/catalog/repositories/index.mjs +1 -5
- package/esm2020/domain/catalog/repositories/product.repository.mjs +1 -1
- package/esm2020/domain/generic/model/base.model.mjs +2 -3
- package/esm2020/domain/generic/model/types/base-model-builder.type.mjs +1 -1
- package/esm2020/domain/generic/model/types/identifier-model.type.mjs +1 -1
- package/esm2020/domain/generic/model/types/model-base-structure.type.mjs +1 -1
- package/esm2020/domain/generic/model/types/non-function-property-name.type.mjs +1 -1
- package/esm2020/domain/generic/repository/find.repository.mjs +1 -1
- package/esm2020/domain/generic/repository/get.repository.mjs +1 -1
- package/esm2020/domain/generic/repository/types/repository-find-filters.type.mjs +1 -1
- package/esm2020/domain/generic/repository/types/repository-order-by-list.type.mjs +1 -1
- package/esm2020/domain/generic/repository/types/repository-update-params.type.mjs +1 -1
- package/esm2020/domain/location/models/address.mjs +2 -2
- package/esm2020/domain/shop-settings/models/index.mjs +1 -2
- package/esm2020/domain/shop-settings/models/types/index.mjs +2 -7
- package/esm2020/domain/shop-settings/repositories/index.mjs +1 -2
- package/esm2020/domain/shopping/models/buy-2-win.mjs +2 -2
- package/esm2020/domain/shopping/models/checkout.mjs +7 -6
- package/esm2020/domain/shopping/models/index.mjs +5 -6
- package/esm2020/domain/shopping/models/order.mjs +1 -1
- package/esm2020/domain/shopping/models/subscription/checkout.mjs +6 -6
- package/esm2020/domain/shopping/repositories/index.mjs +3 -5
- package/esm2020/domain/users/models/lead.mjs +1 -1
- package/esm2020/domain/users/models/subscription/edition.mjs +1 -1
- package/esm2020/domain/users/models/subscription/payment.mjs +1 -1
- package/esm2020/domain/users/models/subscription/subscription.mjs +6 -6
- package/esm2020/domain/users/models/user-address.mjs +1 -1
- package/esm2020/domain/users/models/user-payment-method.mjs +1 -1
- package/esm2020/domain/users/models/user.mjs +3 -3
- package/esm2020/domain/users/use-cases/authentication.mjs +2 -2
- package/esm2020/infra/elasticsearch/adapters/axios.adapter.mjs +11 -28
- package/esm2020/infra/elasticsearch/adapters/elastic-search.adapter.mjs +1 -1
- package/esm2020/infra/elasticsearch/indexes/products-index.mjs +51 -58
- package/esm2020/infra/elasticsearch/types/elastic-search-result.mjs +1 -1
- package/esm2020/infra/firebase/firestore/mixins/with-create-firestore.mixin.mjs +4 -8
- package/esm2020/infra/firebase/firestore/mixins/with-crud-firestore.mixin.mjs +1 -1
- package/esm2020/infra/firebase/firestore/mixins/with-delete-firestore.mixin.mjs +2 -6
- package/esm2020/infra/firebase/firestore/mixins/with-find-firestore.mixin.mjs +7 -10
- package/esm2020/infra/firebase/firestore/mixins/with-firestore.mixin.mjs +4 -27
- package/esm2020/infra/firebase/firestore/mixins/with-get-firestore.mixin.mjs +3 -6
- package/esm2020/infra/firebase/firestore/mixins/with-helpers.mixin.mjs +1 -1
- package/esm2020/infra/firebase/firestore/mixins/with-sub-collection.mixin.mjs +3 -5
- package/esm2020/infra/firebase/firestore/mixins/with-update-firestore.mixin.mjs +4 -7
- package/esm2020/infra/firebase/firestore/repositories/catalog/category-firestore.repository.mjs +8 -15
- package/esm2020/infra/firebase/firestore/repositories/catalog/product-firestore.repository.mjs +6 -11
- package/esm2020/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.mjs +8 -10
- package/esm2020/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.mjs +6 -8
- package/esm2020/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.mjs +30 -36
- package/esm2020/infra/firebase/firestore/repositories/shop-settings/index.mjs +1 -2
- package/esm2020/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.mjs +6 -8
- package/esm2020/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.mjs +6 -8
- package/esm2020/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.mjs +6 -8
- package/esm2020/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.mjs +6 -8
- package/esm2020/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.mjs +6 -8
- package/esm2020/infra/firebase/firestore/repositories/shopping/index.mjs +4 -6
- package/esm2020/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.mjs +4 -6
- package/esm2020/infra/firebase/firestore/repositories/shopping/order-firestore.repository.mjs +9 -11
- package/esm2020/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.mjs +6 -8
- package/esm2020/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.mjs +6 -8
- package/esm2020/infra/firebase/firestore/repositories/users/lead-firestore.repository.mjs +6 -8
- package/esm2020/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.mjs +8 -10
- package/esm2020/infra/firebase/firestore/repositories/users/subscription-firestore.repository.mjs +6 -8
- package/esm2020/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.mjs +8 -10
- package/esm2020/infra/firebase/firestore/repositories/users/user-address-firestore.repository.mjs +8 -10
- package/esm2020/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.mjs +8 -10
- package/esm2020/infra/firebase/firestore/repositories/users/user-firestore.repository.mjs +6 -8
- package/esm2020/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.mjs +8 -10
- package/esm2020/infra/firebase/firestore/types/firestore-sub.repository.type.mjs +1 -1
- package/esm2020/infra/firebase/firestore/types/firestore.helpers.type.mjs +1 -1
- package/esm2020/infra/firebase/firestore/types/firestore.repository.type.mjs +1 -1
- package/esm2020/infra/firebase/firestore/types/index.mjs +3 -4
- package/esm2020/infra/hasura-graphql/mixins/helpers/attribute-option.helper.mjs +2 -2
- package/esm2020/infra/hasura-graphql/mixins/helpers/bind-filter-query.helper.mjs +4 -5
- package/esm2020/infra/hasura-graphql/mixins/helpers/filter-option.helper.mjs +1 -1
- package/esm2020/infra/hasura-graphql/mixins/helpers/graphql-field.helper.mjs +25 -36
- package/esm2020/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.mjs +4 -6
- package/esm2020/infra/hasura-graphql/mixins/with-crud-hasura-graphql.mixin.mjs +1 -1
- package/esm2020/infra/hasura-graphql/mixins/with-delete-hasura-graphql.mixin.mjs +3 -5
- package/esm2020/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.mjs +15 -36
- package/esm2020/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.mjs +3 -5
- package/esm2020/infra/hasura-graphql/mixins/with-hasura-graphql.mixin.mjs +24 -40
- package/esm2020/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.mjs +5 -7
- package/esm2020/infra/hasura-graphql/models/product-hasura-graphql.mjs +1 -1
- package/esm2020/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.mjs +12 -130
- package/esm2020/infra/hasura-graphql/repositories/catalog/index.mjs +1 -5
- package/esm2020/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.mjs +16 -43
- package/esm2020/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.mjs +7 -8
- package/esm2020/infra/hasura-graphql/types/graphql.repository.type.mjs +1 -1
- package/esm2020/infra/hasura-graphql/types/hasura-graphql-fields.type.mjs +1 -1
- package/esm2020/utils/index.mjs +4 -6
- package/fesm2015/infrab4a-connect.mjs +386 -1498
- package/fesm2015/infrab4a-connect.mjs.map +1 -1
- package/fesm2020/infrab4a-connect.mjs +392 -1474
- package/fesm2020/infrab4a-connect.mjs.map +1 -1
- package/infra/elasticsearch/adapters/axios.adapter.d.ts +5 -7
- package/infra/elasticsearch/adapters/elastic-search.adapter.d.ts +2 -3
- package/infra/elasticsearch/indexes/products-index.d.ts +10 -8
- package/infra/elasticsearch/types/elastic-search-result.d.ts +0 -2
- package/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +1 -2
- package/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +4 -13
- package/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +4 -8
- package/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +3 -3
- package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +5 -6
- package/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +4 -4
- package/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +4 -4
- package/infra/firebase/firestore/repositories/shop-settings/index.d.ts +0 -1
- package/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +4 -4
- package/infra/firebase/firestore/repositories/shopping/index.d.ts +3 -5
- package/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +4 -4
- package/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +4 -4
- package/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +4 -3
- package/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +3 -3
- package/infra/firebase/firestore/types/firestore.helpers.type.d.ts +5 -5
- package/infra/firebase/firestore/types/firestore.repository.type.d.ts +1 -3
- package/infra/firebase/firestore/types/index.d.ts +2 -3
- package/infra/hasura-graphql/mixins/helpers/attribute-option.helper.d.ts +3 -9
- package/infra/hasura-graphql/mixins/helpers/bind-filter-query.helper.d.ts +5 -5
- package/infra/hasura-graphql/mixins/helpers/filter-option.helper.d.ts +2 -4
- package/infra/hasura-graphql/mixins/helpers/graphql-field.helper.d.ts +5 -8
- package/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.d.ts +1 -2
- package/infra/hasura-graphql/mixins/with-crud-hasura-graphql.mixin.d.ts +3 -3
- package/infra/hasura-graphql/mixins/with-delete-hasura-graphql.mixin.d.ts +1 -1
- package/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.d.ts +15 -12
- package/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.d.ts +6 -7
- package/infra/hasura-graphql/mixins/with-hasura-graphql.mixin.d.ts +3 -14
- package/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.d.ts +2 -2
- package/infra/hasura-graphql/models/product-hasura-graphql.d.ts +0 -1
- package/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.d.ts +5 -10
- package/infra/hasura-graphql/repositories/catalog/index.d.ts +0 -4
- package/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts +3 -4
- package/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts +4 -4
- package/infra/hasura-graphql/types/graphql.repository.type.d.ts +5 -7
- package/infra/hasura-graphql/types/hasura-graphql-fields.type.d.ts +3 -7
- package/package.json +1 -2
- package/utils/index.d.ts +22 -5
- package/domain/catalog/helpers/RoundProdutcPriceHelper.d.ts +0 -4
- package/domain/catalog/helpers/index.d.ts +0 -1
- package/domain/catalog/models/category-collection-children.d.ts +0 -13
- package/domain/catalog/models/category-filter.d.ts +0 -11
- package/domain/catalog/models/filter-option.d.ts +0 -9
- package/domain/catalog/models/filter.d.ts +0 -12
- package/domain/catalog/models/types/category-product.d.ts +0 -4
- package/domain/catalog/models/types/product-evaluation.type.d.ts +0 -6
- package/domain/catalog/repositories/category-collection-children.repository.d.ts +0 -4
- package/domain/catalog/repositories/category-filter.repository.d.ts +0 -5
- package/domain/catalog/repositories/filter-option.repository.d.ts +0 -4
- package/domain/catalog/repositories/filter.repository.d.ts +0 -4
- package/domain/shop-settings/models/shop-settings.d.ts +0 -9
- package/domain/shop-settings/models/types/shop-banner.type.d.ts +0 -12
- package/domain/shop-settings/models/types/shop-brands.type.d.ts +0 -10
- package/domain/shop-settings/models/types/shop-carousel.type.d.ts +0 -5
- package/domain/shop-settings/models/types/shop-collection.type.d.ts +0 -9
- package/domain/shop-settings/models/types/shop-section.type.d.ts +0 -9
- package/domain/shop-settings/repositories/shop-settings.repository.d.ts +0 -4
- package/domain/shopping/models/campaign-dashboard.d.ts +0 -15
- package/domain/shopping/models/campaign-hashtag.d.ts +0 -18
- package/domain/shopping/repositories/campaign-dashboard.repository.d.ts +0 -4
- package/domain/shopping/repositories/campaign-hashtag.repository.d.ts +0 -4
- package/esm2020/domain/catalog/helpers/RoundProdutcPriceHelper.mjs +0 -15
- package/esm2020/domain/catalog/helpers/index.mjs +0 -2
- package/esm2020/domain/catalog/models/category-collection-children.mjs +0 -13
- package/esm2020/domain/catalog/models/category-filter.mjs +0 -14
- package/esm2020/domain/catalog/models/filter-option.mjs +0 -7
- package/esm2020/domain/catalog/models/filter.mjs +0 -7
- package/esm2020/domain/catalog/models/types/category-product.mjs +0 -2
- package/esm2020/domain/catalog/models/types/product-evaluation.type.mjs +0 -2
- package/esm2020/domain/catalog/repositories/category-collection-children.repository.mjs +0 -2
- package/esm2020/domain/catalog/repositories/category-filter.repository.mjs +0 -2
- package/esm2020/domain/catalog/repositories/filter-option.repository.mjs +0 -2
- package/esm2020/domain/catalog/repositories/filter.repository.mjs +0 -2
- package/esm2020/domain/shop-settings/models/shop-settings.mjs +0 -7
- package/esm2020/domain/shop-settings/models/types/shop-banner.type.mjs +0 -2
- package/esm2020/domain/shop-settings/models/types/shop-brands.type.mjs +0 -2
- package/esm2020/domain/shop-settings/models/types/shop-carousel.type.mjs +0 -2
- package/esm2020/domain/shop-settings/models/types/shop-collection.type.mjs +0 -2
- package/esm2020/domain/shop-settings/models/types/shop-section.type.mjs +0 -2
- package/esm2020/domain/shop-settings/repositories/shop-settings.repository.mjs +0 -2
- package/esm2020/domain/shopping/models/campaign-dashboard.mjs +0 -7
- package/esm2020/domain/shopping/models/campaign-hashtag.mjs +0 -7
- package/esm2020/domain/shopping/repositories/campaign-dashboard.repository.mjs +0 -2
- package/esm2020/domain/shopping/repositories/campaign-hashtag.repository.mjs +0 -2
- package/esm2020/infra/firebase/firestore/repositories/shop-settings/shop-settings-firestore.repository.mjs +0 -14
- package/esm2020/infra/firebase/firestore/repositories/shopping/campaign-dashboard-firestore.repository.mjs +0 -14
- package/esm2020/infra/firebase/firestore/repositories/shopping/campaign-hashtag-firestore.repository.mjs +0 -14
- package/esm2020/infra/firebase/firestore/types/firestore-interceptors.type.mjs +0 -2
- package/esm2020/infra/hasura-graphql/repositories/catalog/category-collection-children-hasura-graphql.repository.mjs +0 -38
- package/esm2020/infra/hasura-graphql/repositories/catalog/category-filter-hasura-graphql.repository.mjs +0 -56
- package/esm2020/infra/hasura-graphql/repositories/catalog/filter-hasura-graphql.repository.mjs +0 -105
- package/esm2020/infra/hasura-graphql/repositories/catalog/filter-option-hasura-graphql.repository.mjs +0 -22
- package/esm2020/utils/decorators/debug.class.decorator.mjs +0 -7
- package/esm2020/utils/decorators/index.mjs +0 -3
- package/esm2020/utils/decorators/trace.method.decorator.mjs +0 -81
- package/esm2020/utils/helpers/class-name.helper.mjs +0 -15
- package/esm2020/utils/helpers/debug-decorator.helper.mjs +0 -18
- package/esm2020/utils/helpers/debug.helper.mjs +0 -150
- package/esm2020/utils/helpers/index.mjs +0 -5
- package/esm2020/utils/helpers/reflect.helper.mjs +0 -165
- package/esm2020/utils/log.utils.mjs +0 -9
- package/infra/firebase/firestore/repositories/shop-settings/shop-settings-firestore.repository.d.ts +0 -7
- package/infra/firebase/firestore/repositories/shopping/campaign-dashboard-firestore.repository.d.ts +0 -8
- package/infra/firebase/firestore/repositories/shopping/campaign-hashtag-firestore.repository.d.ts +0 -8
- package/infra/firebase/firestore/types/firestore-interceptors.type.d.ts +0 -14
- package/infra/hasura-graphql/repositories/catalog/category-collection-children-hasura-graphql.repository.d.ts +0 -10
- package/infra/hasura-graphql/repositories/catalog/category-filter-hasura-graphql.repository.d.ts +0 -11
- package/infra/hasura-graphql/repositories/catalog/filter-hasura-graphql.repository.d.ts +0 -18
- package/infra/hasura-graphql/repositories/catalog/filter-option-hasura-graphql.repository.d.ts +0 -10
- package/utils/decorators/debug.class.decorator.d.ts +0 -2
- package/utils/decorators/index.d.ts +0 -2
- package/utils/decorators/trace.method.decorator.d.ts +0 -14
- package/utils/helpers/class-name.helper.d.ts +0 -3
- package/utils/helpers/debug-decorator.helper.d.ts +0 -9
- package/utils/helpers/debug.helper.d.ts +0 -60
- package/utils/helpers/index.d.ts +0 -4
- package/utils/helpers/reflect.helper.d.ts +0 -50
- package/utils/log.utils.d.ts +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IdentifierModel, ModelBaseStructure } from '../../../../domain';
|
|
2
1
|
import { FirestoreRepository } from './firestore.repository.type';
|
|
3
|
-
|
|
2
|
+
import { BaseModel, ModelBaseStructure, IdentifiersModel } from '../../../../domain';
|
|
3
|
+
export declare type FirestoreSubRepository<Model extends ModelBaseStructure, ParentModel extends ModelBaseStructure = BaseModel<{}>> = {
|
|
4
4
|
readonly parentRepository: FirestoreRepository<ParentModel>;
|
|
5
|
-
parentIdField:
|
|
5
|
+
parentIdField: keyof IdentifiersModel<Model>;
|
|
6
6
|
} & FirestoreRepository<Model>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { FirestoreSubRepository } from './firestore-sub.repository.type';
|
|
1
|
+
import { QuerySnapshot, QueryDocumentSnapshot } from 'firebase/firestore';
|
|
2
|
+
import { BaseModel } from '../../../../domain';
|
|
4
3
|
import { FirestoreRepository } from './firestore.repository.type';
|
|
4
|
+
import { FirestoreSubRepository } from './firestore-sub.repository.type';
|
|
5
5
|
export interface FirestoreHelpers {
|
|
6
|
-
toArray<T extends
|
|
7
|
-
isSubCollection<T extends
|
|
6
|
+
toArray<T extends BaseModel<T>>(snapShot: QuerySnapshot<T> | Array<QueryDocumentSnapshot<T>>): Array<T>;
|
|
7
|
+
isSubCollection<T extends BaseModel<T>>(repository: FirestoreRepository<T>): repository is FirestoreSubRepository<T>;
|
|
8
8
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { CollectionReference, DocumentData, Firestore, QueryDocumentSnapshot } from 'firebase/firestore';
|
|
2
2
|
import { BaseModelBuilder, ModelBaseStructure, NonFunctionAndIdentifierPropertyNames } from '../../../../domain';
|
|
3
3
|
import { FirestoreFieldType } from '../enums';
|
|
4
|
-
|
|
5
|
-
export declare type FirestoreRepository<Model extends ModelBaseStructure<Model>> = {
|
|
4
|
+
export declare type FirestoreRepository<Model extends ModelBaseStructure> = {
|
|
6
5
|
readonly firestore?: Firestore;
|
|
7
6
|
collectionName: string;
|
|
8
7
|
model: BaseModelBuilder<Model>;
|
|
9
8
|
collection(path?: string): CollectionReference<Model>;
|
|
10
9
|
fields?: Partial<Record<NonFunctionAndIdentifierPropertyNames<Model>, FirestoreFieldType>>;
|
|
11
|
-
interceptors?: FirestoreInterceptors<Model>;
|
|
12
10
|
buildModelInstance(): {
|
|
13
11
|
toFirestore: (data: Model) => DocumentData;
|
|
14
12
|
fromFirestore: (snap: QueryDocumentSnapshot<Model>) => Model;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from './firestore-interceptors.type';
|
|
2
|
-
export * from './firestore-sub.repository.type';
|
|
3
|
-
export * from './firestore.helpers.type';
|
|
4
1
|
export * from './firestore.repository.type';
|
|
2
|
+
export * from './firestore.helpers.type';
|
|
3
|
+
export * from './firestore-sub.repository.type';
|
|
@@ -4,15 +4,9 @@ declare type FindByAttributeResult<MBase extends ModelBaseStructure<MBase>, Attr
|
|
|
4
4
|
attributeName: Attribute;
|
|
5
5
|
};
|
|
6
6
|
export declare class AttributeOptionHelper {
|
|
7
|
-
static FindByAttribute: <MBase extends ModelBaseStructure<
|
|
8
|
-
static CheckIsColumnOption: <Model extends ModelBaseStructure<
|
|
9
|
-
|
|
10
|
-
}, any>>(fieldValue: any) => fieldValue is ColumnOptions<Model, ParentModel, any>;
|
|
11
|
-
static FindColumnOptionFromList: <Model extends ModelBaseStructure<Record<string, any> & {
|
|
12
|
-
identifiersFields: any[];
|
|
13
|
-
}, any>, ParentModel extends ModelBaseStructure<Record<string, any> & {
|
|
14
|
-
identifiersFields: any[];
|
|
15
|
-
}, any>>(columnName: string, fields: HasuraGraphQLFields<ParentModel>) => ColumnOptions<Model, ParentModel, any> & {
|
|
7
|
+
static FindByAttribute: <MBase extends ModelBaseStructure<any, any>, Attribute extends NonFunctionAndIdentifierPropertyNames<MBase> = NonFunctionAndIdentifierPropertyNames<MBase>>(attributeName: Attribute, fields: HasuraGraphQLFields<MBase>) => FindByAttributeResult<MBase, Attribute>;
|
|
8
|
+
static CheckIsColumnOption: <Model extends ModelBaseStructure<any, any>, ParentModel extends ModelBaseStructure<any, any>>(fieldValue: any) => fieldValue is ColumnOptions<Model, ParentModel, any>;
|
|
9
|
+
static FindColumnOptionFromList: <Model extends ModelBaseStructure<any, any>, ParentModel extends ModelBaseStructure<any, any>>(columnName: string, fields: HasuraGraphQLFields<ParentModel>) => ColumnOptions<Model, ParentModel, any> & {
|
|
16
10
|
attributeName: NonFunctionAndIdentifierPropertyNames<ParentModel>;
|
|
17
11
|
};
|
|
18
12
|
}
|
|
@@ -2,9 +2,9 @@ import { ModelBaseStructure, NonFunctionAndIdentifierPropertyNames, NonFunctionP
|
|
|
2
2
|
import { HasuraGraphQLWhere } from '../../enums';
|
|
3
3
|
import { ColumnOptions, HasuraGraphQLFields, VariableOptions } from '../../types';
|
|
4
4
|
export declare class BindFilterQueryHelper {
|
|
5
|
-
static MakeGraphQLWhere: <MBase extends ModelBaseStructure<
|
|
6
|
-
static BuildWhereSentence: <MBase extends ModelBaseStructure<
|
|
7
|
-
static BuildOperatorSentence: <MBase extends ModelBaseStructure<
|
|
8
|
-
static GetHasuraOperator: <MBase extends ModelBaseStructure<
|
|
9
|
-
static GetHasuraJsonbOperator: <MBase extends ModelBaseStructure<
|
|
5
|
+
static MakeGraphQLWhere: <MBase extends ModelBaseStructure<any, any>>(filter: RepositoryFindFielters<MBase>, fields: HasuraGraphQLFields<MBase>) => VariableOptions;
|
|
6
|
+
static BuildWhereSentence: <MBase extends ModelBaseStructure<any, any>>(field: NonFunctionAndIdentifierPropertyNames<MBase>, options: RepositoryFindFieltersOptions<MBase, NonFunctionPropertyNames<MBase, keyof MBase>>, fields: HasuraGraphQLFields<MBase>) => VariableOptions;
|
|
7
|
+
static BuildOperatorSentence: <MBase extends ModelBaseStructure<any, any>>(options: RepositoryFindFieltersOptions<MBase, any>, fieldOption: ColumnOptions<any, any>) => VariableOptions;
|
|
8
|
+
static GetHasuraOperator: <MBase extends ModelBaseStructure<any, any>>(options: RepositoryFindFieltersOptions<MBase, NonFunctionPropertyNames<MBase, keyof MBase>>, fieldOption: ColumnOptions<any, any>) => HasuraGraphQLWhere;
|
|
9
|
+
static GetHasuraJsonbOperator: <MBase extends ModelBaseStructure<any, any>>(options: RepositoryFindFieltersOptions<MBase, NonFunctionPropertyNames<MBase, keyof MBase>>) => HasuraGraphQLWhere;
|
|
10
10
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ModelBaseStructure, RepositoryFindFieltersOptions } from '../../../../domain';
|
|
2
2
|
import { ColumnOptions } from '../../types';
|
|
3
3
|
export declare class FilterOptionHelper {
|
|
4
|
-
static CheckIfIsFilterOption: <Model extends ModelBaseStructure<
|
|
5
|
-
|
|
6
|
-
}, any>>(filter: any) => filter is RepositoryFindFieltersOptions<Model, any>;
|
|
7
|
-
static GetValueFromFilter: <Model extends ModelBaseStructure<Model, Model["identifiersFields"][number]>>(filter: RepositoryFindFieltersOptions<Model, any>, fieldOption: ColumnOptions<any, any>) => any;
|
|
4
|
+
static CheckIfIsFilterOption: <Model extends ModelBaseStructure<any, any>>(filter: any) => filter is RepositoryFindFieltersOptions<Model, any>;
|
|
5
|
+
static GetValueFromFilter: <Model extends ModelBaseStructure<any, any>>(filter: RepositoryFindFieltersOptions<Model, any>, fieldOption: ColumnOptions<any, any>) => any;
|
|
8
6
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { ModelBaseStructure,
|
|
1
|
+
import { ModelBaseStructure, NonFunctionProperties } from '../../../../domain';
|
|
2
2
|
import { Fields, GraphQLParams, HasuraGraphQLFields } from '../../types';
|
|
3
3
|
export declare class GraphQLFieldHelper {
|
|
4
|
-
static CheckIsGraphQLParams: <Model extends ModelBaseStructure<
|
|
5
|
-
static ConvertModelFieldsToGraphQLFields: <Model extends ModelBaseStructure<
|
|
6
|
-
static ConvertFieldValueFrom: <Model extends ModelBaseStructure<Record<string,
|
|
7
|
-
|
|
8
|
-
}, any>, RecordDataType extends string | number | Date | DataType, DataType extends Record<string, RecordDataType | RecordDataType[]>>(data: DataType, fields: HasuraGraphQLFields<Model>) => NonFunctionAndIdentifierPropertiesWithNoPartial<Model> | Partial<import("../../../../domain").IdentifiersModel<Model>>;
|
|
9
|
-
static ConvertFieldValueTo: <Model extends ModelBaseStructure<Model, Model["identifiersFields"][number]>, DataType extends Record<string, string | number | Date | DataType>>(instance: Model, fields: HasuraGraphQLFields<Model>, update?: boolean) => DataType;
|
|
10
|
-
private static ConvertNestedFieldsToGraphQLFields;
|
|
4
|
+
static CheckIsGraphQLParams: <Model extends ModelBaseStructure<any, any>>(params: string | GraphQLParams<Model>[]) => params is GraphQLParams<Model>[];
|
|
5
|
+
static ConvertModelFieldsToGraphQLFields: <Model extends ModelBaseStructure<any, any>>(fields: HasuraGraphQLFields<Model>) => Fields;
|
|
6
|
+
static ConvertFieldValueFrom: <Model extends ModelBaseStructure<any, any>, RecordDataType extends string | number | Date | DataType, DataType extends Record<string, RecordDataType | RecordDataType[]>>(data: DataType, fields: HasuraGraphQLFields<Model>) => Partial<NonFunctionProperties<Model>>;
|
|
7
|
+
static ConvertFieldValueTo: <Model extends ModelBaseStructure<any, any>, DataType extends Record<string, string | number | Date | DataType>>(instance: Model, fields: HasuraGraphQLFields<Model>, update?: boolean) => DataType;
|
|
11
8
|
}
|
|
@@ -3,7 +3,6 @@ import { MergeConstructorParams, MixinCtor } from '../../../utils';
|
|
|
3
3
|
import { GraphQLRepository } from '../types';
|
|
4
4
|
export declare type CreateConstructorParams = {
|
|
5
5
|
insertGraphQLOperation?: string;
|
|
6
|
-
insertAllGraphQLOperation?: string;
|
|
7
6
|
insertGraphQLObjectType?: string;
|
|
8
7
|
};
|
|
9
|
-
export declare const withCreateHasuraGraphQL: <MBase extends ModelBaseStructure<
|
|
8
|
+
export declare const withCreateHasuraGraphQL: <MBase extends ModelBaseStructure<any, any>, TMixinBase extends MixinCtor<GraphQLRepository<MBase>, any[]>>(MixinBase: MixinCtor<GraphQLRepository<MBase>, any[]> & TMixinBase) => MixinCtor<GraphQLRepository<MBase> & InstanceType<TMixinBase> & CreateRepository<MBase, CreateRepositoryParams<MBase>>, MergeConstructorParams<[CreateConstructorParams, ...any[]], ConstructorParameters<TMixinBase>>>;
|
|
@@ -4,8 +4,8 @@ import { GraphQLRepository } from '../types';
|
|
|
4
4
|
import { CreateConstructorParams } from './with-create-hasura-graphql.mixin';
|
|
5
5
|
import { DeleteConstructorParams } from './with-delete-hasura-graphql.mixin';
|
|
6
6
|
import { GetConstructorParams } from './with-get-hasura-graphql.mixin';
|
|
7
|
-
import {
|
|
7
|
+
import { ConstructorParams } from './with-hasura-graphql.mixin';
|
|
8
8
|
import { UpdateConstructorParams, UpdateHasuraGraphQLRepositoryType } from './with-update-hasura-graphql.mixin';
|
|
9
|
-
export declare const withCrudHasuraGraphQL: <TBase extends ModelBaseStructure<
|
|
9
|
+
export declare const withCrudHasuraGraphQL: <TBase extends ModelBaseStructure<any, any>, Repository = CrudRepository<TBase, import("../../../domain").CrudParams<TBase>>, TMixinBase extends MixinCtor<any, any[]> = MixinCtor<any, any[]>>(MixinBase: MixinCtor<GraphQLRepository<TBase>, any[]> & TMixinBase) => MixinCtor<GraphQLRepository<TBase> & Repository & import("../../../domain").UpdateRepository<TBase, import("../../../domain").RepositoryUpdateParams<TBase>> & {
|
|
10
10
|
paramsToPlain(params: import("../../../domain").RepositoryUpdateParams<TBase>): Partial<TBase>;
|
|
11
|
-
}, MergeConstructorParams<[
|
|
11
|
+
}, MergeConstructorParams<[ConstructorParams<TBase> & CreateConstructorParams & DeleteConstructorParams & GetConstructorParams & UpdateConstructorParams, ...any[]], ConstructorParameters<TMixinBase>>>;
|
|
@@ -4,4 +4,4 @@ import { GraphQLRepository } from '../types';
|
|
|
4
4
|
export declare type DeleteConstructorParams = {
|
|
5
5
|
deleteGraphQLOperation?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const withDeleteHasuraGraphQL: <MBase extends ModelBaseStructure<
|
|
7
|
+
export declare const withDeleteHasuraGraphQL: <MBase extends ModelBaseStructure<any, any>, TMixinBase extends MixinCtor<GraphQLRepository<MBase>, any[]>>(MixinBase: MixinCtor<GraphQLRepository<MBase>, any[]> & TMixinBase) => MixinCtor<GraphQLRepository<MBase> & DeleteRepository<MBase, DeleteRepositoryParams<MBase>> & InstanceType<TMixinBase>, MergeConstructorParams<[DeleteConstructorParams, ...any[]], ConstructorParameters<TMixinBase>>>;
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export declare const withFindHasuraGraphQL: <MBase extends ModelBaseStructure<
|
|
1
|
+
import { ModelBaseStructure, NonFunctionPropertyNames, RepositoryFindFielters, RepositoryFindResult, RepositoryLimitOptions, RepositoryOrderBy } from '../../../domain';
|
|
2
|
+
import { MixinCtor } from '../../../utils';
|
|
3
|
+
import { GraphQLRepository } from '../types';
|
|
4
|
+
export declare const withFindHasuraGraphQL: <MBase extends ModelBaseStructure<any, any>, TMixinBase extends MixinCtor<GraphQLRepository<MBase>, any[]>>(MixinBase: MixinCtor<GraphQLRepository<MBase>, any[]> & TMixinBase) => {
|
|
5
5
|
new (...args: any[]): {
|
|
6
|
-
find(
|
|
7
|
-
|
|
6
|
+
find(options?: {
|
|
7
|
+
filters?: RepositoryFindFielters<MBase>;
|
|
8
|
+
fields?: NonFunctionPropertyNames<MBase, keyof MBase>[];
|
|
9
|
+
limits?: RepositoryLimitOptions<MBase>;
|
|
10
|
+
orderBy?: RepositoryOrderBy<MBase>;
|
|
11
|
+
}): Promise<RepositoryFindResult<MBase>>;
|
|
8
12
|
tableName: string;
|
|
9
|
-
model: import("../../../domain").BaseModelBuilder<MBase,
|
|
13
|
+
model: import("../../../domain").BaseModelBuilder<MBase, import("../../../domain").NonFunctionAndIdentifierPropertyNames<MBase>, MBase & {
|
|
10
14
|
prototype: unknown;
|
|
11
15
|
}>;
|
|
12
|
-
fields: HasuraGraphQLFields<MBase>;
|
|
16
|
+
fields: import("../types").HasuraGraphQLFields<MBase>;
|
|
13
17
|
endpoint: string;
|
|
14
18
|
authOptions: import("../types").HasuraGraphQLAuthOptions;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
query: <ReturnFields_1 = any>(operation: string | GraphQLParams<MBase>[], fields?: string[] | HasuraGraphQLFields<MBase>, variables?: import("../types").VariableOptions) => Promise<ReturnFields_1>;
|
|
19
|
+
mutation: <ReturnFields = any>(operation: string, fields?: import("../types").HasuraGraphQLFields<MBase>, variables?: import("../types").VariableOptions) => Promise<ReturnFields>;
|
|
20
|
+
query: <ReturnFields_1 = any>(operation: string | import("../types").GraphQLParams<MBase>[], fields?: import("../types").HasuraGraphQLFields<MBase>, variables?: import("../types").VariableOptions) => Promise<ReturnFields_1>;
|
|
18
21
|
getAttributeGraphQLTypeOf: <FieldValue>(value: FieldValue) => string;
|
|
19
|
-
convertDataFromHasura(data: Record<string, string | number
|
|
22
|
+
convertDataFromHasura: (data: Record<string, string | number>) => MBase;
|
|
20
23
|
convertDataToHasura(instance: MBase, update?: boolean): Record<string, string | number>;
|
|
21
24
|
};
|
|
22
25
|
} & TMixinBase;
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { GetRepositoryParams, ModelBaseStructure } from '../../../domain';
|
|
2
|
-
import {
|
|
2
|
+
import { MixinCtor } from '../../../utils';
|
|
3
3
|
import { GraphQLRepository } from '../types';
|
|
4
4
|
export declare type GetConstructorParams = {
|
|
5
5
|
getGraphQLOperation?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const withGetHasuraGraphQL: <MBase extends ModelBaseStructure<
|
|
7
|
+
export declare const withGetHasuraGraphQL: <MBase extends ModelBaseStructure<any, any>, TMixinBase extends MixinCtor<GraphQLRepository<MBase>, any[]>>(MixinBase: MixinCtor<GraphQLRepository<MBase>, any[]> & TMixinBase) => {
|
|
8
8
|
new (...params: any[]): {
|
|
9
9
|
getGraphQLOperation: string;
|
|
10
10
|
get(identifiers: GetRepositoryParams<MBase>): Promise<MBase>;
|
|
11
11
|
tableName: string;
|
|
12
|
-
model: import("../../../domain").BaseModelBuilder<MBase,
|
|
12
|
+
model: import("../../../domain").BaseModelBuilder<MBase, import("../../../domain").NonFunctionAndIdentifierPropertyNames<MBase>, MBase & {
|
|
13
13
|
prototype: unknown;
|
|
14
14
|
}>;
|
|
15
15
|
fields: import("../types").HasuraGraphQLFields<MBase>;
|
|
16
16
|
endpoint: string;
|
|
17
17
|
authOptions: import("../types").HasuraGraphQLAuthOptions;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
query: <ReturnFields_1 = any>(operation: string | import("../types").GraphQLParams<MBase>[], fields?: string[] | import("../types").HasuraGraphQLFields<MBase>, variables?: import("../types").VariableOptions) => Promise<ReturnFields_1>;
|
|
18
|
+
mutation: <ReturnFields = any>(operation: string, fields?: import("../types").HasuraGraphQLFields<MBase>, variables?: import("../types").VariableOptions) => Promise<ReturnFields>;
|
|
19
|
+
query: <ReturnFields_1 = any>(operation: string | import("../types").GraphQLParams<MBase>[], fields?: import("../types").HasuraGraphQLFields<MBase>, variables?: import("../types").VariableOptions) => Promise<ReturnFields_1>;
|
|
21
20
|
getAttributeGraphQLTypeOf: <FieldValue>(value: FieldValue) => string;
|
|
22
|
-
convertDataFromHasura(data: Record<string, string | number
|
|
21
|
+
convertDataFromHasura: (data: Record<string, string | number>) => MBase;
|
|
23
22
|
convertDataToHasura(instance: MBase, update?: boolean): Record<string, string | number>;
|
|
24
23
|
};
|
|
25
24
|
} & TMixinBase;
|
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
import { BaseModelBuilder, ModelBaseStructure } from '../../../domain';
|
|
2
2
|
import { MergeConstructorParams, MixinCtor } from '../../../utils';
|
|
3
|
-
import {
|
|
4
|
-
declare type
|
|
5
|
-
operation: string;
|
|
6
|
-
fields: Fields;
|
|
7
|
-
variables?: VariableOptions;
|
|
8
|
-
};
|
|
9
|
-
declare type HasuraGraphQLInterceptors<P = QueryBuilderOptions | QueryBuilderOptions[]> = {
|
|
10
|
-
request?: <R>(request: P) => Promise<P & R>;
|
|
11
|
-
response?: <R>(response: R, request: P) => Promise<R>;
|
|
12
|
-
};
|
|
13
|
-
export declare type HasuraConstructorParams<Model extends ModelBaseStructure<Model, Model['identifiersFields'][number]>> = {
|
|
3
|
+
import { GraphQLRepository, HasuraGraphQLAuthOptions, HasuraGraphQLFields } from '../types';
|
|
4
|
+
export declare type ConstructorParams<Model extends ModelBaseStructure> = {
|
|
14
5
|
tableName: string;
|
|
15
6
|
model: BaseModelBuilder<Model>;
|
|
16
7
|
fields: HasuraGraphQLFields<Model>;
|
|
17
8
|
endpoint: string;
|
|
18
|
-
interceptors?: HasuraGraphQLInterceptors;
|
|
19
9
|
authOptions: HasuraGraphQLAuthOptions;
|
|
20
10
|
};
|
|
21
|
-
export declare const withHasuraGraphQL: <MBase extends ModelBaseStructure<
|
|
22
|
-
export {};
|
|
11
|
+
export declare const withHasuraGraphQL: <MBase extends ModelBaseStructure<any, any>, T extends MixinCtor<any, any[]> = MixinCtor<any, any[]>>(MixinBase: T) => MixinCtor<GraphQLRepository<MBase>, MergeConstructorParams<any[], ConstructorParameters<T>>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModelBaseStructure, RepositoryUpdateParams, UpdateRepository } from '../../../domain';
|
|
2
2
|
import { MergeConstructorParams, MixinCtor } from '../../../utils';
|
|
3
3
|
import { GraphQLRepository } from '../types';
|
|
4
|
-
export declare type UpdateHasuraGraphQLRepositoryType<MBase extends ModelBaseStructure
|
|
4
|
+
export declare type UpdateHasuraGraphQLRepositoryType<MBase extends ModelBaseStructure> = UpdateRepository<MBase> & {
|
|
5
5
|
paramsToPlain(params: RepositoryUpdateParams<MBase>): Partial<MBase>;
|
|
6
6
|
};
|
|
7
7
|
export declare type UpdateConstructorParams = {
|
|
@@ -9,6 +9,6 @@ export declare type UpdateConstructorParams = {
|
|
|
9
9
|
updateGraphQLObjectType?: string;
|
|
10
10
|
updateGraphQLPKType?: string;
|
|
11
11
|
};
|
|
12
|
-
export declare const withUpdateHasuraGraphQL: <MBase extends ModelBaseStructure<
|
|
12
|
+
export declare const withUpdateHasuraGraphQL: <MBase extends ModelBaseStructure<any, any>, TMixinBase extends MixinCtor<GraphQLRepository<MBase>, any[]>>(MixinBase: MixinCtor<GraphQLRepository<MBase>, any[]> & TMixinBase) => MixinCtor<GraphQLRepository<MBase> & UpdateRepository<MBase, RepositoryUpdateParams<MBase>> & {
|
|
13
13
|
paramsToPlain(params: RepositoryUpdateParams<MBase>): Partial<MBase>;
|
|
14
14
|
} & InstanceType<TMixinBase>, MergeConstructorParams<[UpdateConstructorParams, ...any[]], ConstructorParameters<TMixinBase>>>;
|
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
import { Category, CategoryRepository, CreateRepositoryParams, GetRepositoryParams, Product, Shops, UpdateRepositoryParams } from '../../../../domain';
|
|
2
|
-
import { HasuraConstructorParams } from '../../mixins';
|
|
3
2
|
import { CategoryHasuraGraphQL } from '../../models';
|
|
4
|
-
import {
|
|
3
|
+
import { HasuraGraphQLAuthOptions } from '../../types';
|
|
5
4
|
import { ProductHasuraGraphQLRepository } from './product-hasura-graphql.repository';
|
|
6
|
-
declare const CategoryHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("
|
|
5
|
+
declare const CategoryHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("../../types").GraphQLRepository<CategoryHasuraGraphQL> & import("../../../../domain").CrudRepository<CategoryHasuraGraphQL, import("../../../../domain").CrudParams<CategoryHasuraGraphQL>> & import("../../../../domain").UpdateRepository<CategoryHasuraGraphQL, import("../../../../domain").RepositoryUpdateParams<CategoryHasuraGraphQL>> & {
|
|
7
6
|
paramsToPlain(params: import("../../../../domain").RepositoryUpdateParams<CategoryHasuraGraphQL>): Partial<CategoryHasuraGraphQL>;
|
|
8
|
-
}, [
|
|
7
|
+
}, [import("../../mixins").ConstructorParams<CategoryHasuraGraphQL> & import("../../mixins").CreateConstructorParams & import("../../mixins").DeleteConstructorParams & import("../../mixins").GetConstructorParams & import("../../mixins").UpdateConstructorParams, ...any[]]>;
|
|
9
8
|
export declare class CategoryHasuraGraphQLRepository extends CategoryHasuraGraphQLRepository_base implements CategoryRepository {
|
|
10
9
|
private readonly productRepository;
|
|
11
|
-
|
|
12
|
-
constructor({ endpoint, authOptions, interceptors, }: Pick<HasuraConstructorParams<CategoryHasuraGraphQL>, 'endpoint' | 'authOptions' | 'interceptors'>, productRepository: ProductHasuraGraphQLRepository, categoryFilterRepository: CategoryFilterHasuraGraphQLRepository);
|
|
10
|
+
constructor(endpoint: string, authOptions: HasuraGraphQLAuthOptions, productRepository: ProductHasuraGraphQLRepository);
|
|
13
11
|
create(params: CreateRepositoryParams<CategoryHasuraGraphQL>): Promise<CategoryHasuraGraphQL>;
|
|
14
12
|
get(identifiers: GetRepositoryParams<CategoryHasuraGraphQL>): Promise<CategoryHasuraGraphQL>;
|
|
15
13
|
update(params: UpdateRepositoryParams<CategoryHasuraGraphQL>): Promise<CategoryHasuraGraphQL>;
|
|
16
14
|
getCategoryBySlug(slug: string, shop: Shops): Promise<Category>;
|
|
17
|
-
|
|
18
|
-
getCategoriesForHome(categoryIds: string[], limit?: number, gender?: string): Promise<{
|
|
15
|
+
getCategoriesForHome(categoryIds: string[], limit?: number): Promise<{
|
|
19
16
|
category: Category;
|
|
20
17
|
products: Product[];
|
|
21
18
|
}[]>;
|
|
22
19
|
mountCategory(category: Category, options?: {
|
|
23
20
|
limit?: number;
|
|
24
21
|
hasStock?: boolean;
|
|
25
|
-
gender?: string;
|
|
26
22
|
}): Promise<Product[]>;
|
|
27
23
|
private getId;
|
|
28
24
|
private updateProducts;
|
|
29
25
|
private updateMetadata;
|
|
30
|
-
private updateFilters;
|
|
31
26
|
}
|
|
32
27
|
export {};
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export * from './category-collection-children-hasura-graphql.repository';
|
|
2
|
-
export * from './category-filter-hasura-graphql.repository';
|
|
3
1
|
export * from './category-hasura-graphql.repository';
|
|
4
|
-
export * from './filter-hasura-graphql.repository';
|
|
5
|
-
export * from './filter-option-hasura-graphql.repository';
|
|
6
2
|
export * from './product-hasura-graphql.repository';
|
|
7
3
|
export * from './variant-hasura-graphql.repository';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CreateRepositoryParams, FindRepositoryParams, GetRepositoryParams, ProductRepository, RepositoryFindResult, ReviewStatusParams, ReviewWithProductData, UpdateRepositoryParams } from '../../../../domain';
|
|
2
|
-
import { HasuraConstructorParams } from '../../mixins';
|
|
3
2
|
import { ProductHasuraGraphQL } from '../../models';
|
|
3
|
+
import { HasuraGraphQLAuthOptions } from '../../types';
|
|
4
4
|
declare const ProductHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("../../types").GraphQLRepository<ProductHasuraGraphQL> & import("../../../../domain").CrudRepository<ProductHasuraGraphQL, import("../../../../domain").CrudParams<ProductHasuraGraphQL>> & import("../../../../domain").UpdateRepository<ProductHasuraGraphQL, import("../../../../domain").RepositoryUpdateParams<ProductHasuraGraphQL>> & {
|
|
5
5
|
paramsToPlain(params: import("../../../../domain").RepositoryUpdateParams<ProductHasuraGraphQL>): Partial<ProductHasuraGraphQL>;
|
|
6
|
-
}, [
|
|
6
|
+
}, [import("../../mixins").ConstructorParams<ProductHasuraGraphQL> & import("../../mixins").CreateConstructorParams & import("../../mixins").DeleteConstructorParams & import("../../mixins").GetConstructorParams & import("../../mixins").UpdateConstructorParams, ...any[]]>;
|
|
7
7
|
export declare class ProductHasuraGraphQLRepository extends ProductHasuraGraphQLRepository_base implements ProductRepository {
|
|
8
8
|
private get reviewsFields();
|
|
9
|
-
constructor(
|
|
9
|
+
constructor(endpoint: string, authOptions: HasuraGraphQLAuthOptions);
|
|
10
10
|
create(params: CreateRepositoryParams<ProductHasuraGraphQL>): Promise<ProductHasuraGraphQL>;
|
|
11
11
|
get(identifiers: GetRepositoryParams<ProductHasuraGraphQL>): Promise<ProductHasuraGraphQL>;
|
|
12
12
|
find(params?: FindRepositoryParams<ProductHasuraGraphQL>): Promise<RepositoryFindResult<ProductHasuraGraphQL>>;
|
|
@@ -24,6 +24,5 @@ export declare class ProductHasuraGraphQLRepository extends ProductHasuraGraphQL
|
|
|
24
24
|
private getReviewByAuthorAndEmail;
|
|
25
25
|
private bindReviewToModel;
|
|
26
26
|
private bindReviewToHasura;
|
|
27
|
-
cleanShoppingCountFromIds(ids: string[]): Promise<void>;
|
|
28
27
|
}
|
|
29
28
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FindRepositoryParams, GetRepositoryParams, RepositoryFindResult, UpdateRepositoryParams, VariantRepository } from '../../../../domain';
|
|
2
|
-
import { HasuraConstructorParams } from '../../mixins';
|
|
3
2
|
import { VariantHasuraGraphQL } from '../../models';
|
|
4
|
-
|
|
3
|
+
import { HasuraGraphQLAuthOptions } from '../../types';
|
|
4
|
+
declare const VariantHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("../../types").GraphQLRepository<VariantHasuraGraphQL> & import("../../../../domain").CrudRepository<VariantHasuraGraphQL, import("../../../../domain").CrudParams<VariantHasuraGraphQL>> & import("../../../../domain").UpdateRepository<VariantHasuraGraphQL, import("../../../../domain").RepositoryUpdateParams<VariantHasuraGraphQL>> & {
|
|
5
5
|
paramsToPlain(params: import("../../../../domain").RepositoryUpdateParams<VariantHasuraGraphQL>): Partial<VariantHasuraGraphQL>;
|
|
6
|
-
}, [
|
|
6
|
+
}, [import("../../mixins").ConstructorParams<VariantHasuraGraphQL> & import("../../mixins").CreateConstructorParams & import("../../mixins").DeleteConstructorParams & import("../../mixins").GetConstructorParams & import("../../mixins").UpdateConstructorParams, ...any[]]>;
|
|
7
7
|
export declare class VariantHasuraGraphQLRepository extends VariantHasuraGraphQLRepository_base implements VariantRepository {
|
|
8
|
-
constructor(
|
|
8
|
+
constructor(endpoint: string, authOptions: HasuraGraphQLAuthOptions);
|
|
9
9
|
get(identifiers: GetRepositoryParams<VariantHasuraGraphQL>): Promise<VariantHasuraGraphQL>;
|
|
10
10
|
find(params?: FindRepositoryParams<VariantHasuraGraphQL>): Promise<RepositoryFindResult<VariantHasuraGraphQL>>;
|
|
11
11
|
update(params: UpdateRepositoryParams<VariantHasuraGraphQL>): Promise<VariantHasuraGraphQL>;
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import { BaseModelBuilder, ModelBaseStructure } from '../../../domain';
|
|
2
|
-
import { DebugHelper } from '../../../utils';
|
|
3
2
|
import { HasuraGraphQLAuthOptions } from './hasura-graphql-auth-options.type';
|
|
4
3
|
import { HasuraGraphQLFields } from './hasura-graphql-fields.type';
|
|
5
4
|
import { VariableOptions } from './variable-options.type';
|
|
6
|
-
export declare type GraphQLParams<Model extends ModelBaseStructure
|
|
5
|
+
export declare type GraphQLParams<Model extends ModelBaseStructure> = {
|
|
7
6
|
operation: string;
|
|
8
7
|
fields?: HasuraGraphQLFields<Model>;
|
|
9
8
|
variables?: VariableOptions;
|
|
10
9
|
};
|
|
11
|
-
export declare type GraphQLRepository<Model extends ModelBaseStructure
|
|
10
|
+
export declare type GraphQLRepository<Model extends ModelBaseStructure> = {
|
|
12
11
|
tableName: string;
|
|
13
12
|
model: BaseModelBuilder<Model>;
|
|
14
13
|
fields: HasuraGraphQLFields<Model>;
|
|
15
14
|
endpoint: string;
|
|
16
15
|
authOptions: HasuraGraphQLAuthOptions;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
query: <ReturnFields = any>(operation: string | GraphQLParams<Model>[], fields?: string[] | HasuraGraphQLFields<Model>, variables?: VariableOptions) => Promise<ReturnFields>;
|
|
16
|
+
mutation: <ReturnFields = any>(operation: string, fields?: HasuraGraphQLFields<Model>, variables?: VariableOptions) => Promise<ReturnFields>;
|
|
17
|
+
query: <ReturnFields = any>(operation: string | GraphQLParams<Model>[], fields?: HasuraGraphQLFields<Model>, variables?: VariableOptions) => Promise<ReturnFields>;
|
|
20
18
|
getAttributeGraphQLTypeOf: <FieldValue>(value: FieldValue) => string;
|
|
21
|
-
convertDataFromHasura(data: Record<string, string | number
|
|
19
|
+
convertDataFromHasura: (data: Record<string, string | number>) => Model;
|
|
22
20
|
convertDataToHasura(instance: Model, update?: boolean): Record<string, string | number>;
|
|
23
21
|
};
|
|
@@ -8,7 +8,7 @@ export declare type ColumnOptions<FieldType, Model, ValueFrom = any> = {
|
|
|
8
8
|
filterType: HasuraGraphQLColumnType | string;
|
|
9
9
|
filters: NestedRepositoryFindFieltersOptions<FieldType>;
|
|
10
10
|
};
|
|
11
|
-
fields?: HasuraGraphQLFields<FieldType>;
|
|
11
|
+
fields?: HasuraGraphQLFields<FieldType extends any[] ? FieldType[number] : FieldType>;
|
|
12
12
|
foreignKeyColumn?: Partial<Record<NonFunctionAndIdentifierPropertyNames<FieldType extends any[] ? FieldType[number] : FieldType>, NonFunctionAndIdentifierPropertyNames<Model> | (string & {})>> | {};
|
|
13
13
|
from?: (value: ValueFrom | ValueFrom[], data?: any) => FieldType;
|
|
14
14
|
to?: (value: FieldType, instance?: Model) => ValueFrom;
|
|
@@ -31,14 +31,10 @@ export declare type AggregateOptions<Model> = {
|
|
|
31
31
|
var_samp?: Array<AggregateOptionFields<Model, number>>;
|
|
32
32
|
variance?: Array<AggregateOptionFields<Model, number>>;
|
|
33
33
|
};
|
|
34
|
-
declare type
|
|
34
|
+
export declare type HasuraGraphQLFields<Model> = ((Model extends ModelBaseStructure ? NonFunctionAndIdentifierPropertyNames<Model> | {
|
|
35
35
|
[key in NonFunctionAndIdentifierPropertyNames<Model>]?: PropType<Model, key> extends ModelBaseStructure ? HasuraGraphQLFields<PropType<Model, key>> : PropType<Model, key> extends any[] ? PropType<Model, key>[] extends ModelBaseStructure[] ? HasuraGraphQLFields<PropType<Model, key>[]> : never : never;
|
|
36
36
|
} | {
|
|
37
37
|
[key in NonFunctionAndIdentifierPropertyNames<Model>]?: key extends 'aggregate' ? never : PropType<Model, key> extends ModelBaseStructure ? ColumnOptions<PropType<Model, key>, Model> : ColumnOptions<PropType<Model, key>, Model>;
|
|
38
|
-
} |
|
|
39
|
-
export declare type HasuraGraphQLFields<Model> = (ModelBaseHasuraGraphQLFields<Model> | {
|
|
38
|
+
} | (string & {}) : string) | {
|
|
40
39
|
aggregate: Array<AggregateOptions<Model> | 'count'>;
|
|
41
|
-
} | {
|
|
42
|
-
returning: NonFunctionAndIdentifierPropertyNames<Model>[];
|
|
43
40
|
} | 'affected_rows')[];
|
|
44
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrab4a/connect",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"axios": "^0.27.2",
|
|
13
13
|
"class-transformer": "^0.5.1",
|
|
14
14
|
"date-fns": "^2.28.0",
|
|
15
|
-
"debug": "^4.3.4",
|
|
16
15
|
"firebase": "^9.9.0",
|
|
17
16
|
"gql-query-builder": "3.7.0",
|
|
18
17
|
"lodash": "^4.17.21",
|
package/utils/index.d.ts
CHANGED
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
import { add, addBusinessDays, addDays, addMonths, addYears, Duration, endOfDay, format, formatISO9075, parseISO, startOfDay, sub } from 'date-fns';
|
|
2
|
-
import
|
|
2
|
+
import * as lodash from 'lodash';
|
|
3
3
|
export declare type DateDuration = Duration;
|
|
4
|
-
|
|
4
|
+
declare const chunk: <T>(array: lodash.List<T>, size?: number) => T[][], isBoolean: (value?: any) => value is boolean, isDate: (value?: any) => value is Date, isEmpty: {
|
|
5
|
+
<T extends {
|
|
6
|
+
__trapAny: any;
|
|
7
|
+
}>(value?: T): boolean;
|
|
8
|
+
(value: string): value is "";
|
|
9
|
+
(value: Map<any, any> | Set<any> | lodash.List<any>): boolean;
|
|
10
|
+
(value: object): boolean;
|
|
11
|
+
<T_1 extends object>(value: T_1): value is lodash.EmptyObjectOf<T_1>;
|
|
12
|
+
(value?: any): boolean;
|
|
13
|
+
}, isInteger: (value?: any) => boolean, isNaN: (value?: any) => boolean, isNil: (value: any) => value is null, isNumber: (value?: any) => value is number, isObject: (value?: any) => value is object, isString: (value?: any) => value is string, now: () => number, omit: {
|
|
14
|
+
<T extends object, K extends lodash.PropertyName[]>(object: T, ...paths: K): Pick<T, Exclude<keyof T, K[number]>>;
|
|
15
|
+
<T_1 extends object, K_1 extends keyof T_1>(object: T_1, ...paths: lodash.Many<K_1>[]): lodash.Omit<T_1, K_1>;
|
|
16
|
+
<T_2 extends object>(object: T_2, ...paths: lodash.Many<lodash.PropertyName>[]): Partial<T_2>;
|
|
17
|
+
}, pick: {
|
|
18
|
+
<T extends object, U extends keyof T>(object: T, ...props: lodash.Many<U>[]): Pick<T, U>;
|
|
19
|
+
<T_1>(object: T_1, ...props: lodash.Many<lodash.PropertyPath>[]): Partial<T_1>;
|
|
20
|
+
}, set: {
|
|
21
|
+
<T extends object>(object: T, path: lodash.PropertyPath, value: any): T;
|
|
22
|
+
<TResult>(object: object, path: lodash.PropertyPath, value: any): TResult;
|
|
23
|
+
};
|
|
5
24
|
export * from './get';
|
|
6
|
-
export * from './helpers';
|
|
7
25
|
export * from './is';
|
|
8
26
|
export * from './is-uuid';
|
|
9
|
-
export * from './log.utils';
|
|
10
27
|
export * from './mixins';
|
|
11
28
|
export * from './parse-datetime';
|
|
12
29
|
export * from './types';
|
|
13
|
-
export { add, addDays, addBusinessDays, addMonths, addYears, chunk,
|
|
30
|
+
export { add, addDays, addBusinessDays, addMonths, addYears, chunk, endOfDay, format, formatISO9075, isBoolean, isDate, isEmpty, isInteger, isNil, isNaN, isNumber, isObject, isString, parseISO, now, omit, pick, set, startOfDay, sub, };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './RoundProdutcPriceHelper';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BaseModel } from '../../generic/model';
|
|
2
|
-
export declare type CategoryCollectionChildrenIdentifiers = 'collectionId' | 'categoryId';
|
|
3
|
-
export declare class CategoryCollectionChildren extends BaseModel<CategoryCollectionChildren, CategoryCollectionChildrenIdentifiers> {
|
|
4
|
-
collectionId: number;
|
|
5
|
-
categoryId: number;
|
|
6
|
-
parentCollectionId?: number;
|
|
7
|
-
parentCategoryId?: number;
|
|
8
|
-
name: string;
|
|
9
|
-
slug: string;
|
|
10
|
-
reference?: string;
|
|
11
|
-
parent?: CategoryCollectionChildren;
|
|
12
|
-
static get identifiersFields(): CategoryCollectionChildrenIdentifiers[];
|
|
13
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BaseModel } from '../../generic/model';
|
|
2
|
-
import { Filter } from './filter';
|
|
3
|
-
declare type CategoryFilterIdentifiers = 'id' | 'filterId' | 'categoryId';
|
|
4
|
-
export declare class CategoryFilter extends BaseModel<CategoryFilter, CategoryFilterIdentifiers> {
|
|
5
|
-
id: number;
|
|
6
|
-
filterId: number;
|
|
7
|
-
categoryId: number;
|
|
8
|
-
filter?: Filter;
|
|
9
|
-
static get identifiersFields(): CategoryFilterIdentifiers[];
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
|
-
export declare class FilterOption extends BaseModel<FilterOption> {
|
|
3
|
-
id: string;
|
|
4
|
-
filterId: number;
|
|
5
|
-
description: string;
|
|
6
|
-
createdAt?: Date;
|
|
7
|
-
updatedAt?: Date;
|
|
8
|
-
static get identifiersFields(): GenericIdentifier[];
|
|
9
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
|
-
import { FilterOption } from './filter-option';
|
|
3
|
-
export declare class Filter extends BaseModel<Filter> {
|
|
4
|
-
id: number;
|
|
5
|
-
description: string;
|
|
6
|
-
slug: string;
|
|
7
|
-
enabled: boolean;
|
|
8
|
-
options?: FilterOption[];
|
|
9
|
-
createdAt?: Date;
|
|
10
|
-
updatedAt?: Date;
|
|
11
|
-
static get identifiersFields(): GenericIdentifier[];
|
|
12
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CrudRepository } from '../../generic/repository/crud.repository';
|
|
2
|
-
import { CategoryFilter } from '../models';
|
|
3
|
-
export interface CategoryFilterRepository extends CrudRepository<CategoryFilter> {
|
|
4
|
-
deleteByCategoryAndFilter(categoryId: number, filterId: number): Promise<any>;
|
|
5
|
-
}
|