@provis/provis-common-be-module 2.6.6 → 2.6.8

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.
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const occupation_simple_1 = require("./product/property/occupation-simple");
4
4
  const product = {
5
- LIST: {}, // ini buat semua product
6
- MANUAL_LIST: [], // ini buat product yang bisa diadd manual -> di form quotation / policy
5
+ LIST: {},
6
+ MANUAL_LIST: [],
7
7
  CARGO_BY_SYSTEM_LIST: [],
8
8
  PRODUCT_CODE_PROPERTY_ALL_RISK: 'polismall-property-allrisk',
9
9
  PRODUCT_CODE_EARTHQUAKE: 'polismall-earthquake',
@@ -52,17 +52,17 @@ const product = {
52
52
  PRODUCT_CODE_CARGO_BUNDLE: 'polismall-cargo-bundle',
53
53
  PRODUCT_CODE_MERIMEN_CARGO: 'polismall-merimen-cargo',
54
54
  PRODUCT_CODE_CARGO_TEMAS: 'polismall-cargo-temas',
55
- PRODUCT_CODE_CARGO_SINGLE_SHIPMENT: 'polismall-cargo-single-shipment', // Marine Cargo Single Shipment, buat add manual di policy
55
+ PRODUCT_CODE_CARGO_SINGLE_SHIPMENT: 'polismall-cargo-single-shipment',
56
56
  // OTTO
57
- PRODUCT_CODE_OTTO_CI: 'polismall-otto-critical-illness', // ELI
58
- PRODUCT_CODE_OTTO_FLEXAS: 'polismall-otto-flexas', // MNC
59
- PRODUCT_CODE_OTTO_CRACK_SCREEN: 'polismall-otto-crack', // MNC
60
- PRODUCT_CODE_OTTO_AUM_GP: 'polismall-otto-aum-gp', // AUM Gamers Protection
61
- PRODUCT_CODE_OTTO_AUM_PLN: 'polismall-otto-aum-pln', // AUM Biller Protection PLN
62
- PRODUCT_CODE_OTTO_AUM_PDAM: 'polismall-otto-aum-pdam', // AUM Biller Protection PDAM
63
- PRODUCT_CODE_OTTO_AUM_SB: 'polismall-otto-aum-sb', // AUM Merchant Protection Stock Barang
64
- PRODUCT_CODE_OTTO_AUM_FB: 'polismall-otto-aum-fb', // AUM Merchant Protection FLEXAS+BANJIR
65
- PRODUCT_CODE_OTTO_AUM_FBK: 'polismall-otto-aum-fbk', // AUM Merchant Protection FLEXAS+BANJIR+KEBONGKARAN
57
+ PRODUCT_CODE_OTTO_CI: 'polismall-otto-critical-illness',
58
+ PRODUCT_CODE_OTTO_FLEXAS: 'polismall-otto-flexas',
59
+ PRODUCT_CODE_OTTO_CRACK_SCREEN: 'polismall-otto-crack',
60
+ PRODUCT_CODE_OTTO_AUM_GP: 'polismall-otto-aum-gp',
61
+ PRODUCT_CODE_OTTO_AUM_PLN: 'polismall-otto-aum-pln',
62
+ PRODUCT_CODE_OTTO_AUM_PDAM: 'polismall-otto-aum-pdam',
63
+ PRODUCT_CODE_OTTO_AUM_SB: 'polismall-otto-aum-sb',
64
+ PRODUCT_CODE_OTTO_AUM_FB: 'polismall-otto-aum-fb',
65
+ PRODUCT_CODE_OTTO_AUM_FBK: 'polismall-otto-aum-fbk',
66
66
  // BDKI
67
67
  PRODUCT_CODE_BDKI_MOTOR: 'polismall-bdki-motor',
68
68
  PRODUCT_CODE_BDKI_RUMAH: 'polismall-bdki-rumah',
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = terbilang;
4
3
  function terbilang(value) {
5
4
  const satuan = ['', 'satu', 'dua', 'tiga', 'empat', 'lima', 'enam', 'tujuh', 'delapan', 'sembilan'];
6
5
  const belasan = ['sepuluh', 'sebelas', 'dua belas', 'tiga belas', 'empat belas', 'lima belas', 'enam belas', 'tujuh belas', 'delapan belas', 'sembilan belas'];
@@ -42,3 +41,4 @@ function terbilang(value) {
42
41
  // Menghilangkan spasi yang double
43
42
  return result.replace(/\s+/g, ' ').trim();
44
43
  }
44
+ exports.default = terbilang;
@@ -13,7 +13,7 @@ const axios_1 = require("axios");
13
13
  const generateRelationId_1 = require("./generateRelationId");
14
14
  const getCurrentDate_1 = require("./getCurrentDate");
15
15
  const constants_1 = require("../constants");
16
- exports.default = (_a) => __awaiter(void 0, [_a], void 0, function* ({ url, headers, params, callback, }) {
16
+ exports.default = ({ url, headers, params, callback, }) => __awaiter(void 0, void 0, void 0, function* () {
17
17
  return yield axios_1.default.get(url, {
18
18
  params,
19
19
  headers: Object.assign({ 'Content-Type': 'application/json', 'X-Correlation-Id': (0, generateRelationId_1.default)(24), 'X-Transmission-Date-Time': (0, getCurrentDate_1.default)() }, headers),
@@ -13,7 +13,7 @@ const axios_1 = require("axios");
13
13
  const generateRelationId_1 = require("./generateRelationId");
14
14
  const getCurrentDate_1 = require("./getCurrentDate");
15
15
  const constants_1 = require("../constants");
16
- exports.default = (_a) => __awaiter(void 0, [_a], void 0, function* ({ url, headers, body, callback, }) {
16
+ exports.default = ({ url, headers, body, callback, }) => __awaiter(void 0, void 0, void 0, function* () {
17
17
  return yield axios_1.default.post(url, body, {
18
18
  headers: Object.assign({ 'Content-Type': 'application/json', 'X-Correlation-Id': (0, generateRelationId_1.default)(24), 'X-Transmission-Date-Time': (0, getCurrentDate_1.default)() }, headers),
19
19
  }).then((result) => __awaiter(void 0, void 0, void 0, function* () {
@@ -13,7 +13,7 @@ const axios_1 = require("axios");
13
13
  const constants_1 = require("../constants");
14
14
  const generateRelationId_1 = require("./generateRelationId");
15
15
  const getCurrentDate_1 = require("./getCurrentDate");
16
- exports.default = (_a) => __awaiter(void 0, [_a], void 0, function* ({ url, headers, body, callback, }) {
16
+ exports.default = ({ url, headers, body, callback, }) => __awaiter(void 0, void 0, void 0, function* () {
17
17
  return yield axios_1.default.put(url, body, {
18
18
  headers: Object.assign({ 'Content-Type': 'application/json', 'X-Correlation-Id': (0, generateRelationId_1.default)(24), 'X-Transmission-Date-Time': (0, getCurrentDate_1.default)() }, headers),
19
19
  }).then((result) => __awaiter(void 0, void 0, void 0, function* () {
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = default_1;
4
3
  const brokerage_1 = require("../constants/brokerage");
5
4
  function default_1(request) {
6
5
  try {
@@ -17,3 +16,4 @@ function default_1(request) {
17
16
  return null;
18
17
  }
19
18
  }
19
+ exports.default = default_1;
@@ -1,10 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sumN = void 0;
4
- exports.sum = sum;
5
- exports.minus = minus;
6
- exports.multiple = multiple;
7
- exports.divide = divide;
3
+ exports.sumN = exports.divide = exports.multiple = exports.minus = exports.sum = void 0;
8
4
  function sum(a, b) {
9
5
  try {
10
6
  if (a == null && b == null)
@@ -15,6 +11,7 @@ function sum(a, b) {
15
11
  return null;
16
12
  }
17
13
  }
14
+ exports.sum = sum;
18
15
  function minus(a, b) {
19
16
  try {
20
17
  if (a == null && b == null)
@@ -25,6 +22,7 @@ function minus(a, b) {
25
22
  return null;
26
23
  }
27
24
  }
25
+ exports.minus = minus;
28
26
  function multiple(a, b) {
29
27
  try {
30
28
  if (a == null && b == null)
@@ -35,6 +33,7 @@ function multiple(a, b) {
35
33
  return null;
36
34
  }
37
35
  }
36
+ exports.multiple = multiple;
38
37
  function divide(a, b) {
39
38
  try {
40
39
  if (a == null && b == null)
@@ -45,6 +44,7 @@ function divide(a, b) {
45
44
  return null;
46
45
  }
47
46
  }
47
+ exports.divide = divide;
48
48
  const sumN = (...numbers) => {
49
49
  let result = null;
50
50
  numbers.forEach(each => {
@@ -5,10 +5,10 @@ exports.default = (req, { isUserCodeMandatory = true } = {}) => {
5
5
  if (!userCode && isUserCodeMandatory)
6
6
  throw new Error('Usercode is not found');
7
7
  return {
8
- userCode: req.headers['x-user'] || req.headers['userCode'], //x-user -> isinya userCode
9
- username: req.headers['x-username'] || req.headers['username'], //x-username -> isinya auth.username
10
- userEmail: req.headers['x-useremail'] || req.headers['x-user-email'] || req.headers['userEmail'], //x-useremail -> isinya auth.username
11
- isAdmin: req.headers['x-admin'] || req.headers['isAdmin'], //x-admin // isi 1/undefined -> jika 1 berarti admin
8
+ userCode: req.headers['x-user'] || req.headers['userCode'],
9
+ username: req.headers['x-username'] || req.headers['username'],
10
+ userEmail: req.headers['x-useremail'] || req.headers['x-user-email'] || req.headers['userEmail'],
11
+ isAdmin: req.headers['x-admin'] || req.headers['isAdmin'],
12
12
  isPublic: req.headers['x-public'], //x-public isi 1/undefined -> jika 1 berarti akses public
13
13
  };
14
14
  };
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- function loop(list_1, callback_1) {
13
- return __awaiter(this, arguments, void 0, function* (list, callback, result = []) {
12
+ function loop(list, callback, result = []) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
14
  if (list && list.length > 0) {
15
15
  const [head, ...tail] = list;
16
16
  return loop(tail, callback, [yield callback(head), ...result]);
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- function loop(list_1, callback_1) {
13
- return __awaiter(this, arguments, void 0, function* (list, callback, result = []) {
12
+ function loop(list, callback, result = []) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
14
  if (list && list.length > 0) {
15
15
  const [head, ...tail] = list;
16
16
  return loop(tail, callback, [...result, yield callback(head)]);
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
1
3
  import IReadExcel from '../interface/read.excel.interface';
2
4
  declare function readExcel(file: Buffer, data: IReadExcel): Promise<any>;
3
5
  export default readExcel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@provis/provis-common-be-module",
3
- "version": "2.6.6",
3
+ "version": "2.6.8",
4
4
  "description": "This common module for Provis internal backend use lib",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {