@infrab4a/connect 4.22.0-beta.0 → 4.22.0-beta.1

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
@@ -2537,12 +2537,14 @@ class GlampointsPaymentService {
2537
2537
  glambeauty: hasGlambeauty,
2538
2538
  }),
2539
2539
  });
2540
- console.info('[rewards - rewardByOrder] reward success:', JSON.stringify(result));
2540
+ console.log('[rewards - rewardByOrder] reward success:', order.orderNumber, JSON.stringify(result.data));
2541
2541
  return result.data;
2542
2542
  }
2543
- catch (err) {
2544
- console.log(err);
2545
- console.error('[rewards - rewardByOrder] reward request error', JSON.stringify(err));
2543
+ catch (error) {
2544
+ if (error instanceof axios.AxiosError)
2545
+ console.error('[rewards - rewardByOrder] reward request error', error.response.status, JSON.stringify(error.response.data.message), order.orderNumber);
2546
+ else
2547
+ console.log(JSON.stringify(error));
2546
2548
  }
2547
2549
  }
2548
2550
  async negativateRewardByOrderId(order) {
@@ -2567,7 +2569,10 @@ class GlampointsPaymentService {
2567
2569
  return result;
2568
2570
  }
2569
2571
  catch (error) {
2570
- return error;
2572
+ if (error instanceof axios.AxiosError)
2573
+ console.error('[negativateRewardByOrderId] request error', error.response.status, JSON.stringify(error.response.data.message), order.orderNumber);
2574
+ else
2575
+ console.log(JSON.stringify(error));
2571
2576
  }
2572
2577
  }
2573
2578
  }
package/index.esm.js CHANGED
@@ -7,7 +7,7 @@ import { isNil, isArray, first, last, flatten, compact, get, isString, each, uns
7
7
  export { chunk, each, get, isBoolean, isDate, isEmpty, isInteger, isNaN, isNil, isNumber, isObject, isString, now, omit, pick, set, sortBy, unset } from 'lodash';
8
8
  import { debug } from 'debug';
9
9
  import { CustomError } from 'ts-custom-error';
10
- import axios from 'axios';
10
+ import axios, { AxiosError } from 'axios';
11
11
  import { signInWithEmailAndPassword, signInWithPopup, GoogleAuthProvider, signInAnonymously, sendPasswordResetEmail, createUserWithEmailAndPassword, sendEmailVerification } from 'firebase/auth';
12
12
  import { deleteField, arrayUnion, arrayRemove, Timestamp, doc, getDoc, updateDoc, setDoc, deleteDoc, collection, limit, getDocs, query, where, orderBy, startAfter, addDoc } from 'firebase/firestore';
13
13
  import { ref, uploadBytes } from 'firebase/storage';
@@ -2531,12 +2531,14 @@ class GlampointsPaymentService {
2531
2531
  glambeauty: hasGlambeauty,
2532
2532
  }),
2533
2533
  });
2534
- console.info('[rewards - rewardByOrder] reward success:', JSON.stringify(result));
2534
+ console.log('[rewards - rewardByOrder] reward success:', order.orderNumber, JSON.stringify(result.data));
2535
2535
  return result.data;
2536
2536
  }
2537
- catch (err) {
2538
- console.log(err);
2539
- console.error('[rewards - rewardByOrder] reward request error', JSON.stringify(err));
2537
+ catch (error) {
2538
+ if (error instanceof AxiosError)
2539
+ console.error('[rewards - rewardByOrder] reward request error', error.response.status, JSON.stringify(error.response.data.message), order.orderNumber);
2540
+ else
2541
+ console.log(JSON.stringify(error));
2540
2542
  }
2541
2543
  }
2542
2544
  async negativateRewardByOrderId(order) {
@@ -2561,7 +2563,10 @@ class GlampointsPaymentService {
2561
2563
  return result;
2562
2564
  }
2563
2565
  catch (error) {
2564
- return error;
2566
+ if (error instanceof AxiosError)
2567
+ console.error('[negativateRewardByOrderId] request error', error.response.status, JSON.stringify(error.response.data.message), order.orderNumber);
2568
+ else
2569
+ console.log(JSON.stringify(error));
2565
2570
  }
2566
2571
  }
2567
2572
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.22.0-beta.0",
3
+ "version": "4.22.0-beta.1",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },