@infrab4a/connect 4.20.0-beta.15 → 4.20.0-beta.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.
Files changed (33) hide show
  1. package/index.cjs.js +615 -525
  2. package/index.esm.js +613 -523
  3. package/package.json +1 -1
  4. package/src/domain/shopping/enums/index.d.ts +0 -1
  5. package/src/domain/shopping/interfaces/payment-provider-card.interface.d.ts +0 -2
  6. package/src/domain/shopping/interfaces/payment-provider-glampoints.interface.d.ts +0 -4
  7. package/src/domain/shopping/models/order-blocked.d.ts +6 -4
  8. package/src/domain/shopping/models/payment-transaction.d.ts +60 -60
  9. package/src/{infra/adyen/adapters/adyen-card-payment-axios.adapter.d.ts → domain/shopping/services/adyen-card-payment.service.d.ts} +5 -7
  10. package/src/domain/shopping/services/glampoints-payment.service.d.ts +2 -7
  11. package/src/domain/shopping/services/index.d.ts +4 -0
  12. package/src/domain/shopping/services/pagarme-bank-slip-payment.service.d.ts +12 -0
  13. package/src/domain/shopping/services/pagarme-card-payment.service.d.ts +17 -0
  14. package/src/domain/shopping/services/pagarme-pix-payment.service.d.ts +11 -0
  15. package/src/domain/shopping/types/index.d.ts +0 -1
  16. package/src/domain/shopping/types/payment-card-info.type.d.ts +0 -3
  17. package/src/errors/index.d.ts +0 -1
  18. package/src/errors/types/index.d.ts +0 -1
  19. package/src/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +1 -1
  20. package/src/infra/firebase/firestore/repositories/shopping/order-blocked-firestore.repository.d.ts +2 -2
  21. package/src/infra/firebase/firestore/repositories/shopping/order-blocked-firestore.repository.ts.d.ts +9 -0
  22. package/src/infra/index.d.ts +0 -2
  23. package/src/domain/shopping/enums/order-blocked.enum.d.ts +0 -5
  24. package/src/domain/shopping/types/glam-credentials.type.d.ts +0 -6
  25. package/src/domain/shopping/types/pagarme-card-manual-hash.type.d.ts +0 -6
  26. package/src/errors/types/pagarme-erros.type.d.ts +0 -9
  27. package/src/infra/adyen/adapters/index.d.ts +0 -1
  28. package/src/infra/adyen/index.d.ts +0 -1
  29. package/src/infra/pagarme/adapters/index.d.ts +0 -3
  30. package/src/infra/pagarme/adapters/pagarme-bank-slip-payment-axios.adapter.d.ts +0 -12
  31. package/src/infra/pagarme/adapters/pagarme-card-payment-axios.adapter.d.ts +0 -17
  32. package/src/infra/pagarme/adapters/pagarme-pix-payment-axios.adapter.d.ts +0 -11
  33. package/src/infra/pagarme/index.d.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.20.0-beta.15",
3
+ "version": "4.20.0-beta.5",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -1,6 +1,5 @@
1
1
  export * from './antifraud-providers.enum';
2
2
  export * from './business-unit.enum';
3
- export * from './order-blocked.enum';
4
3
  export * from './pagarme-payment-status.enum';
5
4
  export * from './payment-methods.enum';
6
5
  export * from './payment-providers.enum';
@@ -1,4 +1,3 @@
1
- import { BusinessUnitEnum } from '../enums';
2
1
  import { PaymentTransaction } from '../models';
3
2
  import { Checkout } from '../models/checkout';
4
3
  import { Payment } from '../models/payment';
@@ -8,6 +7,5 @@ export interface PaymentProviderCard<Card extends BaseCard = BaseCard> {
8
7
  pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
9
8
  addCard(card: CardInfo): Promise<Card>;
10
9
  getCardByToken(token: string): Promise<Card>;
11
- createCardHash<T>(bu: BusinessUnitEnum, card?: CardInfo): Promise<string | T>;
12
10
  createTransaction(info: any): Promise<PaymentTransaction>;
13
11
  }
@@ -1,9 +1,5 @@
1
- import { User } from '../../users';
2
- import { LineItem } from '../models';
3
1
  import { Checkout } from '../models/checkout';
4
2
  import { Payment } from '../models/payment';
5
3
  export interface PaymentProviderGlampoints {
6
4
  pay(checkout: Checkout): Promise<Payment>;
7
- rewardByOrder(orderId: string, user: User, lineItems: LineItem[]): Promise<void>;
8
- negativateRewardByOrderId(orderId: string, orderNumber: string): Promise<any>;
9
5
  }
@@ -1,7 +1,5 @@
1
1
  import { BaseModel, GenericIdentifier } from '../../generic';
2
2
  import { UserAddress } from '../../users';
3
- import { OrderBlockedType } from '../enums';
4
- import { Checkout } from './checkout';
5
3
  export declare class OrderBlocked extends BaseModel<OrderBlocked> {
6
4
  id?: string;
7
5
  customer: {
@@ -16,9 +14,13 @@ export declare class OrderBlocked extends BaseModel<OrderBlocked> {
16
14
  };
17
15
  blockType: string;
18
16
  limiteRange: string;
19
- type: OrderBlockedType;
17
+ type: string;
20
18
  card?: any;
21
- checkout: Checkout;
19
+ checkout: {
20
+ id: string;
21
+ shop: string;
22
+ total: number;
23
+ };
22
24
  date: Date;
23
25
  static get identifiersFields(): GenericIdentifier[];
24
26
  }
@@ -1,67 +1,67 @@
1
1
  import { BaseModel } from '../../generic/model/base.model';
2
2
  import { PaymentBilling, PaymentCard, PaymentCustomer, PaymentItem, PaymentShipping } from './types';
3
3
  export declare class PaymentTransaction extends BaseModel<PaymentTransaction> {
4
- id?: number;
5
- object?: string;
6
- status?: string;
7
- tid?: number;
8
- nsu?: number;
4
+ id: number;
5
+ object: string;
6
+ status: string;
7
+ tid: number;
8
+ nsu: number;
9
9
  amount: number;
10
10
  cost: number;
11
- installments?: number;
11
+ installments: number;
12
12
  referer: string;
13
- ip?: string;
14
- phone?: string;
15
- address?: string;
16
- metadata?: any;
17
- device?: string;
18
- payment?: string;
19
- addition?: string;
20
- discount?: string;
21
- customer?: PaymentCustomer;
22
- billing?: PaymentBilling;
23
- shipping?: PaymentShipping;
24
- items?: PaymentItem[];
25
- card?: PaymentCard;
26
- refuse_reason?: string;
27
- status_reason?: string;
28
- acquirer_response_code?: string;
29
- acquirer_name?: string;
30
- acquirer_id?: string;
31
- authorization_code?: string;
32
- soft_descriptor?: string;
33
- date_created?: string;
34
- date_updated?: string;
35
- authorized_amount?: number;
36
- paid_amount?: number;
37
- paid_at?: string;
38
- refunded_amount?: number;
39
- card_holder_name?: string;
40
- card_last_digits?: string;
41
- card_first_digits?: string;
42
- card_brand?: string;
43
- card_pin_mode?: string;
44
- card_magstripe_fallback?: boolean;
45
- cvm_pin?: boolean;
46
- postback_url?: string;
47
- payment_method?: string;
48
- capture_method?: string;
49
- antifraud_score?: string;
50
- boleto_url?: string;
51
- boleto_barcode?: string;
52
- boleto_expiration_date?: string;
53
- subscription_id?: string;
54
- split_rules?: string;
55
- antifraud_metadata?: any;
56
- reference_key?: string;
57
- local_transaction_id?: string;
58
- local_time?: string;
59
- fraudCovered?: boolean;
60
- fraud_reimbursed?: string;
61
- order_id?: string;
62
- risk_level?: string;
63
- receipt_url?: string;
64
- private_label?: string;
65
- pix_qr_code?: string;
66
- pix_expiration_date?: string;
13
+ ip: string;
14
+ phone: string;
15
+ address: string;
16
+ metadata: any;
17
+ device: string;
18
+ payment: string;
19
+ addition: string;
20
+ discount: string;
21
+ customer: PaymentCustomer;
22
+ billing: PaymentBilling;
23
+ shipping: PaymentShipping;
24
+ items: PaymentItem[];
25
+ card: PaymentCard;
26
+ refuseReason: string;
27
+ statusReason: string;
28
+ acquirerResponseCode: string;
29
+ acquirerName: string;
30
+ acquirerId: string;
31
+ authorizationCode: string;
32
+ softDescriptor: string;
33
+ dateCreated: string;
34
+ dateUpdated: string;
35
+ authorizedAmount: number;
36
+ paidAmount: number;
37
+ paidAt: string;
38
+ refundedAmount: number;
39
+ cardHolderName: string;
40
+ cardLastDigits: string;
41
+ cardFirstDigits: string;
42
+ cardBrand: string;
43
+ cardPinMode: string;
44
+ cardMagstripeFallback: boolean;
45
+ cvmPin: boolean;
46
+ postbackUrl: string;
47
+ paymentMethod: string;
48
+ captureMethod: string;
49
+ antifraudScore: string;
50
+ boletoUrl: string;
51
+ boletoBarcode: string;
52
+ boletoExpirationDate: string;
53
+ subscriptionId: string;
54
+ splitRules: string;
55
+ antifraudMetadata: any;
56
+ referenceKey: string;
57
+ localTransactionId: string;
58
+ localTime: string;
59
+ fraudCovered: boolean;
60
+ fraudReimbursed: string;
61
+ orderId: string;
62
+ riskLevel: string;
63
+ receiptUrl: string;
64
+ privateLabel: string;
65
+ pixQrCode: string;
66
+ pixExpirationDate: string;
67
67
  }
@@ -1,14 +1,12 @@
1
- import { BusinessUnitEnum } from '../../../domain';
2
- import { PaymentProviderCard } from '../../../domain/shopping/interfaces';
3
- import { Checkout, Payment, PaymentTransaction } from '../../../domain/shopping/models';
4
- import { OrderBlockedRepository, PaymentRepository } from '../../../domain/shopping/repositories';
5
- import { AdyenCard, AdyenCredentials, PaymentCardInfo } from '../../../domain/shopping/types';
6
- export declare class AdyenCardAxiosAdapter implements PaymentProviderCard<AdyenCard> {
1
+ import { PaymentProviderCard } from '../interfaces';
2
+ import { Checkout, Payment, PaymentTransaction } from '../models';
3
+ import { OrderBlockedRepository, PaymentRepository } from '../repositories';
4
+ import { AdyenCard, AdyenCredentials, PaymentCardInfo } from '../types';
5
+ export declare class AdyenCardService implements PaymentProviderCard<AdyenCard> {
7
6
  private credentials;
8
7
  private paymentRepository;
9
8
  private orderBlockedRepository;
10
9
  constructor(credentials: AdyenCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
11
- createCardHash(bu: BusinessUnitEnum): Promise<string>;
12
10
  pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
13
11
  private createCardPayment;
14
12
  addCard(): Promise<AdyenCard>;
@@ -1,13 +1,8 @@
1
- import { User } from '../../users';
2
1
  import { PaymentProviderGlampoints } from '../interfaces';
3
- import { Checkout, LineItem, Payment } from '../models';
2
+ import { Checkout, Payment } from '../models';
4
3
  import { PaymentRepository } from '../repositories';
5
- import { GlamCredentials } from '../types';
6
4
  export declare class GlampointsPaymentService implements PaymentProviderGlampoints {
7
- private glamCredentials;
8
5
  private paymentRepository;
9
- constructor(glamCredentials: GlamCredentials, paymentRepository: PaymentRepository);
6
+ constructor(paymentRepository: PaymentRepository);
10
7
  pay(checkout: Checkout): Promise<Payment>;
11
- rewardByOrder(orderId: string, user: User, lineItens: LineItem[]): Promise<any>;
12
- negativateRewardByOrderId(orderId: string, orderNumber: string): Promise<any>;
13
8
  }
@@ -1,5 +1,9 @@
1
+ export * from './adyen-card-payment.service';
1
2
  export * from './antifraud-bankslip.service';
2
3
  export * from './antifraud-card.service';
3
4
  export * from './antifraud-glampoints.service';
4
5
  export * from './antifraud-pix.service';
5
6
  export * from './glampoints-payment.service';
7
+ export * from './pagarme-bank-slip-payment.service';
8
+ export * from './pagarme-card-payment.service';
9
+ export * from './pagarme-pix-payment.service';
@@ -0,0 +1,12 @@
1
+ import { PaymentProviderBankSlip } from '../interfaces';
2
+ import { Checkout, Payment, PaymentTransaction } from '../models';
3
+ import { PaymentRepository } from '../repositories';
4
+ import { PagarmeCredentials } from '../types';
5
+ export declare class PagarmeBankSlipService implements PaymentProviderBankSlip {
6
+ private credentials;
7
+ private paymentRepository;
8
+ constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository);
9
+ pay(checkout: Checkout): Promise<Payment>;
10
+ getBoletoTransaction(paymentId: number): Promise<PaymentTransaction>;
11
+ private createBoletoPayment;
12
+ }
@@ -0,0 +1,17 @@
1
+ import { BusinessUnitEnum } from '../enums';
2
+ import { PaymentProviderCard } from '../interfaces';
3
+ import { Checkout, Payment, PaymentTransaction } from '../models';
4
+ import { OrderBlockedRepository, PaymentRepository } from '../repositories';
5
+ import { CardInfo, PagarMeCard, PagarmeCredentials, PaymentCardInfo } from '../types';
6
+ export declare class PagarmeCardService implements PaymentProviderCard<PagarMeCard> {
7
+ private credentials;
8
+ private paymentRepository;
9
+ private orderBlockedRepository;
10
+ constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
11
+ pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
12
+ addCard(card: CardInfo): Promise<PagarMeCard>;
13
+ createCardHash(bu: BusinessUnitEnum): Promise<string>;
14
+ getCardByToken(id: string): Promise<PagarMeCard>;
15
+ createTransaction(info: any): Promise<PaymentTransaction>;
16
+ private createCardPayment;
17
+ }
@@ -0,0 +1,11 @@
1
+ import { PaymentProviderPix } from '../interfaces';
2
+ import { Checkout, Payment } from '../models';
3
+ import { PaymentRepository } from '../repositories';
4
+ import { PagarmeCredentials } from '../types';
5
+ export declare class PagarmePixService implements PaymentProviderPix {
6
+ private credentials;
7
+ private paymentRepository;
8
+ constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository);
9
+ pay(checkout: Checkout): Promise<Payment>;
10
+ private createPixPayment;
11
+ }
@@ -2,7 +2,6 @@ export * from './adyen-card.type';
2
2
  export * from './adyen-credentials.type';
3
3
  export * from './antifraud-provider.type';
4
4
  export * from './card-info.type';
5
- export * from './glam-credentials.type';
6
5
  export * from './order-tracking-events.type';
7
6
  export * from './pagarme-card.type';
8
7
  export * from './pagarme-credentials.type';
@@ -1,7 +1,4 @@
1
1
  export type PaymentCardInfo = {
2
2
  cardId: string;
3
- cardCvv?: string;
4
3
  installments: number;
5
- cpf?: string;
6
- fingerprint?: string;
7
4
  };
@@ -7,4 +7,3 @@ export * from './payment.error';
7
7
  export * from './required-argument.error';
8
8
  export * from './stock-limit.error';
9
9
  export * from './stock-out.error';
10
- export * from './types';
@@ -1,2 +1 @@
1
1
  export * from './checkout-additional-data-erro.type';
2
- export * from './pagarme-erros.type';
@@ -5,7 +5,7 @@ import { FirestoreRepository, FirestoreSubRepository } from '../types';
5
5
  export declare const withHelpers: <TMixinBase extends MixinCtor<any, any[]> = MixinCtor<any, any[]>>(MixinBase: MixinCtor<any, any[]> & TMixinBase) => {
6
6
  new (...args: any[]): {
7
7
  [x: string]: any;
8
- toArray<T extends ModelBaseStructure<T, T["identifiersFields"][number]>>(snapShot: QuerySnapshot<T> | QueryDocumentSnapshot<T>[]): T[];
8
+ toArray<T extends ModelBaseStructure<T, T["identifiersFields"][number]>>(snapShot: QuerySnapshot<T, import("firebase/firestore").DocumentData> | QueryDocumentSnapshot<T, import("firebase/firestore").DocumentData>[]): T[];
9
9
  isSubCollection<T_1 extends ModelBaseStructure<T_1, T_1["identifiersFields"][number]>, E extends ModelBaseStructure<E, E["identifiersFields"][number]>>(repository: FirestoreRepository<T_1> | FirestoreSubRepository<T_1, E>): repository is FirestoreSubRepository<T_1, E>;
10
10
  };
11
11
  } & TMixinBase;
@@ -1,9 +1,9 @@
1
- import { Checkout, OrderBlocked, OrderBlockedRepository, OrderBlockedType, PaymentCardInfo } from '../../../../../domain';
1
+ import { Checkout, OrderBlocked, OrderBlockedRepository, PaymentCardInfo } from '../../../../../domain';
2
2
  import { FirestoreConstructorParams } from '../../mixins';
3
3
  declare const OrderBlockedFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("../..").FirestoreRepository<OrderBlocked> & import("../../../../../domain").CrudRepository<OrderBlocked, import("../../../../../domain").CrudParams<OrderBlocked>> & import("../..").FirestoreHelpers, [FirestoreConstructorParams<OrderBlocked>, ...any[]]>;
4
4
  export declare class OrderBlockedFirestoreRepository extends OrderBlockedFirestoreRepository_base implements OrderBlockedRepository {
5
5
  constructor({ firestore, interceptors, }: Pick<FirestoreConstructorParams<OrderBlocked>, 'firestore' | 'interceptors'>);
6
- createBlockedOrderOrPayment(checkout: Checkout, blockType: string, type: OrderBlockedType, limiteRange: string, card?: PaymentCardInfo): Promise<OrderBlocked>;
6
+ createBlockedOrderOrPayment(checkout: Checkout, blockType: string, type: string, limiteRange: string, card?: PaymentCardInfo): Promise<OrderBlocked>;
7
7
  private formatZip;
8
8
  }
9
9
  export {};
@@ -0,0 +1,9 @@
1
+ import { Checkout, OrderBlocked, OrderBlockedRepository, PaymentCardInfo } from '../../../../../domain';
2
+ import { FirestoreConstructorParams } from '../../mixins';
3
+ declare const OrderBlockedFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("../..").FirestoreRepository<OrderBlocked> & import("../../../../../domain").CrudRepository<OrderBlocked, import("../../../../../domain").CrudParams<OrderBlocked>> & import("../..").FirestoreHelpers, [FirestoreConstructorParams<OrderBlocked>, ...any[]]>;
4
+ export declare class OrderBlockedFirestoreRepository extends OrderBlockedFirestoreRepository_base implements OrderBlockedRepository {
5
+ constructor({ firestore, interceptors, }: Pick<FirestoreConstructorParams<OrderBlocked>, 'firestore' | 'interceptors'>);
6
+ createBlockedOrderOrPayment(checkout: Checkout, blockType: string, type: string, limiteRange: string, card?: PaymentCardInfo): Promise<OrderBlocked>;
7
+ private formatZip;
8
+ }
9
+ export {};
@@ -1,6 +1,4 @@
1
- export * from './adyen';
2
1
  export * from './elasticsearch';
3
2
  export * from './firebase';
4
3
  export * from './hasura-graphql';
5
- export * from './pagarme';
6
4
  export * from './vertex-ai';
@@ -1,5 +0,0 @@
1
- export declare enum OrderBlockedType {
2
- Checkout = "Checkout",
3
- Card = "Card",
4
- Boleto = "Boleto"
5
- }
@@ -1,6 +0,0 @@
1
- export type GlamCredentials = {
2
- baseUrl: string;
3
- username: string;
4
- password: string;
5
- integrationToken: string;
6
- };
@@ -1,6 +0,0 @@
1
- import { BaseCard } from './base-card.type';
2
- export interface PagarMeCardManualHash extends BaseCard {
3
- id: string;
4
- public_key: string;
5
- date_created: string;
6
- }
@@ -1,9 +0,0 @@
1
- export type PagarMeError = {
2
- errors: {
3
- message: string;
4
- parameter_name: string;
5
- type: string;
6
- }[];
7
- method: string;
8
- url: string;
9
- };
@@ -1 +0,0 @@
1
- export * from './adyen-card-payment-axios.adapter';
@@ -1 +0,0 @@
1
- export * from './adapters';
@@ -1,3 +0,0 @@
1
- export * from './pagarme-bank-slip-payment-axios.adapter';
2
- export * from './pagarme-card-payment-axios.adapter';
3
- export * from './pagarme-pix-payment-axios.adapter';
@@ -1,12 +0,0 @@
1
- import { PaymentProviderBankSlip } from '../../../domain/shopping/interfaces';
2
- import { Checkout, Payment, PaymentTransaction } from '../../../domain/shopping/models';
3
- import { PaymentRepository } from '../../../domain/shopping/repositories';
4
- import { PagarmeCredentials } from '../../../domain/shopping/types';
5
- export declare class PagarmeBankSlipAxiosAdapter implements PaymentProviderBankSlip {
6
- private credentials;
7
- private paymentRepository;
8
- constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository);
9
- pay(checkout: Checkout): Promise<Payment>;
10
- getBoletoTransaction(paymentId: number): Promise<PaymentTransaction>;
11
- private createBoletoPayment;
12
- }
@@ -1,17 +0,0 @@
1
- import { BusinessUnitEnum } from '../../../domain/shopping/enums';
2
- import { PaymentProviderCard } from '../../../domain/shopping/interfaces';
3
- import { Checkout, Payment, PaymentTransaction } from '../../../domain/shopping/models';
4
- import { OrderBlockedRepository, PaymentRepository } from '../../../domain/shopping/repositories';
5
- import { CardInfo, PagarMeCard, PagarmeCredentials, PaymentCardInfo } from '../../../domain/shopping/types';
6
- export declare class PagarmeCardAxiosAdapter implements PaymentProviderCard<PagarMeCard> {
7
- private credentials;
8
- private paymentRepository;
9
- private orderBlockedRepository;
10
- constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository, orderBlockedRepository: OrderBlockedRepository);
11
- pay(checkout: Checkout, card: PaymentCardInfo): Promise<Payment>;
12
- addCard(card: CardInfo): Promise<PagarMeCard>;
13
- createCardHash<PagarMeCardManualHash>(bu: BusinessUnitEnum): Promise<PagarMeCardManualHash>;
14
- getCardByToken(id: string): Promise<PagarMeCard>;
15
- createTransaction(info: any): Promise<PaymentTransaction>;
16
- private createCardPayment;
17
- }
@@ -1,11 +0,0 @@
1
- import { PaymentProviderPix } from '../../../domain/shopping/interfaces';
2
- import { Checkout, Payment } from '../../../domain/shopping/models';
3
- import { PaymentRepository } from '../../../domain/shopping/repositories';
4
- import { PagarmeCredentials } from '../../../domain/shopping/types';
5
- export declare class PagarmePixAxiosAdapter implements PaymentProviderPix {
6
- private credentials;
7
- private paymentRepository;
8
- constructor(credentials: PagarmeCredentials, paymentRepository: PaymentRepository);
9
- pay(checkout: Checkout): Promise<Payment>;
10
- private createPixPayment;
11
- }
@@ -1 +0,0 @@
1
- export * from './adapters';