@infrab4a/connect-angular 0.13.3 → 0.14.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.
Files changed (73) hide show
  1. package/{lib/angular-connect.module.d.ts → angular-connect.module.d.ts} +5 -2
  2. package/angular-elastic-search.module.d.ts +9 -0
  3. package/{lib/angular-firestore.module.d.ts → angular-firestore.module.d.ts} +7 -2
  4. package/bundles/infrab4a-connect-angular.umd.js +52 -12
  5. package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
  6. package/consts/es-config.const.d.ts +1 -0
  7. package/{lib/consts → consts}/index.d.ts +1 -0
  8. package/esm2015/angular-connect.module.js +47 -0
  9. package/esm2015/angular-elastic-search.module.js +38 -0
  10. package/esm2015/angular-firebase-auth.module.js +113 -0
  11. package/esm2015/angular-firestore.module.js +340 -0
  12. package/esm2015/consts/default-shop.const.js +2 -0
  13. package/esm2015/consts/es-config.const.js +2 -0
  14. package/esm2015/consts/index.js +3 -0
  15. package/esm2015/index.js +5 -0
  16. package/esm2015/infrab4a-connect-angular.js +2 -2
  17. package/esm2015/services/auth.service.js +42 -0
  18. package/esm2015/services/cart.service.js +166 -0
  19. package/esm2015/services/checkout-subscription.service.js +68 -0
  20. package/esm2015/services/checkout.service.js +79 -0
  21. package/esm2015/services/coupon.service.js +70 -0
  22. package/esm2015/services/errors/group-invalid-coupon.error.js +7 -0
  23. package/esm2015/services/errors/index.js +3 -0
  24. package/esm2015/services/errors/invalid-coupon.error.js +7 -0
  25. package/esm2015/services/home-shop.service.js +108 -0
  26. package/esm2015/services/index.js +8 -0
  27. package/esm2015/services/order.service.js +32 -0
  28. package/esm2015/services/types/index.js +3 -0
  29. package/esm2015/services/types/required-checkout-data.type.js +2 -0
  30. package/esm2015/services/types/required-checkout-subscription-data.type.js +2 -0
  31. package/fesm2015/infrab4a-connect-angular.js +52 -14
  32. package/fesm2015/infrab4a-connect-angular.js.map +1 -1
  33. package/infrab4a-connect-angular.d.ts +1 -1
  34. package/package.json +2 -2
  35. package/esm2015/lib/angular-connect.module.js +0 -46
  36. package/esm2015/lib/angular-firebase-auth.module.js +0 -113
  37. package/esm2015/lib/angular-firestore.module.js +0 -337
  38. package/esm2015/lib/consts/default-shop.const.js +0 -2
  39. package/esm2015/lib/consts/index.js +0 -2
  40. package/esm2015/lib/index.js +0 -5
  41. package/esm2015/lib/services/auth.service.js +0 -42
  42. package/esm2015/lib/services/cart.service.js +0 -166
  43. package/esm2015/lib/services/checkout-subscription.service.js +0 -68
  44. package/esm2015/lib/services/checkout.service.js +0 -79
  45. package/esm2015/lib/services/coupon.service.js +0 -70
  46. package/esm2015/lib/services/errors/group-invalid-coupon.error.js +0 -7
  47. package/esm2015/lib/services/errors/index.js +0 -3
  48. package/esm2015/lib/services/errors/invalid-coupon.error.js +0 -7
  49. package/esm2015/lib/services/home-shop.service.js +0 -108
  50. package/esm2015/lib/services/index.js +0 -8
  51. package/esm2015/lib/services/order.service.js +0 -32
  52. package/esm2015/lib/services/types/index.js +0 -3
  53. package/esm2015/lib/services/types/required-checkout-data.type.js +0 -2
  54. package/esm2015/lib/services/types/required-checkout-subscription-data.type.js +0 -2
  55. package/esm2015/public-api.js +0 -2
  56. package/public-api.d.ts +0 -1
  57. /package/{lib/angular-firebase-auth.module.d.ts → angular-firebase-auth.module.d.ts} +0 -0
  58. /package/{lib/consts → consts}/default-shop.const.d.ts +0 -0
  59. /package/{lib/index.d.ts → index.d.ts} +0 -0
  60. /package/{lib/services → services}/auth.service.d.ts +0 -0
  61. /package/{lib/services → services}/cart.service.d.ts +0 -0
  62. /package/{lib/services → services}/checkout-subscription.service.d.ts +0 -0
  63. /package/{lib/services → services}/checkout.service.d.ts +0 -0
  64. /package/{lib/services → services}/coupon.service.d.ts +0 -0
  65. /package/{lib/services → services}/errors/group-invalid-coupon.error.d.ts +0 -0
  66. /package/{lib/services → services}/errors/index.d.ts +0 -0
  67. /package/{lib/services → services}/errors/invalid-coupon.error.d.ts +0 -0
  68. /package/{lib/services → services}/home-shop.service.d.ts +0 -0
  69. /package/{lib/services → services}/index.d.ts +0 -0
  70. /package/{lib/services → services}/order.service.d.ts +0 -0
  71. /package/{lib/services → services}/types/index.d.ts +0 -0
  72. /package/{lib/services → services}/types/required-checkout-data.type.d.ts +0 -0
  73. /package/{lib/services → services}/types/required-checkout-subscription-data.type.d.ts +0 -0
@@ -1,11 +1,14 @@
1
1
  import { ModuleWithProviders } from '@angular/core';
2
2
  import { AngularFireModule, FirebaseAppConfig, FirebaseOptions } from '@angular/fire';
3
- import { Shops } from '@infrab4a/connect';
3
+ import { AxiosElasticSearchConfig, Shops } from '@infrab4a/connect';
4
4
  import * as i0 from "@angular/core";
5
5
  import * as i1 from "@angular/fire";
6
6
  import * as i2 from "./angular-firestore.module";
7
7
  export declare class AngularConnectModule {
8
- static initializeApp(defaultShop: Shops, options: FirebaseOptions, nameOrConfig?: string | FirebaseAppConfig): ModuleWithProviders<AngularFireModule>;
8
+ static initializeApp(defaultShop: Shops, options: {
9
+ firebase: FirebaseOptions;
10
+ elasticSearch: AxiosElasticSearchConfig;
11
+ }, nameOrConfig?: string | FirebaseAppConfig): ModuleWithProviders<AngularFireModule>;
9
12
  static ɵfac: i0.ɵɵFactoryDeclaration<AngularConnectModule, never>;
10
13
  static ɵmod: i0.ɵɵNgModuleDeclaration<AngularConnectModule, never, [typeof i1.AngularFireModule, typeof i2.AngularFirestoreModule], never>;
11
14
  static ɵinj: i0.ɵɵInjectorDeclaration<AngularConnectModule>;
@@ -0,0 +1,9 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import { AxiosElasticSearchConfig } from '@infrab4a/connect';
3
+ import * as i0 from "@angular/core";
4
+ export declare class AngularElasticSeachModule {
5
+ static initializeApp(options: AxiosElasticSearchConfig): ModuleWithProviders<AngularElasticSeachModule>;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<AngularElasticSeachModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AngularElasticSeachModule, never, never, never>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<AngularElasticSeachModule>;
9
+ }
@@ -1,10 +1,15 @@
1
1
  import { ModuleWithProviders } from '@angular/core';
2
2
  import { AngularFireModule, FirebaseAppConfig, FirebaseOptions } from '@angular/fire';
3
+ import { AxiosElasticSearchConfig } from '@infrab4a/connect';
3
4
  import * as i0 from "@angular/core";
4
5
  import * as i1 from "@angular/fire";
6
+ import * as i2 from "./angular-elastic-search.module";
5
7
  export declare class AngularFirestoreModule {
6
- static initializeApp(options: FirebaseOptions, nameOrConfig?: string | FirebaseAppConfig): ModuleWithProviders<AngularFireModule>;
8
+ static initializeApp(options: {
9
+ firebase: FirebaseOptions;
10
+ elasticSearch: AxiosElasticSearchConfig;
11
+ }, nameOrConfig?: string | FirebaseAppConfig): ModuleWithProviders<AngularFireModule>;
7
12
  static ɵfac: i0.ɵɵFactoryDeclaration<AngularFirestoreModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<AngularFirestoreModule, never, [typeof i1.AngularFireModule], never>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AngularFirestoreModule, never, [typeof i1.AngularFireModule, typeof i2.AngularElasticSeachModule], never>;
9
14
  static ɵinj: i0.ɵɵInjectorDeclaration<AngularFirestoreModule>;
10
15
  }
@@ -391,6 +391,8 @@
391
391
 
392
392
  var DEFAULT_SHOP = 'DEFAULT_SHOP';
393
393
 
394
+ var ES_CONFIG = 'ES_CONFIG';
395
+
394
396
  var InvalidCouponError = /** @class */ (function (_super) {
395
397
  __extends(InvalidCouponError, _super);
396
398
  function InvalidCouponError(message) {
@@ -903,7 +905,7 @@
903
905
  };
904
906
  HomeShopService.prototype.getVerticalProducts = function () {
905
907
  var _this = this;
906
- return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.forkJoin(home.verticalCarousels.filter(Boolean).map(function (id) { return rxjs.forkJoin([
908
+ return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.forkJoin(home.verticalCarousels.map(function (id) { return rxjs.forkJoin([
907
909
  _this.categoryRepository.get({ id: id }),
908
910
  _this.productRepository.find([{ categories: { operator: i2.Where.LIKE, value: [id] } }], { limit: 12 }),
909
911
  ]).pipe(operators.map(function (_b) {
@@ -1064,6 +1066,43 @@
1064
1066
  }]
1065
1067
  }] });
1066
1068
 
1069
+ var AngularElasticSeachModule = /** @class */ (function () {
1070
+ function AngularElasticSeachModule() {
1071
+ }
1072
+ AngularElasticSeachModule.initializeApp = function (options) {
1073
+ return {
1074
+ ngModule: AngularElasticSeachModule,
1075
+ providers: [{ provide: ES_CONFIG, useValue: options }],
1076
+ };
1077
+ };
1078
+ return AngularElasticSeachModule;
1079
+ }());
1080
+ AngularElasticSeachModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1081
+ AngularElasticSeachModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule });
1082
+ AngularElasticSeachModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, providers: [
1083
+ {
1084
+ provide: i2.ProductsIndex,
1085
+ useFactory: function (configuration) {
1086
+ return new i2.ProductsIndex(new i2.AxiosAdapter(configuration));
1087
+ },
1088
+ deps: [ES_CONFIG],
1089
+ },
1090
+ ] });
1091
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, decorators: [{
1092
+ type: i0.NgModule,
1093
+ args: [{
1094
+ providers: [
1095
+ {
1096
+ provide: i2.ProductsIndex,
1097
+ useFactory: function (configuration) {
1098
+ return new i2.ProductsIndex(new i2.AxiosAdapter(configuration));
1099
+ },
1100
+ deps: [ES_CONFIG],
1101
+ },
1102
+ ],
1103
+ }]
1104
+ }] });
1105
+
1067
1106
  var AngularFirestoreModule = /** @class */ (function () {
1068
1107
  function AngularFirestoreModule() {
1069
1108
  }
@@ -1071,15 +1110,16 @@
1071
1110
  return {
1072
1111
  ngModule: AngularFirestoreModule,
1073
1112
  providers: [
1074
- { provide: fire.FIREBASE_OPTIONS, useValue: options },
1113
+ { provide: fire.FIREBASE_OPTIONS, useValue: options.firebase },
1075
1114
  { provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
1115
+ { provide: ES_CONFIG, useValue: options.elasticSearch },
1076
1116
  ],
1077
1117
  };
1078
1118
  };
1079
1119
  return AngularFirestoreModule;
1080
1120
  }());
1081
1121
  AngularFirestoreModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1082
- AngularFirestoreModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, imports: [fire.AngularFireModule] });
1122
+ AngularFirestoreModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, imports: [fire.AngularFireModule, AngularElasticSeachModule] });
1083
1123
  AngularFirestoreModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, providers: [
1084
1124
  {
1085
1125
  provide: 'BeautyProfileRepository',
@@ -1097,10 +1137,10 @@
1097
1137
  },
1098
1138
  {
1099
1139
  provide: 'CategoryRepository',
1100
- useFactory: function (firestore) {
1101
- return new i2.CategoryFirestoreRepository(firestore.firestore);
1140
+ useFactory: function (firestore, productsIndex) {
1141
+ return new i2.CategoryFirestoreRepository(firestore.firestore, productsIndex);
1102
1142
  },
1103
- deps: [i1$1.AngularFirestore],
1143
+ deps: [i1$1.AngularFirestore, i2.ProductsIndex],
1104
1144
  },
1105
1145
  {
1106
1146
  provide: 'CheckoutRepository',
@@ -1235,11 +1275,11 @@
1235
1275
  },
1236
1276
  deps: [i1$1.AngularFirestore, 'ProductRepository'],
1237
1277
  },
1238
- ], imports: [[fire.AngularFireModule]] });
1278
+ ], imports: [[fire.AngularFireModule, AngularElasticSeachModule]] });
1239
1279
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, decorators: [{
1240
1280
  type: i0.NgModule,
1241
1281
  args: [{
1242
- imports: [fire.AngularFireModule],
1282
+ imports: [fire.AngularFireModule, AngularElasticSeachModule],
1243
1283
  providers: [
1244
1284
  {
1245
1285
  provide: 'BeautyProfileRepository',
@@ -1257,10 +1297,10 @@
1257
1297
  },
1258
1298
  {
1259
1299
  provide: 'CategoryRepository',
1260
- useFactory: function (firestore) {
1261
- return new i2.CategoryFirestoreRepository(firestore.firestore);
1300
+ useFactory: function (firestore, productsIndex) {
1301
+ return new i2.CategoryFirestoreRepository(firestore.firestore, productsIndex);
1262
1302
  },
1263
- deps: [i1$1.AngularFirestore],
1303
+ deps: [i1$1.AngularFirestore, i2.ProductsIndex],
1264
1304
  },
1265
1305
  {
1266
1306
  provide: 'CheckoutRepository',
@@ -1405,7 +1445,7 @@
1405
1445
  AngularConnectModule.initializeApp = function (defaultShop, options, nameOrConfig) {
1406
1446
  return {
1407
1447
  ngModule: AngularConnectModule,
1408
- providers: __spreadArray(__spreadArray(__spreadArray([], __read((i2.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i2.isNil(options) ? [] : [{ provide: fire.FIREBASE_OPTIONS, useValue: options }]))), __read((i2.isNil(options) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))),
1448
+ providers: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((i2.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i2.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_OPTIONS, useValue: options === null || options === void 0 ? void 0 : options.firebase }]))), __read((i2.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))), __read((i2.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [{ provide: ES_CONFIG, useValue: options.elasticSearch }]))),
1409
1449
  };
1410
1450
  };
1411
1451
  return AngularConnectModule;