@infrab4a/connect 5.5.5-beta.0 → 5.5.5

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
@@ -2328,7 +2328,6 @@ exports.ShopPageName = void 0;
2328
2328
  ShopPageName["LP_GLAMQUEENS"] = "LP_GLAMQUEENS";
2329
2329
  ShopPageName["LP_INVITE"] = "LP_INVITE";
2330
2330
  ShopPageName["LP_LIVELO"] = "LP_LIVELO";
2331
- ShopPageName["GLAM_NEW_HOME"] = "GLAM_NEW_HOME";
2332
2331
  })(exports.ShopPageName || (exports.ShopPageName = {}));
2333
2332
 
2334
2333
  class BeautyQuestionsHelper {
@@ -2406,56 +2405,10 @@ class ShopMenu extends BaseModel {
2406
2405
  }
2407
2406
  }
2408
2407
 
2409
- var ShopPageSectionType;
2410
- (function (ShopPageSectionType) {
2411
- ShopPageSectionType["LIVE"] = "LIVE";
2412
- ShopPageSectionType["CAROUSEL"] = "CAROUSEL";
2413
- ShopPageSectionType["INFOBARS"] = "INFOBARS";
2414
- ShopPageSectionType["HIGHLIGHTS"] = "HIGHLIGHTS";
2415
- ShopPageSectionType["SUBSCRIBER_INFO"] = "SUBSCRIBER_INFO";
2416
- ShopPageSectionType["COLLECTION"] = "COLLECTION";
2417
- ShopPageSectionType["PLANS"] = "PLANS";
2418
- ShopPageSectionType["SINGLE_PLAN"] = "SINGLE_PLAN";
2419
- ShopPageSectionType["BRANDS"] = "BRANDS";
2420
- ShopPageSectionType["NEWSLETTER"] = "NEWSLETTER";
2421
- })(ShopPageSectionType || (ShopPageSectionType = {}));
2422
-
2423
2408
  class ShopSettings extends BaseModel {
2424
2409
  static get identifiersFields() {
2425
2410
  return ['id'];
2426
2411
  }
2427
- pageSections(displayRules) {
2428
- const now = new Date();
2429
- return (Array.isArray(this.sections) ? this.sections : [])
2430
- .map((section) => {
2431
- // Filtra banners dentro de carrousel
2432
- if (section.type === ShopPageSectionType.CAROUSEL && Array.isArray(section.banners)) {
2433
- const filteredBanners = section.banners.filter((banner) => {
2434
- // Filtra por displayRules
2435
- const rulesMatch = banner.displayRules
2436
- ? Object.keys(displayRules).every((key) => banner.displayRules && banner.displayRules[key] === displayRules[key])
2437
- : true;
2438
- // Filtra por publishDate e expirationDate
2439
- const publishOk = !banner.publishDate || now >= new Date(banner.publishDate);
2440
- const expireOk = !banner.expirationDate || now <= new Date(banner.expirationDate);
2441
- return rulesMatch && publishOk && expireOk;
2442
- });
2443
- return { ...section, banners: filteredBanners };
2444
- }
2445
- // Filtra collections
2446
- if (section.type === ShopPageSectionType.COLLECTION) {
2447
- const rulesMatch = section.displayRules
2448
- ? Object.keys(displayRules).every((key) => section.displayRules && section.displayRules[key] === displayRules[key])
2449
- : true;
2450
- const publishOk = !section.publishDate || now >= new Date(section.publishDate);
2451
- const expireOk = !section.expirationDate || now <= new Date(section.expirationDate);
2452
- return rulesMatch && publishOk && expireOk ? section : null;
2453
- }
2454
- // Demais seções retornam normalmente
2455
- return section;
2456
- })
2457
- .filter(Boolean);
2458
- }
2459
2412
  }
2460
2413
 
2461
2414
  class AdyenBlockedOrderHelper {
@@ -9755,6 +9708,7 @@ class MercadoPagoCardAxiosAdapter {
9755
9708
  limiteRange: 'day',
9756
9709
  card,
9757
9710
  gatewayInfo: {
9711
+ gateway: exports.PaymentProviders.MERCADOPAGO,
9758
9712
  status: data.status,
9759
9713
  statusDetail: data.status_detail,
9760
9714
  },
@@ -10770,6 +10724,7 @@ class PagarmeV5CardAxiosAdapter {
10770
10724
  card,
10771
10725
  orderBlockedRepository: this.orderBlockedRepository,
10772
10726
  gatewayInfo: {
10727
+ gateway: exports.PaymentProviders.PAGARME,
10773
10728
  status: charge.status,
10774
10729
  statusDetail: charge.last_transaction?.status,
10775
10730
  },
package/index.esm.js CHANGED
@@ -2304,7 +2304,6 @@ var ShopPageName;
2304
2304
  ShopPageName["LP_GLAMQUEENS"] = "LP_GLAMQUEENS";
2305
2305
  ShopPageName["LP_INVITE"] = "LP_INVITE";
2306
2306
  ShopPageName["LP_LIVELO"] = "LP_LIVELO";
2307
- ShopPageName["GLAM_NEW_HOME"] = "GLAM_NEW_HOME";
2308
2307
  })(ShopPageName || (ShopPageName = {}));
2309
2308
 
2310
2309
  class BeautyQuestionsHelper {
@@ -2382,56 +2381,10 @@ class ShopMenu extends BaseModel {
2382
2381
  }
2383
2382
  }
2384
2383
 
2385
- var ShopPageSectionType;
2386
- (function (ShopPageSectionType) {
2387
- ShopPageSectionType["LIVE"] = "LIVE";
2388
- ShopPageSectionType["CAROUSEL"] = "CAROUSEL";
2389
- ShopPageSectionType["INFOBARS"] = "INFOBARS";
2390
- ShopPageSectionType["HIGHLIGHTS"] = "HIGHLIGHTS";
2391
- ShopPageSectionType["SUBSCRIBER_INFO"] = "SUBSCRIBER_INFO";
2392
- ShopPageSectionType["COLLECTION"] = "COLLECTION";
2393
- ShopPageSectionType["PLANS"] = "PLANS";
2394
- ShopPageSectionType["SINGLE_PLAN"] = "SINGLE_PLAN";
2395
- ShopPageSectionType["BRANDS"] = "BRANDS";
2396
- ShopPageSectionType["NEWSLETTER"] = "NEWSLETTER";
2397
- })(ShopPageSectionType || (ShopPageSectionType = {}));
2398
-
2399
2384
  class ShopSettings extends BaseModel {
2400
2385
  static get identifiersFields() {
2401
2386
  return ['id'];
2402
2387
  }
2403
- pageSections(displayRules) {
2404
- const now = new Date();
2405
- return (Array.isArray(this.sections) ? this.sections : [])
2406
- .map((section) => {
2407
- // Filtra banners dentro de carrousel
2408
- if (section.type === ShopPageSectionType.CAROUSEL && Array.isArray(section.banners)) {
2409
- const filteredBanners = section.banners.filter((banner) => {
2410
- // Filtra por displayRules
2411
- const rulesMatch = banner.displayRules
2412
- ? Object.keys(displayRules).every((key) => banner.displayRules && banner.displayRules[key] === displayRules[key])
2413
- : true;
2414
- // Filtra por publishDate e expirationDate
2415
- const publishOk = !banner.publishDate || now >= new Date(banner.publishDate);
2416
- const expireOk = !banner.expirationDate || now <= new Date(banner.expirationDate);
2417
- return rulesMatch && publishOk && expireOk;
2418
- });
2419
- return { ...section, banners: filteredBanners };
2420
- }
2421
- // Filtra collections
2422
- if (section.type === ShopPageSectionType.COLLECTION) {
2423
- const rulesMatch = section.displayRules
2424
- ? Object.keys(displayRules).every((key) => section.displayRules && section.displayRules[key] === displayRules[key])
2425
- : true;
2426
- const publishOk = !section.publishDate || now >= new Date(section.publishDate);
2427
- const expireOk = !section.expirationDate || now <= new Date(section.expirationDate);
2428
- return rulesMatch && publishOk && expireOk ? section : null;
2429
- }
2430
- // Demais seções retornam normalmente
2431
- return section;
2432
- })
2433
- .filter(Boolean);
2434
- }
2435
2388
  }
2436
2389
 
2437
2390
  class AdyenBlockedOrderHelper {
@@ -9731,6 +9684,7 @@ class MercadoPagoCardAxiosAdapter {
9731
9684
  limiteRange: 'day',
9732
9685
  card,
9733
9686
  gatewayInfo: {
9687
+ gateway: PaymentProviders.MERCADOPAGO,
9734
9688
  status: data.status,
9735
9689
  statusDetail: data.status_detail,
9736
9690
  },
@@ -10746,6 +10700,7 @@ class PagarmeV5CardAxiosAdapter {
10746
10700
  card,
10747
10701
  orderBlockedRepository: this.orderBlockedRepository,
10748
10702
  gatewayInfo: {
10703
+ gateway: PaymentProviders.PAGARME,
10749
10704
  status: charge.status,
10750
10705
  statusDetail: charge.last_transaction?.status,
10751
10706
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "5.5.5-beta.0",
3
+ "version": "5.5.5",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -15,6 +15,5 @@ export declare enum ShopPageName {
15
15
  LP_GLAMPARTNER_PROMOTION = "LP_GLAMPARTNER_PROMOTION",
16
16
  LP_GLAMQUEENS = "LP_GLAMQUEENS",
17
17
  LP_INVITE = "LP_INVITE",
18
- LP_LIVELO = "LP_LIVELO",
19
- GLAM_NEW_HOME = "GLAM_NEW_HOME"
18
+ LP_LIVELO = "LP_LIVELO"
20
19
  }
@@ -1,18 +1,15 @@
1
1
  import { BaseModel, GenericIdentifier } from '../../generic/model';
2
2
  import { ShopPageName } from '../enums';
3
3
  import { Section } from './types';
4
- import { DisplayRules, SectionUnion, ShopPageSection } from './types/shop-page-section.type';
5
4
  export declare class ShopSettings extends BaseModel<ShopSettings> {
6
5
  id: string | ShopPageName;
7
6
  name: string;
8
7
  shop: string;
9
- preview?: string;
10
- sections: Section<any> | ShopPageSection[];
8
+ sections: Section<any>;
11
9
  descriptionMeta?: string;
12
10
  titleMeta?: string;
13
11
  imageMeta?: string;
14
12
  hasMultiples?: boolean;
15
13
  pagePath?: string;
16
14
  static get identifiersFields(): GenericIdentifier[];
17
- pageSections(displayRules: DisplayRules): SectionUnion[];
18
15
  }
@@ -19,7 +19,11 @@ export declare class OrderBlocked extends BaseModel<OrderBlocked> {
19
19
  type: OrderBlockedType;
20
20
  card?: any;
21
21
  checkout: Checkout;
22
- gatewayInfo?: any;
22
+ gatewayInfo?: {
23
+ gateway?: string;
24
+ status?: string;
25
+ statusDetail?: string;
26
+ };
23
27
  date: Date;
24
28
  static get identifiersFields(): GenericIdentifier[];
25
29
  }
@@ -7,7 +7,11 @@ type CreateBlockedOrderParams = {
7
7
  type: string;
8
8
  limiteRange: string;
9
9
  card?: PaymentCardInfo;
10
- gatewayInfo?: any;
10
+ gatewayInfo?: {
11
+ gateway?: string;
12
+ status?: string;
13
+ statusDetail?: string;
14
+ };
11
15
  };
12
16
  export interface OrderBlockedRepository extends CrudRepository<OrderBlocked> {
13
17
  createBlockedOrderOrPayment(params: CreateBlockedOrderParams): Promise<OrderBlocked>;
@@ -6,6 +6,7 @@ interface BlockedOrderParams {
6
6
  card: PaymentCardInfo;
7
7
  orderBlockedRepository: OrderBlockedRepository;
8
8
  gatewayInfo?: {
9
+ gateway: string;
9
10
  status: string;
10
11
  statusDetail: string;
11
12
  };
@@ -1,111 +0,0 @@
1
- export type ShopPageSection = Array<SectionUnion>;
2
- export type SectionUnion = SectionLive | SectionCarousel | SectionInfobars | SectionHighlights | SectionSubscriberInfo | SectionCollection | SectionPlans | SectionSinglePlan | SectionBrands | SectionNewsletter;
3
- export declare enum ShopPageSectionType {
4
- LIVE = "LIVE",
5
- CAROUSEL = "CAROUSEL",
6
- INFOBARS = "INFOBARS",
7
- HIGHLIGHTS = "HIGHLIGHTS",
8
- SUBSCRIBER_INFO = "SUBSCRIBER_INFO",
9
- COLLECTION = "COLLECTION",
10
- PLANS = "PLANS",
11
- SINGLE_PLAN = "SINGLE_PLAN",
12
- BRANDS = "BRANDS",
13
- NEWSLETTER = "NEWSLETTER"
14
- }
15
- export type SectionLive = {
16
- type: ShopPageSectionType.LIVE;
17
- fixed: boolean;
18
- editable: boolean;
19
- title: string;
20
- link: string;
21
- active: boolean;
22
- };
23
- export type SectionCarousel = {
24
- type: ShopPageSectionType.CAROUSEL;
25
- fixed: boolean;
26
- editable: boolean;
27
- banners: Banner[];
28
- };
29
- export type SectionInfobars = {
30
- type: ShopPageSectionType.INFOBARS;
31
- fixed: boolean;
32
- editable: boolean;
33
- infobars: Infobar[];
34
- };
35
- export type Infobar = {
36
- link: string;
37
- text: string;
38
- active: boolean;
39
- };
40
- export type SectionHighlights = {
41
- type: ShopPageSectionType.HIGHLIGHTS;
42
- fixed: boolean;
43
- editable: boolean;
44
- highlights: Highlight[];
45
- };
46
- export type Highlight = {
47
- title: string;
48
- link: string;
49
- image: string;
50
- altText: string;
51
- highlighted: boolean;
52
- };
53
- export type SectionSubscriberInfo = {
54
- type: ShopPageSectionType.SUBSCRIBER_INFO;
55
- fixed: boolean;
56
- editable: boolean;
57
- };
58
- export type Banner = {
59
- mobileImage: string;
60
- desktopImage: string;
61
- link: string;
62
- altText: string;
63
- countdown?: string;
64
- displayRules?: DisplayRules;
65
- publishDate?: Date;
66
- expirationDate?: Date;
67
- };
68
- export type SectionCollection = {
69
- type: ShopPageSectionType.COLLECTION;
70
- fixed: boolean;
71
- editable: boolean;
72
- slug: string;
73
- title: string;
74
- categoryId: number;
75
- displayRules?: DisplayRules;
76
- publishDate?: Date;
77
- expirationDate?: Date;
78
- };
79
- export type DisplayRules = {
80
- subscriberBuyer: boolean;
81
- notSubscriber: boolean;
82
- subscriberNotBuyer: boolean;
83
- topBadgeSubscriber: boolean;
84
- };
85
- export type SectionPlans = {
86
- type: ShopPageSectionType.PLANS;
87
- fixed: boolean;
88
- editable: boolean;
89
- };
90
- export type SectionSinglePlan = {
91
- type: ShopPageSectionType.SINGLE_PLAN;
92
- fixed: boolean;
93
- editable: boolean;
94
- };
95
- export type SectionBrands = {
96
- type: ShopPageSectionType.BRANDS;
97
- fixed: boolean;
98
- editable: boolean;
99
- brands: [
100
- {
101
- slug: string;
102
- image: string;
103
- brandName: string;
104
- }
105
- ];
106
- };
107
- export type SectionNewsletter = {
108
- type: ShopPageSectionType.NEWSLETTER;
109
- fixed: boolean;
110
- editable: boolean;
111
- };