vineanova-redux-artifacts 1.83.0 → 1.84.0

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/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ## 1.83.0 (2022-10-14)
5
+ ## 1.84.0 (2022-10-16)
6
6
 
7
7
 
8
8
  ### Features
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
+ var _get = _interopRequireDefault(require("lodash/get"));
7
8
  var _axios = _interopRequireDefault(require("axios"));
8
9
  var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
9
10
  var _isNil = _interopRequireDefault(require("lodash/isNil"));
@@ -33,10 +34,10 @@ var ServiceConfigClass = /*#__PURE__*/function () {
33
34
  key: "getBaseUri",
34
35
  value: function getBaseUri(serviceType) {
35
36
  _winstonLogger["default"].debug(this.config);
36
- var userEmail = get(this.config, 'user.email', null);
37
+ var userEmail = (0, _get["default"])(this.config, 'user.email', null);
37
38
  var isDemoUser = userEmail === 'VineaNovaDemoAdmin.com' && serviceType !== 'login';
38
- var isTest = get(this.config, 'environment.isTest', null);
39
- var isLocalHost = get(this.config, 'environment.isLocalHost', null);
39
+ var isTest = (0, _get["default"])(this.config, 'environment.isTest', null);
40
+ var isLocalHost = (0, _get["default"])(this.config, 'environment.isLocalHost', null);
40
41
  isTest = isTest || isLocalHost;
41
42
  if (serviceType === 'mock' || isDemoUser) {
42
43
  apiUrl = mockApiUrl;
@@ -78,6 +79,7 @@ var ServiceConfigClass = /*#__PURE__*/function () {
78
79
  _winstonLogger["default"].debug("serviceType", {
79
80
  serviceType: serviceType
80
81
  });
82
+ var isTest = (0, _get["default"])(this.config, 'environment.isTest', null);
81
83
  var _this$config$user = this.config.user,
82
84
  accessToken = _this$config$user.accessToken,
83
85
  orgDetails = _this$config$user.orgDetails;
@@ -95,6 +97,8 @@ var ServiceConfigClass = /*#__PURE__*/function () {
95
97
  });
96
98
  client.interceptors.request.use(function (config) {
97
99
  // Do something before request is sent
100
+ var appCode = isTest ? process.env.REACT_APP_FUNCTION_CODE : process.env.REACT_APP_PROD_FUNCTION_CODE;
101
+ config.params.code = appCode;
98
102
  config.headers.Authorization = "Bearer ".concat(accessToken);
99
103
  config.headers["x-orgname"] = displayName;
100
104
  config.headers["x-tid"] = id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vineanova-redux-artifacts",
3
- "version": "1.83.0",
3
+ "version": "1.84.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "browser": "lib/index.js",
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable class-methods-use-this */
2
2
  /* eslint-disable no-param-reassign */
3
+ import get from 'lodash/get';
3
4
  import axios from "axios";
4
5
  import isEmpty from "lodash/isEmpty";
5
6
  import isNil from "lodash/isNil";
@@ -65,6 +66,7 @@ class ServiceConfigClass {
65
66
  request(options, serviceType) {
66
67
  // logger.debug('currentConfig', this.config);
67
68
  logger.debug("serviceType", { serviceType });
69
+ const isTest = get(this.config, 'environment.isTest', null);
68
70
  const { accessToken, orgDetails } = this.config.user;
69
71
  if (isEmpty(accessToken) || isNil(accessToken) || isEmpty(orgDetails)) {
70
72
  throw new Error("serviceConfig -> No Access token available");
@@ -82,6 +84,10 @@ class ServiceConfigClass {
82
84
  client.interceptors.request.use(
83
85
  (config) => {
84
86
  // Do something before request is sent
87
+ const appCode = isTest
88
+ ? process.env.REACT_APP_FUNCTION_CODE
89
+ : process.env.REACT_APP_PROD_FUNCTION_CODE;
90
+ config.params.code = appCode;
85
91
  config.headers.Authorization = `Bearer ${accessToken}`;
86
92
  config.headers["x-orgname"] = displayName;
87
93
  config.headers["x-tid"] = id;