@infrab4a/connect 2.0.9 → 2.0.12

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.
@@ -1774,6 +1774,7 @@
1774
1774
  'weight',
1775
1775
  'tags',
1776
1776
  'hasVariants',
1777
+ 'type'
1777
1778
  ];
1778
1779
  return [4 /*yield*/, this.adapter.query('products/_search', Object.assign({ _source: fields, query: {
1779
1780
  bool: {
@@ -2235,6 +2236,32 @@
2235
2236
  }(withUpdateFirestore(withGetFirestore(withFindFirestore(withDeleteFirestore(withCreateFirestore(MixinBase)))))));
2236
2237
  };
2237
2238
 
2239
+ var LeadFirestoreRepository = /** @class */ (function (_super) {
2240
+ __extends(LeadFirestoreRepository, _super);
2241
+ function LeadFirestoreRepository(firestore) {
2242
+ var _this = _super.call(this) || this;
2243
+ _this.firestore = firestore;
2244
+ _this.collectionName = 'leads';
2245
+ _this.model = Lead;
2246
+ return _this;
2247
+ }
2248
+ return LeadFirestoreRepository;
2249
+ }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2250
+
2251
+ var SubscriptionEditionFirestoreRepository = /** @class */ (function (_super) {
2252
+ __extends(SubscriptionEditionFirestoreRepository, _super);
2253
+ function SubscriptionEditionFirestoreRepository(firestore, parentRepository) {
2254
+ var _this = _super.call(this) || this;
2255
+ _this.firestore = firestore;
2256
+ _this.parentRepository = parentRepository;
2257
+ _this.collectionName = 'editions';
2258
+ _this.parentIdField = 'subscriptionId';
2259
+ _this.model = Edition;
2260
+ return _this;
2261
+ }
2262
+ return SubscriptionEditionFirestoreRepository;
2263
+ }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
2264
+
2238
2265
  var SubscriptionFirestoreRepository = /** @class */ (function (_super) {
2239
2266
  __extends(SubscriptionFirestoreRepository, _super);
2240
2267
  function SubscriptionFirestoreRepository(firestore) {
@@ -2247,40 +2274,53 @@
2247
2274
  return SubscriptionFirestoreRepository;
2248
2275
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2249
2276
 
2250
- var UserSearch = /** @class */ (function (_super) {
2251
- __extends(UserSearch, _super);
2252
- function UserSearch() {
2253
- return _super !== null && _super.apply(this, arguments) || this;
2277
+ var SubscriptionPaymentFirestoreRepository = /** @class */ (function (_super) {
2278
+ __extends(SubscriptionPaymentFirestoreRepository, _super);
2279
+ function SubscriptionPaymentFirestoreRepository(firestore, parentRepository) {
2280
+ var _this = _super.call(this) || this;
2281
+ _this.firestore = firestore;
2282
+ _this.parentRepository = parentRepository;
2283
+ _this.collectionName = 'payments';
2284
+ _this.parentIdField = 'subscriptionId';
2285
+ _this.model = SubscriptionPayment;
2286
+ return _this;
2254
2287
  }
2255
- Object.defineProperty(UserSearch, "identifiersFields", {
2256
- get: function () {
2257
- return ['id'];
2258
- },
2259
- enumerable: false,
2260
- configurable: true
2261
- });
2262
- return UserSearch;
2263
- }(BaseModel));
2288
+ return SubscriptionPaymentFirestoreRepository;
2289
+ }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
2290
+
2291
+ var UserAddressFirestoreRepository = /** @class */ (function (_super) {
2292
+ __extends(UserAddressFirestoreRepository, _super);
2293
+ function UserAddressFirestoreRepository(firestore, parentRepository) {
2294
+ var _this = _super.call(this) || this;
2295
+ _this.firestore = firestore;
2296
+ _this.parentRepository = parentRepository;
2297
+ _this.collectionName = 'address';
2298
+ _this.parentIdField = 'userId';
2299
+ _this.model = UserAddress;
2300
+ return _this;
2301
+ }
2302
+ return UserAddressFirestoreRepository;
2303
+ }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2264
2304
 
2265
- var UserSearchFirestoreRepository = /** @class */ (function (_super) {
2266
- __extends(UserSearchFirestoreRepository, _super);
2267
- function UserSearchFirestoreRepository(firestore) {
2305
+ var UserBeautyProfileFirestoreRepository = /** @class */ (function (_super) {
2306
+ __extends(UserBeautyProfileFirestoreRepository, _super);
2307
+ function UserBeautyProfileFirestoreRepository(firestore, parentRepository) {
2268
2308
  var _this = _super.call(this) || this;
2269
2309
  _this.firestore = firestore;
2270
- _this.collectionName = 'userSearch';
2271
- _this.model = UserSearch;
2310
+ _this.parentRepository = parentRepository;
2311
+ _this.collectionName = 'CX';
2312
+ _this.parentIdField = 'userId';
2313
+ _this.model = BeautyProfile;
2272
2314
  return _this;
2273
2315
  }
2274
- return UserSearchFirestoreRepository;
2275
- }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2316
+ return UserBeautyProfileFirestoreRepository;
2317
+ }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2276
2318
 
2277
2319
  var UserFirestoreRepository = /** @class */ (function (_super_1) {
2278
2320
  __extends(UserFirestoreRepository, _super_1);
2279
- function UserFirestoreRepository(firestore, userSearchFirestoreRepository) {
2280
- if (userSearchFirestoreRepository === void 0) { userSearchFirestoreRepository = new UserSearchFirestoreRepository(firestore); }
2321
+ function UserFirestoreRepository(firestore) {
2281
2322
  var _this = _super_1.call(this) || this;
2282
2323
  _this.firestore = firestore;
2283
- _this.userSearchFirestoreRepository = userSearchFirestoreRepository;
2284
2324
  _this.collectionName = 'users';
2285
2325
  _this.model = User;
2286
2326
  return _this;
@@ -2315,7 +2355,7 @@
2315
2355
  var _a;
2316
2356
  return __generator(this, function (_b) {
2317
2357
  switch (_b.label) {
2318
- case 0: return [4 /*yield*/, this.userSearchFirestoreRepository.find((_a = {}, _a[field] = { operator: exports.Where.EQUALS, value: value }, _a))];
2358
+ case 0: return [4 /*yield*/, this.find({ filters: (_a = {}, _a[field] = value, _a) })];
2319
2359
  case 1:
2320
2360
  result = _b.sent();
2321
2361
  return [2 /*return*/, result.count > 0];
@@ -2378,48 +2418,6 @@
2378
2418
  return UserFirestoreRepository;
2379
2419
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2380
2420
 
2381
- var SubscriptionEditionFirestoreRepository = /** @class */ (function (_super) {
2382
- __extends(SubscriptionEditionFirestoreRepository, _super);
2383
- function SubscriptionEditionFirestoreRepository(firestore, parentRepository) {
2384
- var _this = _super.call(this) || this;
2385
- _this.firestore = firestore;
2386
- _this.parentRepository = parentRepository;
2387
- _this.collectionName = 'editions';
2388
- _this.parentIdField = 'subscriptionId';
2389
- _this.model = Edition;
2390
- return _this;
2391
- }
2392
- return SubscriptionEditionFirestoreRepository;
2393
- }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
2394
-
2395
- var UserBeautyProfileFirestoreRepository = /** @class */ (function (_super) {
2396
- __extends(UserBeautyProfileFirestoreRepository, _super);
2397
- function UserBeautyProfileFirestoreRepository(firestore, parentRepository) {
2398
- var _this = _super.call(this) || this;
2399
- _this.firestore = firestore;
2400
- _this.parentRepository = parentRepository;
2401
- _this.collectionName = 'CX';
2402
- _this.parentIdField = 'userId';
2403
- _this.model = BeautyProfile;
2404
- return _this;
2405
- }
2406
- return UserBeautyProfileFirestoreRepository;
2407
- }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2408
-
2409
- var UserAddressFirestoreRepository = /** @class */ (function (_super) {
2410
- __extends(UserAddressFirestoreRepository, _super);
2411
- function UserAddressFirestoreRepository(firestore, parentRepository) {
2412
- var _this = _super.call(this) || this;
2413
- _this.firestore = firestore;
2414
- _this.parentRepository = parentRepository;
2415
- _this.collectionName = 'address';
2416
- _this.parentIdField = 'userId';
2417
- _this.model = UserAddress;
2418
- return _this;
2419
- }
2420
- return UserAddressFirestoreRepository;
2421
- }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2422
-
2423
2421
  var UserPaymentMethodFirestoreRepository = /** @class */ (function (_super) {
2424
2422
  __extends(UserPaymentMethodFirestoreRepository, _super);
2425
2423
  function UserPaymentMethodFirestoreRepository(firestore, parentRepository) {
@@ -2434,32 +2432,6 @@
2434
2432
  return UserPaymentMethodFirestoreRepository;
2435
2433
  }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), User)));
2436
2434
 
2437
- var SubscriptionPaymentFirestoreRepository = /** @class */ (function (_super) {
2438
- __extends(SubscriptionPaymentFirestoreRepository, _super);
2439
- function SubscriptionPaymentFirestoreRepository(firestore, parentRepository) {
2440
- var _this = _super.call(this) || this;
2441
- _this.firestore = firestore;
2442
- _this.parentRepository = parentRepository;
2443
- _this.collectionName = 'payments';
2444
- _this.parentIdField = 'subscriptionId';
2445
- _this.model = SubscriptionPayment;
2446
- return _this;
2447
- }
2448
- return SubscriptionPaymentFirestoreRepository;
2449
- }(withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base))), Subscription)));
2450
-
2451
- var LeadFirestoreRepository = /** @class */ (function (_super) {
2452
- __extends(LeadFirestoreRepository, _super);
2453
- function LeadFirestoreRepository(firestore) {
2454
- var _this = _super.call(this) || this;
2455
- _this.firestore = firestore;
2456
- _this.collectionName = 'leads';
2457
- _this.model = Lead;
2458
- return _this;
2459
- }
2460
- return LeadFirestoreRepository;
2461
- }(withCrudFirestore(withHelpers(withFirestore(Base)))));
2462
-
2463
2435
  var CategoryFirestoreRepository = /** @class */ (function (_super) {
2464
2436
  __extends(CategoryFirestoreRepository, _super);
2465
2437
  function CategoryFirestoreRepository(firestore) {
@@ -3845,6 +3817,8 @@
3845
3817
  'sku',
3846
3818
  'rate',
3847
3819
  'tags',
3820
+ 'type',
3821
+ 'shoppingCount',
3848
3822
  ] }, ((options === null || options === void 0 ? void 0 : options.limit) ? { limits: { limit: options === null || options === void 0 ? void 0 : options.limit } } : {})))];
3849
3823
  case 1:
3850
3824
  productsData = (_d.sent()).data;
@@ -4021,6 +3995,7 @@
4021
3995
  from: function (value) { return value.aggregate.avg.rate; },
4022
3996
  },
4023
3997
  },
3998
+ { shoppingCount: { columnName: 'shopping_count' } },
4024
3999
  ];
4025
4000
  _this.fields = __spreadArray(__spreadArray([], __read(commonFields)), [
4026
4001
  {
@@ -4846,7 +4821,6 @@
4846
4821
  exports.UserFirestoreRepository = UserFirestoreRepository;
4847
4822
  exports.UserPaymentMethod = UserPaymentMethod;
4848
4823
  exports.UserPaymentMethodFirestoreRepository = UserPaymentMethodFirestoreRepository;
4849
- exports.UserSearchFirestoreRepository = UserSearchFirestoreRepository;
4850
4824
  exports.Variant = Variant;
4851
4825
  exports.VariantHasuraGraphQL = VariantHasuraGraphQL;
4852
4826
  exports.VariantHasuraGraphQLRepository = VariantHasuraGraphQLRepository;