@infrab4a/connect 4.20.0-beta.13 → 4.20.0-beta.15

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
@@ -2502,9 +2502,13 @@ class GlampointsPaymentService {
2502
2502
  const result = await axios__default["default"]({
2503
2503
  method: 'POST',
2504
2504
  url: `${this.glamCredentials.baseUrl}/integration/win/reward`,
2505
- headers: { 'Content-Type': 'application/json' },
2505
+ headers: {
2506
+ 'Content-Type': 'application/json',
2507
+ Authorization: `Bearer ${this.glamCredentials.integrationToken}`,
2508
+ Origin: 'https://cloudfunctions.b4a.com.br',
2509
+ },
2506
2510
  timeout: 60000,
2507
- data: {
2511
+ data: JSON.stringify({
2508
2512
  personId: user.id,
2509
2513
  rewardType: 50,
2510
2514
  referenceId: 0,
@@ -2513,14 +2517,15 @@ class GlampointsPaymentService {
2513
2517
  productId: '',
2514
2518
  token: this.glamCredentials.integrationToken,
2515
2519
  orderId,
2516
- },
2520
+ glambeauty: lineItens === null || lineItens === void 0 ? void 0 : lineItens.some((doc) => doc.brand && doc.brand.toUpperCase() === 'GLAM BEAUTY'),
2521
+ }),
2517
2522
  });
2518
2523
  console.info('[rewards - rewardByOrder] reward success:', JSON.stringify(result));
2519
2524
  return result.data;
2520
2525
  }
2521
2526
  catch (err) {
2527
+ console.log(err);
2522
2528
  console.error('[rewards - rewardByOrder] reward request error', JSON.stringify(err));
2523
- return err;
2524
2529
  }
2525
2530
  }
2526
2531
  async negativateRewardByOrderId(orderId, orderNumber) {
@@ -2528,15 +2533,19 @@ class GlampointsPaymentService {
2528
2533
  const result = await axios__default["default"]({
2529
2534
  method: 'POST',
2530
2535
  url: `${this.glamCredentials.baseUrl}/integration/negativate/reward`,
2531
- headers: { 'Content-Type': 'application/json' },
2536
+ headers: {
2537
+ 'Content-Type': 'application/json',
2538
+ Authorization: `Bearer ${this.glamCredentials.integrationToken}`,
2539
+ Origin: 'https://cloudfunctions.b4a.com.br',
2540
+ },
2532
2541
  timeout: 60000,
2533
- data: {
2542
+ data: JSON.stringify({
2534
2543
  rewardType: 51,
2535
2544
  referenceName: `Pedido #${orderId} cancelado`,
2536
2545
  token: '$2a$12$2DAPE64UUWAo4TT/1eQ9TOJO40b5z2jdomOJG3X7LeexwOHYtPydW',
2537
2546
  orderId,
2538
2547
  orderNumber: parseInt(orderNumber.replace(/\D/g, ''), 10),
2539
- },
2548
+ }),
2540
2549
  });
2541
2550
  return result;
2542
2551
  }
package/index.esm.js CHANGED
@@ -2496,9 +2496,13 @@ class GlampointsPaymentService {
2496
2496
  const result = await axios({
2497
2497
  method: 'POST',
2498
2498
  url: `${this.glamCredentials.baseUrl}/integration/win/reward`,
2499
- headers: { 'Content-Type': 'application/json' },
2499
+ headers: {
2500
+ 'Content-Type': 'application/json',
2501
+ Authorization: `Bearer ${this.glamCredentials.integrationToken}`,
2502
+ Origin: 'https://cloudfunctions.b4a.com.br',
2503
+ },
2500
2504
  timeout: 60000,
2501
- data: {
2505
+ data: JSON.stringify({
2502
2506
  personId: user.id,
2503
2507
  rewardType: 50,
2504
2508
  referenceId: 0,
@@ -2507,14 +2511,15 @@ class GlampointsPaymentService {
2507
2511
  productId: '',
2508
2512
  token: this.glamCredentials.integrationToken,
2509
2513
  orderId,
2510
- },
2514
+ glambeauty: lineItens === null || lineItens === void 0 ? void 0 : lineItens.some((doc) => doc.brand && doc.brand.toUpperCase() === 'GLAM BEAUTY'),
2515
+ }),
2511
2516
  });
2512
2517
  console.info('[rewards - rewardByOrder] reward success:', JSON.stringify(result));
2513
2518
  return result.data;
2514
2519
  }
2515
2520
  catch (err) {
2521
+ console.log(err);
2516
2522
  console.error('[rewards - rewardByOrder] reward request error', JSON.stringify(err));
2517
- return err;
2518
2523
  }
2519
2524
  }
2520
2525
  async negativateRewardByOrderId(orderId, orderNumber) {
@@ -2522,15 +2527,19 @@ class GlampointsPaymentService {
2522
2527
  const result = await axios({
2523
2528
  method: 'POST',
2524
2529
  url: `${this.glamCredentials.baseUrl}/integration/negativate/reward`,
2525
- headers: { 'Content-Type': 'application/json' },
2530
+ headers: {
2531
+ 'Content-Type': 'application/json',
2532
+ Authorization: `Bearer ${this.glamCredentials.integrationToken}`,
2533
+ Origin: 'https://cloudfunctions.b4a.com.br',
2534
+ },
2526
2535
  timeout: 60000,
2527
- data: {
2536
+ data: JSON.stringify({
2528
2537
  rewardType: 51,
2529
2538
  referenceName: `Pedido #${orderId} cancelado`,
2530
2539
  token: '$2a$12$2DAPE64UUWAo4TT/1eQ9TOJO40b5z2jdomOJG3X7LeexwOHYtPydW',
2531
2540
  orderId,
2532
2541
  orderNumber: parseInt(orderNumber.replace(/\D/g, ''), 10),
2533
- },
2542
+ }),
2534
2543
  });
2535
2544
  return result;
2536
2545
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.20.0-beta.13",
3
+ "version": "4.20.0-beta.15",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -2,4 +2,6 @@ export type PaymentCardInfo = {
2
2
  cardId: string;
3
3
  cardCvv?: string;
4
4
  installments: number;
5
+ cpf?: string;
6
+ fingerprint?: string;
5
7
  };
@@ -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, import("firebase/firestore").DocumentData> | QueryDocumentSnapshot<T, import("firebase/firestore").DocumentData>[]): T[];
8
+ toArray<T extends ModelBaseStructure<T, T["identifiersFields"][number]>>(snapShot: QuerySnapshot<T> | QueryDocumentSnapshot<T>[]): 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;