@infrab4a/connect-angular 3.10.4 → 3.10.6

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.
@@ -865,11 +865,19 @@
865
865
  {
866
866
  provide: i1.CategoryCollectionChildrenHasuraGraphQLRepository,
867
867
  useFactory: function (options) { return new i1.CategoryCollectionChildrenHasuraGraphQLRepository(options.endpoint, options.credentials); },
868
+ deps: ['HasuraConfig'],
868
869
  },
869
870
  {
870
871
  provide: 'CategoryCollectionChildrenRepository',
871
872
  useExisting: i1.CategoryCollectionChildrenHasuraGraphQLRepository,
872
873
  },
874
+ {
875
+ provide: i1.WishlistHasuraGraphQLRepository,
876
+ useFactory: function (options, categoryFilterRepository) {
877
+ return new i1.WishlistHasuraGraphQLRepository(options.endpoint, options.credentials, categoryFilterRepository);
878
+ },
879
+ deps: ['HasuraConfig', i1.CategoryFilterHasuraGraphQLRepository],
880
+ },
873
881
  {
874
882
  provide: 'WishlistRepository',
875
883
  useExisting: i1.WishlistHasuraGraphQLRepository,
@@ -948,11 +956,19 @@
948
956
  {
949
957
  provide: i1.CategoryCollectionChildrenHasuraGraphQLRepository,
950
958
  useFactory: function (options) { return new i1.CategoryCollectionChildrenHasuraGraphQLRepository(options.endpoint, options.credentials); },
959
+ deps: ['HasuraConfig'],
951
960
  },
952
961
  {
953
962
  provide: 'CategoryCollectionChildrenRepository',
954
963
  useExisting: i1.CategoryCollectionChildrenHasuraGraphQLRepository,
955
964
  },
965
+ {
966
+ provide: i1.WishlistHasuraGraphQLRepository,
967
+ useFactory: function (options, categoryFilterRepository) {
968
+ return new i1.WishlistHasuraGraphQLRepository(options.endpoint, options.credentials, categoryFilterRepository);
969
+ },
970
+ deps: ['HasuraConfig', i1.CategoryFilterHasuraGraphQLRepository],
971
+ },
956
972
  {
957
973
  provide: 'WishlistRepository',
958
974
  useExisting: i1.WishlistHasuraGraphQLRepository,
@@ -2054,6 +2070,27 @@
2054
2070
  __metadata("design:type", Array)
2055
2071
  ], CategoryWithTree.prototype, "children", void 0);
2056
2072
 
2073
+ var UtilHelper = /** @class */ (function () {
2074
+ function UtilHelper() {
2075
+ }
2076
+ UtilHelper.createSlug = function (name) {
2077
+ return name
2078
+ .toLowerCase()
2079
+ .replace(/\s+/g, '-') // Replace spaces with -
2080
+ .replace(/[ãàáäâ]/g, 'a') // Replace spaces with -
2081
+ .replace(/[ẽèéëê]/g, 'e') // Replace spaces with -
2082
+ .replace(/[ìíïî]/g, 'i') // Replace spaces with -
2083
+ .replace(/[õòóöô]/g, 'o') // Replace spaces with -
2084
+ .replace(/[ùúüû]/g, 'u') // Replace spaces with -
2085
+ .replace(/[ñ]/g, 'n') // Replace spaces with -
2086
+ .replace(/[ç]/g, 'c') // Replace spaces with -
2087
+ .replace(/[&]/g, 'and') // Replace spaces with -
2088
+ .replace(/[^\w\-]+/g, '') // Remove all non-word chars
2089
+ .replace(/\-\-+/g, '-'); // Replace multiple - with single -
2090
+ };
2091
+ return UtilHelper;
2092
+ }());
2093
+
2057
2094
  var NewCategoryStructureAdapter = /** @class */ (function () {
2058
2095
  function NewCategoryStructureAdapter(categoryRepository, categoryCollectionChildrenRepository) {
2059
2096
  this.categoryRepository = categoryRepository;
@@ -2168,45 +2205,13 @@
2168
2205
  }] }];
2169
2206
  } });
2170
2207
 
2171
- var UtilService = /** @class */ (function () {
2172
- function UtilService() {
2173
- }
2174
- UtilService.prototype.createSlug = function (name) {
2175
- return name
2176
- .toLowerCase()
2177
- .replace(/\s+/g, '-') // Replace spaces with -
2178
- .replace(/[ãàáäâ]/g, 'a') // Replace spaces with -
2179
- .replace(/[ẽèéëê]/g, 'e') // Replace spaces with -
2180
- .replace(/[ìíïî]/g, 'i') // Replace spaces with -
2181
- .replace(/[õòóöô]/g, 'o') // Replace spaces with -
2182
- .replace(/[ùúüû]/g, 'u') // Replace spaces with -
2183
- .replace(/[ñ]/g, 'n') // Replace spaces with -
2184
- .replace(/[ç]/g, 'c') // Replace spaces with -
2185
- .replace(/[&]/g, 'and') // Replace spaces with -
2186
- .replace(/[^\w\-]+/g, '') // Remove all non-word chars
2187
- .replace(/\-\-+/g, '-'); // Replace multiple - with single -
2188
- };
2189
- return UtilService;
2190
- }());
2191
- UtilService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: UtilService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2192
- UtilService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: UtilService, providedIn: 'root' });
2193
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: UtilService, decorators: [{
2194
- type: i0.Injectable,
2195
- args: [{
2196
- providedIn: 'root',
2197
- }]
2198
- }], ctorParameters: function () { return []; } });
2199
-
2200
2208
  var WishlistService = /** @class */ (function () {
2201
- function WishlistService(wishlistRepository, productRepository, categoryFilterRepository, categoryCollectionChildrenRepository, categoryStructureAdapter, shop, catalogService, categoryService, utilService) {
2202
- if (categoryStructureAdapter === void 0) { categoryStructureAdapter = new NewCategoryStructureAdapter(wishlistRepository, categoryCollectionChildrenRepository); }
2203
- if (catalogService === void 0) { catalogService = new CatalogService(productRepository, categoryStructureAdapter, shop); }
2204
- if (categoryService === void 0) { categoryService = new CategoryService(productRepository, wishlistRepository, categoryFilterRepository, categoryStructureAdapter, shop); }
2209
+ function WishlistService(wishlistRepository, shop, productRepository, categoryFilterRepository, categoryCollectionChildrenRepository) {
2205
2210
  this.wishlistRepository = wishlistRepository;
2206
2211
  this.shop = shop;
2207
- this.catalogService = catalogService;
2208
- this.categoryService = categoryService;
2209
- this.utilService = utilService;
2212
+ var categoryStructureAdapter = new NewCategoryStructureAdapter(wishlistRepository, categoryCollectionChildrenRepository);
2213
+ this.catalogService = new CatalogService(productRepository, categoryStructureAdapter, shop);
2214
+ this.categoryService = new CategoryService(productRepository, wishlistRepository, categoryFilterRepository, categoryStructureAdapter, shop);
2210
2215
  }
2211
2216
  WishlistService.prototype.getCatalogService = function () {
2212
2217
  return this.catalogService;
@@ -2221,7 +2226,7 @@
2221
2226
  switch (_a.label) {
2222
2227
  case 0:
2223
2228
  data = {
2224
- slug: this.utilService.createSlug("favoritos " + userFullName + " " + title),
2229
+ slug: UtilHelper.createSlug("favoritos " + userFullName + " " + title),
2225
2230
  name: title,
2226
2231
  description: description,
2227
2232
  metadata: {
@@ -2245,7 +2250,7 @@
2245
2250
  WishlistService.prototype.update = function (id, title, description, userFullName) {
2246
2251
  var data = {
2247
2252
  id: id,
2248
- slug: this.utilService.createSlug(id + "-favoritos " + userFullName + " " + title),
2253
+ slug: UtilHelper.createSlug(id + "-favoritos " + userFullName + " " + title),
2249
2254
  name: title,
2250
2255
  description: description,
2251
2256
  metadata: {
@@ -2304,7 +2309,7 @@
2304
2309
  };
2305
2310
  return WishlistService;
2306
2311
  }());
2307
- WishlistService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: WishlistService, deps: "invalid", target: i0__namespace.ɵɵFactoryTarget.Injectable });
2312
+ WishlistService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: WishlistService, deps: [{ token: 'WishlistRepository' }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryFilterRepository' }, { token: 'CategoryCollectionChildrenRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2308
2313
  WishlistService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: WishlistService });
2309
2314
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: WishlistService, decorators: [{
2310
2315
  type: i0.Injectable
@@ -2312,16 +2317,19 @@
2312
2317
  return [{ type: undefined, decorators: [{
2313
2318
  type: i0.Inject,
2314
2319
  args: ['WishlistRepository']
2320
+ }] }, { type: i1__namespace$1.Shops, decorators: [{
2321
+ type: i0.Inject,
2322
+ args: [DEFAULT_SHOP]
2315
2323
  }] }, { type: undefined, decorators: [{
2316
2324
  type: i0.Inject,
2317
2325
  args: ['ProductRepository']
2318
2326
  }] }, { type: undefined, decorators: [{
2319
2327
  type: i0.Inject,
2320
2328
  args: ['CategoryFilterRepository']
2321
- }] }, { type: undefined }, { type: undefined }, { type: i1__namespace$1.Shops, decorators: [{
2329
+ }] }, { type: undefined, decorators: [{
2322
2330
  type: i0.Inject,
2323
- args: [DEFAULT_SHOP]
2324
- }] }, { type: undefined }, { type: undefined }, { type: UtilService }];
2331
+ args: ['CategoryCollectionChildrenRepository']
2332
+ }] }];
2325
2333
  } });
2326
2334
 
2327
2335
  var CheckoutSubscriptionService = /** @class */ (function () {
@@ -2660,6 +2668,7 @@
2660
2668
  HomeShopService,
2661
2669
  OrderService,
2662
2670
  ShippingService,
2671
+ WishlistService,
2663
2672
  ], imports: [[fire.AngularFireModule, AngularFirestoreModule, AngularHasuraGraphQLModule]] });
2664
2673
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, decorators: [{
2665
2674
  type: i0.NgModule,
@@ -2676,6 +2685,7 @@
2676
2685
  HomeShopService,
2677
2686
  OrderService,
2678
2687
  ShippingService,
2688
+ WishlistService,
2679
2689
  ],
2680
2690
  }]
2681
2691
  }] });
@@ -2810,7 +2820,7 @@
2810
2820
  exports.HomeShopService = HomeShopService;
2811
2821
  exports.OrderService = OrderService;
2812
2822
  exports.ShippingService = ShippingService;
2813
- exports.UtilService = UtilService;
2823
+ exports.UtilHelper = UtilHelper;
2814
2824
  exports.WishlistService = WishlistService;
2815
2825
 
2816
2826
  Object.defineProperty(exports, '__esModule', { value: true });