@provis/provis-common-be-module 2.5.5 → 2.5.7

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.
@@ -1,10 +1,8 @@
1
+ import IUser from "../interface/user.interface";
2
+ export type Request = {
3
+ headers: Record<string, any>;
4
+ };
1
5
  declare const _default: (req: Request, { isUserCodeMandatory }?: {
2
6
  isUserCodeMandatory?: boolean;
3
- }) => {
4
- userCode: string;
5
- username: string;
6
- userEmail: string;
7
- isAdmin: string;
8
- isPublic: string;
9
- };
7
+ }) => IUser;
10
8
  export default _default;
@@ -22,4 +22,6 @@ import mergeObj from "./mergeObj";
22
22
  import combineObj from "./combineObj";
23
23
  import calculateByType from './calculateByType';
24
24
  import getCargoType from "./getCargoType";
25
- export { addDateTime, amountDescription, axiosGet, axiosPost, axiosPut, compareDiffObj, convertCurrencySymbol, convertDateTimeFormat, convertObjToNumber, convertToCurrency, filterObj, generateRelationId, getCurrentDate, getDiffValue, getObjByKeys, loop, loopBackward, searchValue, readExcel, generateHashString, mergeObj, combineObj, calculateByType, getCargoType, };
25
+ import getHeaderUser from "./getHeaderUser";
26
+ import setHeaderUser from "./setHeaderUser";
27
+ export { addDateTime, amountDescription, axiosGet, axiosPost, axiosPut, compareDiffObj, convertCurrencySymbol, convertDateTimeFormat, convertObjToNumber, convertToCurrency, filterObj, generateRelationId, getCurrentDate, getDiffValue, getObjByKeys, loop, loopBackward, searchValue, readExcel, generateHashString, mergeObj, combineObj, calculateByType, getCargoType, getHeaderUser, setHeaderUser, };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCargoType = exports.calculateByType = exports.combineObj = exports.mergeObj = exports.generateHashString = exports.readExcel = exports.searchValue = exports.loopBackward = exports.loop = exports.getObjByKeys = exports.getDiffValue = exports.getCurrentDate = exports.generateRelationId = exports.filterObj = exports.convertToCurrency = exports.convertObjToNumber = exports.convertDateTimeFormat = exports.convertCurrencySymbol = exports.compareDiffObj = exports.axiosPut = exports.axiosPost = exports.axiosGet = exports.amountDescription = exports.addDateTime = void 0;
3
+ exports.setHeaderUser = exports.getHeaderUser = exports.getCargoType = exports.calculateByType = exports.combineObj = exports.mergeObj = exports.generateHashString = exports.readExcel = exports.searchValue = exports.loopBackward = exports.loop = exports.getObjByKeys = exports.getDiffValue = exports.getCurrentDate = exports.generateRelationId = exports.filterObj = exports.convertToCurrency = exports.convertObjToNumber = exports.convertDateTimeFormat = exports.convertCurrencySymbol = exports.compareDiffObj = exports.axiosPut = exports.axiosPost = exports.axiosGet = exports.amountDescription = exports.addDateTime = void 0;
4
4
  const addDateTime_1 = require("./addDateTime");
5
5
  exports.addDateTime = addDateTime_1.default;
6
6
  const amountDescription_1 = require("./amountDescription");
@@ -49,3 +49,7 @@ const calculateByType_1 = require("./calculateByType");
49
49
  exports.calculateByType = calculateByType_1.default;
50
50
  const getCargoType_1 = require("./getCargoType");
51
51
  exports.getCargoType = getCargoType_1.default;
52
+ const getHeaderUser_1 = require("./getHeaderUser");
53
+ exports.getHeaderUser = getHeaderUser_1.default;
54
+ const setHeaderUser_1 = require("./setHeaderUser");
55
+ exports.setHeaderUser = setHeaderUser_1.default;
@@ -0,0 +1,9 @@
1
+ import IUser from "../interface/user.interface";
2
+ declare const _default: (user: IUser) => {
3
+ 'x-user': string;
4
+ 'x-username': string;
5
+ 'x-useremail': string;
6
+ 'x-admin': string;
7
+ 'x-public': string;
8
+ };
9
+ export default _default;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = (user) => {
4
+ return {
5
+ 'x-user': user.userCode,
6
+ 'x-username': user.username,
7
+ 'x-useremail': user.userEmail,
8
+ 'x-admin': user.isAdmin,
9
+ 'x-public': user.isPublic,
10
+ };
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@provis/provis-common-be-module",
3
- "version": "2.5.5",
3
+ "version": "2.5.7",
4
4
  "description": "This common module for Provis internal backend use lib",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -12,7 +12,6 @@
12
12
  "license": "ISC",
13
13
  "dependencies": {
14
14
  "axios": "^0.21.1",
15
- "express": "^5.1.0",
16
15
  "js-sha512": "^0.9.0",
17
16
  "lodash": "^4.17.21",
18
17
  "typeorm": "^0.2.25",