@infrab4a/connect-angular 3.4.3-beta.1 → 3.5.0-beta.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/bundles/infrab4a-connect-angular.umd.js +25 -141
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/angular-connect.module.js +5 -5
- package/esm2015/angular-firestore.module.js +3 -31
- package/esm2015/angular-hasura-graphql.module.js +18 -40
- package/esm2015/services/shipping.service.js +8 -7
- package/fesm2015/infrab4a-connect-angular.js +26 -75
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/package.json +3 -3
|
@@ -6,7 +6,7 @@ import { of, combineLatest, from, throwError, Subject, iif, forkJoin } from 'rxj
|
|
|
6
6
|
import { catchError, map, mergeMap, concatMap, tap } from 'rxjs/operators';
|
|
7
7
|
import { __awaiter } from 'tslib';
|
|
8
8
|
import * as i1$1 from '@infrab4a/connect';
|
|
9
|
-
import { Coupon, Where, Shops, CheckoutTypes, CouponTypes, Exclusivities, Status, isNil, NotFoundError, Checkout, pick, LineItem, CheckoutSubscription, Category, Product, RequiredArgumentError, add, Order, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ProductsIndex, AxiosAdapter, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository,
|
|
9
|
+
import { Coupon, Where, Shops, CheckoutTypes, CouponTypes, Exclusivities, Status, isNil, NotFoundError, Checkout, pick, LineItem, CheckoutSubscription, Category, Product, RequiredArgumentError, add, Order, Authentication, AuthenticationFirebaseAuthService, Register, RegisterFirebaseAuthService, SignOut, RecoveryPassword, ProductsIndex, AxiosAdapter, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, SubscriptionEditionFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, ProductVariantFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, VariantHasuraGraphQLRepository, FilterOptionHasuraGraphQL, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository } from '@infrab4a/connect';
|
|
10
10
|
import cookie from 'js-cookie';
|
|
11
11
|
import { CustomError } from 'ts-custom-error';
|
|
12
12
|
import * as i1$2 from '@angular/fire/firestore';
|
|
@@ -713,12 +713,13 @@ class ShippingService {
|
|
|
713
713
|
getShippingMethods(shop, zip, weightGrams, totalPrice, personId, subscriptionPlan) {
|
|
714
714
|
return combineLatest([
|
|
715
715
|
this.homeService.getHomeData(),
|
|
716
|
-
this.http.get(`${this.apiUrl}open/checkshippingcompany?personId=${personId}&postalCode=${zip}&weightGrams=${weightGrams}`)
|
|
717
|
-
])
|
|
716
|
+
this.http.get(`${this.apiUrl}open/checkshippingcompany?personId=${personId}&postalCode=${zip}&weightGrams=${weightGrams}`)
|
|
717
|
+
])
|
|
718
|
+
.pipe(map(([datas, shippingMethodsResponse]) => {
|
|
718
719
|
let shippingMethods = shippingMethodsResponse.result;
|
|
719
720
|
if (!shippingMethods.length)
|
|
720
721
|
return [];
|
|
721
|
-
shippingMethods = shippingMethods.map(
|
|
722
|
+
shippingMethods = shippingMethods.map(s => {
|
|
722
723
|
if (s.ShippingCompanyName == 'Same Day EG')
|
|
723
724
|
s.ShippingCompanyName = 'Same Day';
|
|
724
725
|
else
|
|
@@ -729,7 +730,7 @@ class ShippingService {
|
|
|
729
730
|
shippingMethods = shippingMethods.filter((method) => method.ShippingCompanyName !== 'Same Day');
|
|
730
731
|
}
|
|
731
732
|
if (totalPrice >= 200) {
|
|
732
|
-
shippingMethods = shippingMethods.map(
|
|
733
|
+
shippingMethods = shippingMethods.map(s => {
|
|
733
734
|
if (s.serviceName !== 'Same Day')
|
|
734
735
|
return Object.assign(Object.assign({}, s), { totalPrice: 0 });
|
|
735
736
|
else
|
|
@@ -739,7 +740,7 @@ class ShippingService {
|
|
|
739
740
|
if (shop == Shops.GLAMSHOP)
|
|
740
741
|
return shippingMethods;
|
|
741
742
|
if (this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
|
|
742
|
-
shippingMethods = shippingMethods.map(
|
|
743
|
+
shippingMethods = shippingMethods.map(s => {
|
|
743
744
|
if (s.serviceName == 'Same Day')
|
|
744
745
|
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
745
746
|
else
|
|
@@ -747,7 +748,7 @@ class ShippingService {
|
|
|
747
748
|
});
|
|
748
749
|
}
|
|
749
750
|
if (this.isHalfShippingBySubscription(shop, subscriptionPlan)) {
|
|
750
|
-
shippingMethods = shippingMethods.map(
|
|
751
|
+
shippingMethods = shippingMethods.map(s => {
|
|
751
752
|
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
752
753
|
});
|
|
753
754
|
}
|
|
@@ -991,20 +992,6 @@ AngularFirestoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
|
|
|
991
992
|
},
|
|
992
993
|
deps: [AngularFirestore],
|
|
993
994
|
},
|
|
994
|
-
{
|
|
995
|
-
provide: 'CampaignHashtagRepository',
|
|
996
|
-
useFactory: (firestore) => {
|
|
997
|
-
return new CampaignHashtagFirestoreRepository(firestore.firestore);
|
|
998
|
-
},
|
|
999
|
-
deps: [AngularFirestore],
|
|
1000
|
-
},
|
|
1001
|
-
{
|
|
1002
|
-
provide: 'CampaignDashboardRepository',
|
|
1003
|
-
useFactory: (firestore) => {
|
|
1004
|
-
return new CampaignDashboardFirestoreRepository(firestore.firestore);
|
|
1005
|
-
},
|
|
1006
|
-
deps: [AngularFirestore],
|
|
1007
|
-
},
|
|
1008
995
|
{
|
|
1009
996
|
provide: 'EditionRepository',
|
|
1010
997
|
useFactory: (firestore, subscriptionRepository) => {
|
|
@@ -1171,20 +1158,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImpo
|
|
|
1171
1158
|
},
|
|
1172
1159
|
deps: [AngularFirestore],
|
|
1173
1160
|
},
|
|
1174
|
-
{
|
|
1175
|
-
provide: 'CampaignHashtagRepository',
|
|
1176
|
-
useFactory: (firestore) => {
|
|
1177
|
-
return new CampaignHashtagFirestoreRepository(firestore.firestore);
|
|
1178
|
-
},
|
|
1179
|
-
deps: [AngularFirestore],
|
|
1180
|
-
},
|
|
1181
|
-
{
|
|
1182
|
-
provide: 'CampaignDashboardRepository',
|
|
1183
|
-
useFactory: (firestore) => {
|
|
1184
|
-
return new CampaignDashboardFirestoreRepository(firestore.firestore);
|
|
1185
|
-
},
|
|
1186
|
-
deps: [AngularFirestore],
|
|
1187
|
-
},
|
|
1188
1161
|
{
|
|
1189
1162
|
provide: 'EditionRepository',
|
|
1190
1163
|
useFactory: (firestore, subscriptionRepository) => {
|
|
@@ -1324,10 +1297,10 @@ AngularHasuraGraphQLModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.
|
|
|
1324
1297
|
},
|
|
1325
1298
|
{
|
|
1326
1299
|
provide: CategoryHasuraGraphQLRepository,
|
|
1327
|
-
useFactory: (options, productRepository
|
|
1328
|
-
return new CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository
|
|
1300
|
+
useFactory: (options, productRepository) => {
|
|
1301
|
+
return new CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository);
|
|
1329
1302
|
},
|
|
1330
|
-
deps: [HASURA_OPTIONS, ProductHasuraGraphQLRepository
|
|
1303
|
+
deps: [HASURA_OPTIONS, ProductHasuraGraphQLRepository],
|
|
1331
1304
|
},
|
|
1332
1305
|
{
|
|
1333
1306
|
provide: 'ProductRepository',
|
|
@@ -1351,23 +1324,12 @@ AngularHasuraGraphQLModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.
|
|
|
1351
1324
|
},
|
|
1352
1325
|
deps: [HASURA_OPTIONS],
|
|
1353
1326
|
},
|
|
1354
|
-
{
|
|
1355
|
-
provide: 'CategoryFilterRepository',
|
|
1356
|
-
useExisting: CategoryFilterHasuraGraphQLRepository,
|
|
1357
|
-
},
|
|
1358
|
-
{
|
|
1359
|
-
provide: CategoryFilterHasuraGraphQLRepository,
|
|
1360
|
-
useFactory: (options) => {
|
|
1361
|
-
return new CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1362
|
-
},
|
|
1363
|
-
deps: [HASURA_OPTIONS],
|
|
1364
|
-
},
|
|
1365
1327
|
{
|
|
1366
1328
|
provide: 'FilterOptionRepository',
|
|
1367
|
-
useExisting:
|
|
1329
|
+
useExisting: FilterOptionHasuraGraphQL,
|
|
1368
1330
|
},
|
|
1369
1331
|
{
|
|
1370
|
-
provide:
|
|
1332
|
+
provide: FilterOptionHasuraGraphQL,
|
|
1371
1333
|
useFactory: (options) => {
|
|
1372
1334
|
return new FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1373
1335
|
},
|
|
@@ -1379,10 +1341,10 @@ AngularHasuraGraphQLModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.
|
|
|
1379
1341
|
},
|
|
1380
1342
|
{
|
|
1381
1343
|
provide: FilterHasuraGraphQLRepository,
|
|
1382
|
-
useFactory: (options, filterOptionRepository
|
|
1383
|
-
return new FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository
|
|
1344
|
+
useFactory: (options, filterOptionRepository) => {
|
|
1345
|
+
return new FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository);
|
|
1384
1346
|
},
|
|
1385
|
-
deps: [HASURA_OPTIONS
|
|
1347
|
+
deps: [HASURA_OPTIONS],
|
|
1386
1348
|
},
|
|
1387
1349
|
] });
|
|
1388
1350
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0, type: AngularHasuraGraphQLModule, decorators: [{
|
|
@@ -1395,10 +1357,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImpo
|
|
|
1395
1357
|
},
|
|
1396
1358
|
{
|
|
1397
1359
|
provide: CategoryHasuraGraphQLRepository,
|
|
1398
|
-
useFactory: (options, productRepository
|
|
1399
|
-
return new CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository
|
|
1360
|
+
useFactory: (options, productRepository) => {
|
|
1361
|
+
return new CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository);
|
|
1400
1362
|
},
|
|
1401
|
-
deps: [HASURA_OPTIONS, ProductHasuraGraphQLRepository
|
|
1363
|
+
deps: [HASURA_OPTIONS, ProductHasuraGraphQLRepository],
|
|
1402
1364
|
},
|
|
1403
1365
|
{
|
|
1404
1366
|
provide: 'ProductRepository',
|
|
@@ -1422,23 +1384,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImpo
|
|
|
1422
1384
|
},
|
|
1423
1385
|
deps: [HASURA_OPTIONS],
|
|
1424
1386
|
},
|
|
1425
|
-
{
|
|
1426
|
-
provide: 'CategoryFilterRepository',
|
|
1427
|
-
useExisting: CategoryFilterHasuraGraphQLRepository,
|
|
1428
|
-
},
|
|
1429
|
-
{
|
|
1430
|
-
provide: CategoryFilterHasuraGraphQLRepository,
|
|
1431
|
-
useFactory: (options) => {
|
|
1432
|
-
return new CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1433
|
-
},
|
|
1434
|
-
deps: [HASURA_OPTIONS],
|
|
1435
|
-
},
|
|
1436
1387
|
{
|
|
1437
1388
|
provide: 'FilterOptionRepository',
|
|
1438
|
-
useExisting:
|
|
1389
|
+
useExisting: FilterOptionHasuraGraphQL,
|
|
1439
1390
|
},
|
|
1440
1391
|
{
|
|
1441
|
-
provide:
|
|
1392
|
+
provide: FilterOptionHasuraGraphQL,
|
|
1442
1393
|
useFactory: (options) => {
|
|
1443
1394
|
return new FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
1444
1395
|
},
|
|
@@ -1450,10 +1401,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImpo
|
|
|
1450
1401
|
},
|
|
1451
1402
|
{
|
|
1452
1403
|
provide: FilterHasuraGraphQLRepository,
|
|
1453
|
-
useFactory: (options, filterOptionRepository
|
|
1454
|
-
return new FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository
|
|
1404
|
+
useFactory: (options, filterOptionRepository) => {
|
|
1405
|
+
return new FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository);
|
|
1455
1406
|
},
|
|
1456
|
-
deps: [HASURA_OPTIONS
|
|
1407
|
+
deps: [HASURA_OPTIONS],
|
|
1457
1408
|
},
|
|
1458
1409
|
],
|
|
1459
1410
|
}]
|
|
@@ -1484,7 +1435,7 @@ AngularConnectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
|
|
|
1484
1435
|
CouponService,
|
|
1485
1436
|
HomeShopService,
|
|
1486
1437
|
OrderService,
|
|
1487
|
-
ShippingService
|
|
1438
|
+
ShippingService
|
|
1488
1439
|
], imports: [[AngularFireModule, AngularFirestoreModule, AngularHasuraGraphQLModule]] });
|
|
1489
1440
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0, type: AngularConnectModule, decorators: [{
|
|
1490
1441
|
type: NgModule,
|
|
@@ -1498,7 +1449,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImpo
|
|
|
1498
1449
|
CouponService,
|
|
1499
1450
|
HomeShopService,
|
|
1500
1451
|
OrderService,
|
|
1501
|
-
ShippingService
|
|
1452
|
+
ShippingService
|
|
1502
1453
|
],
|
|
1503
1454
|
}]
|
|
1504
1455
|
}] });
|