@infrab4a/connect-angular 5.5.0-beta.9 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/angular-firestore.module.mjs +16 -2
- package/esm2020/services/catalog/helpers/brand-manager.helper.mjs +7 -8
- package/esm2020/services/catalog/helpers/product-fields.helper.mjs +2 -1
- package/esm2020/services/catalog/strategies/term-search.strategy.mjs +5 -2
- package/esm2020/services/catalog/strategies/types/strategy-params.type.mjs +1 -1
- package/esm2020/services/checkout.service.mjs +2 -2
- package/fesm2015/infrab4a-connect-angular.mjs +28 -20
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +27 -10
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +2 -2
- package/services/catalog/strategies/types/strategy-params.type.d.ts +1 -0
|
@@ -7,7 +7,7 @@ import { provideAppCheck, initializeAppCheck } from '@angular/fire/app-check';
|
|
|
7
7
|
import * as i3 from '@angular/fire/storage';
|
|
8
8
|
import { Storage, provideStorage, getStorage } from '@angular/fire/storage';
|
|
9
9
|
import * as i1$3 from '@infrab4a/connect';
|
|
10
|
-
import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ConnectFirestoreService, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, GroupFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, OrderBlockedFirestoreRepository, LogFirestoreRepository, SequenceFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewHasuraGraphQLRepository, VariantHasuraGraphQLRepository, ProductStockNotificationHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryProductHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, ProductErrorsHasuraGraphQLRepository, ProductCatalogHasuraGraphQLRepository, ProductsVertexSearch, VertexAxiosAdapter, isNil, NotFoundError, Checkout, pick, LineItem, Where, isEmpty, Shops, set, InvalidArgumentError, RoundProductPricesHelper, Category, WishlistLogType, PersonTypes, Wishlist, CheckoutTypes, CouponTypes, Exclusivities, OrderStatus, CheckoutSubscription, Product, RequiredArgumentError, add, ProductReview, Order, UpdateUserImage, FirebaseFileUploaderService } from '@infrab4a/connect';
|
|
10
|
+
import { ProductsIndex, AxiosAdapter, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ConnectFirestoreService, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, GroupFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, OrderBlockedFirestoreRepository, LogFirestoreRepository, SequenceFirestoreRepository, BrandCategoryFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewHasuraGraphQLRepository, VariantHasuraGraphQLRepository, ProductStockNotificationHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryProductHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, ProductErrorsHasuraGraphQLRepository, ProductCatalogHasuraGraphQLRepository, ProductsVertexSearch, VertexAxiosAdapter, isNil, NotFoundError, Checkout, pick, LineItem, Where, isEmpty, Shops, set, InvalidArgumentError, RoundProductPricesHelper, Category, WishlistLogType, PersonTypes, Wishlist, CheckoutTypes, CouponTypes, Exclusivities, OrderStatus, CheckoutSubscription, Product, RequiredArgumentError, add, ProductReview, Order, UpdateUserImage, FirebaseFileUploaderService } from '@infrab4a/connect';
|
|
11
11
|
import * as i1 from '@angular/fire/auth';
|
|
12
12
|
import { Auth, provideAuth, initializeAuth, indexedDBLocalPersistence, browserLocalPersistence, browserSessionPersistence, getAuth, getIdToken, authState } from '@angular/fire/auth';
|
|
13
13
|
import { isPlatformBrowser, isPlatformServer } from '@angular/common';
|
|
@@ -464,6 +464,13 @@ AngularFirestoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
|
|
|
464
464
|
},
|
|
465
465
|
deps: ['FirestoreOptions'],
|
|
466
466
|
},
|
|
467
|
+
{
|
|
468
|
+
provide: 'BrandCategoryRepository',
|
|
469
|
+
useFactory: (options) => {
|
|
470
|
+
return new BrandCategoryFirestoreRepository(options);
|
|
471
|
+
},
|
|
472
|
+
deps: ['FirestoreOptions'],
|
|
473
|
+
},
|
|
467
474
|
], imports: [AngularElasticSeachModule,
|
|
468
475
|
provideFirestore((injector) => {
|
|
469
476
|
const platformId = injector.get(PLATFORM_ID);
|
|
@@ -737,6 +744,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
|
|
|
737
744
|
},
|
|
738
745
|
deps: ['FirestoreOptions'],
|
|
739
746
|
},
|
|
747
|
+
{
|
|
748
|
+
provide: 'BrandCategoryRepository',
|
|
749
|
+
useFactory: (options) => {
|
|
750
|
+
return new BrandCategoryFirestoreRepository(options);
|
|
751
|
+
},
|
|
752
|
+
deps: ['FirestoreOptions'],
|
|
753
|
+
},
|
|
740
754
|
],
|
|
741
755
|
}]
|
|
742
756
|
}] });
|
|
@@ -1312,7 +1326,7 @@ class CheckoutService {
|
|
|
1312
1326
|
})), concatMap(() => this.getCheckout()));
|
|
1313
1327
|
}
|
|
1314
1328
|
createOrder(checkoutPayload, paymentProvider, applicationVersion) {
|
|
1315
|
-
return this.dependenciesFacade.httpClient.post(`${this.checkoutUrl}/
|
|
1329
|
+
return this.dependenciesFacade.httpClient.post(`${this.checkoutUrl}/checkout`, {
|
|
1316
1330
|
data: Object.assign(Object.assign({}, checkoutPayload), { applicationVersion,
|
|
1317
1331
|
paymentProvider }),
|
|
1318
1332
|
});
|
|
@@ -1699,6 +1713,7 @@ class TermSearchStrategy {
|
|
|
1699
1713
|
limits,
|
|
1700
1714
|
shop,
|
|
1701
1715
|
mainGender,
|
|
1716
|
+
sort,
|
|
1702
1717
|
fields: this.helpersService.getFieldsHelper().getStandardFields(),
|
|
1703
1718
|
});
|
|
1704
1719
|
});
|
|
@@ -1724,19 +1739,15 @@ class TermSearchStrategy {
|
|
|
1724
1739
|
}
|
|
1725
1740
|
searchDefault(params) {
|
|
1726
1741
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1727
|
-
const { productIds, filters, limits, shop, mainGender, fields } = params;
|
|
1742
|
+
const { productIds, filters, limits, sort, shop, mainGender, fields } = params;
|
|
1728
1743
|
const productCatalog = this.repositoryService.getProductCatalog();
|
|
1729
1744
|
const filterHelper = this.helpersService.getFilterHelper();
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
filters: Object.assign({ id: { operator: Where.IN, value: productIds }, published: { operator: Where.EQUALS, value: true } }, filterHelper.buildFilterQuery(filters || {})),
|
|
1733
|
-
limits,
|
|
1734
|
-
options: {
|
|
1745
|
+
const sortHelper = this.helpersService.getSortHelper();
|
|
1746
|
+
return productCatalog.productCatalogRepository.findCatalog(Object.assign(Object.assign({ fields, filters: Object.assign({ id: { operator: Where.IN, value: productIds }, published: { operator: Where.EQUALS, value: true } }, filterHelper.buildFilterQuery(filters || {})), limits }, (sort ? { orderBy: sortHelper.buildSortQuery(sort) } : {})), { options: {
|
|
1735
1747
|
minimal: ['price'],
|
|
1736
1748
|
maximum: ['price'],
|
|
1737
1749
|
distinct: ['brand'],
|
|
1738
|
-
}
|
|
1739
|
-
});
|
|
1750
|
+
} }));
|
|
1740
1751
|
});
|
|
1741
1752
|
}
|
|
1742
1753
|
sortByTermRelevance(params) {
|
|
@@ -1941,13 +1952,7 @@ class BrandManagerHelper {
|
|
|
1941
1952
|
if (isEmpty(brands) && options.filters) {
|
|
1942
1953
|
delete options.filters.brands;
|
|
1943
1954
|
}
|
|
1944
|
-
|
|
1945
|
-
this.brandsList[indexKey] = yield this.fetchBrandsOnly(options);
|
|
1946
|
-
}
|
|
1947
|
-
else {
|
|
1948
|
-
this.brandsList[indexKey] = this.brandsList[indexKey] || brands;
|
|
1949
|
-
}
|
|
1950
|
-
// this.brandsList[indexKey] = this.brandsList[indexKey] || brands || (await this.fetchBrandsOnly(options))
|
|
1955
|
+
this.brandsList[indexKey] = this.brandsList[indexKey] || brands || (yield this.fetchBrandsOnly(options));
|
|
1951
1956
|
this.brandsList[indexKey] = this.brandsList[indexKey].filter(Boolean);
|
|
1952
1957
|
if (options.filters) {
|
|
1953
1958
|
options.filters = Object.assign(Object.assign({}, options.filters), { brands: filterBrands });
|
|
@@ -1968,12 +1973,14 @@ class BrandManagerHelper {
|
|
|
1968
1973
|
}
|
|
1969
1974
|
fetchBrandsOnly(options) {
|
|
1970
1975
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1976
|
+
let filters = {};
|
|
1977
|
+
if (options.category) {
|
|
1978
|
+
filters = yield this.productCatalog.categoryStructureAdapter.buildProductFilterByCategory(options.category);
|
|
1979
|
+
}
|
|
1971
1980
|
return this.productCatalog.productCatalogRepository
|
|
1972
1981
|
.findCatalog({
|
|
1973
1982
|
fields: ['id'],
|
|
1974
|
-
filters: {
|
|
1975
|
-
published: { operator: Where.EQUALS, value: true },
|
|
1976
|
-
},
|
|
1983
|
+
filters: Object.assign(Object.assign({}, filters), { published: { operator: Where.EQUALS, value: true } }),
|
|
1977
1984
|
options: {
|
|
1978
1985
|
distinct: ['brand'],
|
|
1979
1986
|
},
|
|
@@ -2111,6 +2118,7 @@ class ProductFieldsHelper {
|
|
|
2111
2118
|
'outlet',
|
|
2112
2119
|
'group',
|
|
2113
2120
|
'variantSlug',
|
|
2121
|
+
'filters',
|
|
2114
2122
|
];
|
|
2115
2123
|
}
|
|
2116
2124
|
}
|