@infrab4a/connect 4.2.0-beta.4 → 4.2.0-beta.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.
package/index.cjs.js CHANGED
@@ -2384,12 +2384,10 @@ class ProductsIndex {
2384
2384
  'rate',
2385
2385
  ];
2386
2386
  const filter = [{ term: { published: true } }];
2387
- if (size > 9) {
2388
- fields.push(...['pricePaid', 'isGift', 'stock', 'weight', 'tags']);
2389
- }
2390
- else {
2387
+ if (shop && shop !== exports.Shops.ALL)
2391
2388
  filter.push({ term: { tags: shop == exports.Shops.GLAMSHOP ? 'feminino' : 'masculino' } });
2392
- }
2389
+ if (size > 9)
2390
+ fields.push(...['pricePaid', 'isGift', 'stock', 'weight', 'tags']);
2393
2391
  const search = await this.adapter.query(this.index, {
2394
2392
  size,
2395
2393
  _source: fields,
@@ -2398,18 +2396,7 @@ class ProductsIndex {
2398
2396
  must: {
2399
2397
  multi_match: {
2400
2398
  query: `${searchTerm}`,
2401
- type: 'bool_prefix',
2402
- fields: [
2403
- 'name',
2404
- 'name.folded',
2405
- 'name.search',
2406
- 'description',
2407
- 'description.search',
2408
- 'description.folded',
2409
- 'brand',
2410
- 'brand.search',
2411
- 'brand.folded',
2412
- ],
2399
+ fields: ['name', 'name.folded', 'name.search', 'description', 'brand'],
2413
2400
  fuzziness: 2,
2414
2401
  },
2415
2402
  },
@@ -2642,7 +2629,7 @@ const withFindFirestore = (MixinBase) => {
2642
2629
  const collection = this.collection(this.buildCollectionPathForFind(find.filters));
2643
2630
  const enableCount = (_b = (_a = find === null || find === void 0 ? void 0 : find.options) === null || _a === void 0 ? void 0 : _a.enableCount) !== null && _b !== void 0 ? _b : true;
2644
2631
  const intercepted = await ((_d = (_c = this.interceptors) === null || _c === void 0 ? void 0 : _c.request) === null || _d === void 0 ? void 0 : _d.call(_c, { find }));
2645
- const { filters, limits, orderBy } = intercepted.find || find;
2632
+ const { filters, limits, orderBy } = (intercepted === null || intercepted === void 0 ? void 0 : intercepted.find) || find;
2646
2633
  const queries = this.makeFirestoreWhere(filters || {});
2647
2634
  const ordination = this.makeFirestoreOrderBy(filters, orderBy);
2648
2635
  const offsets = await this.defineLimits(filters, limits);
package/index.esm.js CHANGED
@@ -2378,12 +2378,10 @@ class ProductsIndex {
2378
2378
  'rate',
2379
2379
  ];
2380
2380
  const filter = [{ term: { published: true } }];
2381
- if (size > 9) {
2382
- fields.push(...['pricePaid', 'isGift', 'stock', 'weight', 'tags']);
2383
- }
2384
- else {
2381
+ if (shop && shop !== Shops.ALL)
2385
2382
  filter.push({ term: { tags: shop == Shops.GLAMSHOP ? 'feminino' : 'masculino' } });
2386
- }
2383
+ if (size > 9)
2384
+ fields.push(...['pricePaid', 'isGift', 'stock', 'weight', 'tags']);
2387
2385
  const search = await this.adapter.query(this.index, {
2388
2386
  size,
2389
2387
  _source: fields,
@@ -2392,18 +2390,7 @@ class ProductsIndex {
2392
2390
  must: {
2393
2391
  multi_match: {
2394
2392
  query: `${searchTerm}`,
2395
- type: 'bool_prefix',
2396
- fields: [
2397
- 'name',
2398
- 'name.folded',
2399
- 'name.search',
2400
- 'description',
2401
- 'description.search',
2402
- 'description.folded',
2403
- 'brand',
2404
- 'brand.search',
2405
- 'brand.folded',
2406
- ],
2393
+ fields: ['name', 'name.folded', 'name.search', 'description', 'brand'],
2407
2394
  fuzziness: 2,
2408
2395
  },
2409
2396
  },
@@ -2636,7 +2623,7 @@ const withFindFirestore = (MixinBase) => {
2636
2623
  const collection = this.collection(this.buildCollectionPathForFind(find.filters));
2637
2624
  const enableCount = (_b = (_a = find === null || find === void 0 ? void 0 : find.options) === null || _a === void 0 ? void 0 : _a.enableCount) !== null && _b !== void 0 ? _b : true;
2638
2625
  const intercepted = await ((_d = (_c = this.interceptors) === null || _c === void 0 ? void 0 : _c.request) === null || _d === void 0 ? void 0 : _d.call(_c, { find }));
2639
- const { filters, limits, orderBy } = intercepted.find || find;
2626
+ const { filters, limits, orderBy } = (intercepted === null || intercepted === void 0 ? void 0 : intercepted.find) || find;
2640
2627
  const queries = this.makeFirestoreWhere(filters || {});
2641
2628
  const ordination = this.makeFirestoreOrderBy(filters, orderBy);
2642
2629
  const offsets = await this.defineLimits(filters, limits);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.2.0-beta.4",
3
+ "version": "4.2.0-beta.6",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -0,0 +1,3 @@
1
+ export interface BrandsCarousel {
2
+ carouselColor?: string;
3
+ }
@@ -1,5 +1,6 @@
1
1
  export * from './banner.type';
2
2
  export * from './benefit.type';
3
+ export * from './brands-carousel.type';
3
4
  export * from './campaign-page';
4
5
  export * from './home-data.type';
5
6
  export * from './landing-page';
@@ -0,0 +1,10 @@
1
+ import { BrandsCarousel } from './brands-carousel.type';
2
+ import { ShopBanner } from './shop-banner.type';
3
+ import { ShopGift } from './shop-gift.type';
4
+ import { ShopSection } from './shop-section.type';
5
+ export type PromotionPageList = {
6
+ ShopBanner: ShopBanner;
7
+ BrandsCarousel: BrandsCarousel;
8
+ ShopGift: ShopGift;
9
+ };
10
+ export type PromotionPage<T extends keyof PromotionPageList> = PromotionPageList[T] & ShopSection;
@@ -1,4 +1,5 @@
1
1
  import { LandingPage } from './landing-page';
2
+ import { PromotionPage } from './promotion-page';
2
3
  import { ShopBanner } from './shop-banner.type';
3
4
  import { ShopCarousel } from './shop-carousel.type';
4
5
  import { ShopGift } from './shop-gift.type';
@@ -19,6 +20,7 @@ export type SimpleLPShopSection = [(ShopBanner & {
19
20
  carouselColor?: string;
20
21
  })[]];
21
22
  export type LandingPageSection = [LandingPage<any>];
23
+ export type PromotionPageSection = [PromotionPage<any>];
22
24
  export type SectionList = {
23
25
  HomeSection: HomeSection;
24
26
  LPClubeShopSection: LPClubeShopSection;
@@ -30,5 +32,6 @@ export type SectionList = {
30
32
  GlampointsVitrineShopSection: GlampointsVitrineShopSection;
31
33
  SimpleLPShopSection: SimpleLPShopSection;
32
34
  LandingPageSection: LandingPageSection;
35
+ PromotionPageSection: PromotionPageSection;
33
36
  };
34
37
  export type Section<T extends keyof SectionList> = SectionList[T];
package/teste2.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};