@vendit-dev/thirdparty-adapters 0.7.22 → 0.7.24

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.
@@ -0,0 +1,17 @@
1
+ {
2
+ "editor.formatOnSave": true,
3
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
4
+ "editor.codeActionsOnSave": {
5
+ "source.fixAll": "explicit",
6
+ "source.organizeImports": "explicit"
7
+ },
8
+ "editor.tabSize": 2,
9
+ "editor.indentSize": "tabSize",
10
+ "editor.insertSpaces": true,
11
+ "editor.detectIndentation": false,
12
+ "editor.formatOnSaveMode": "modifications",
13
+ "prettier.singleQuote": true,
14
+ "prettier.trailingComma": "all",
15
+ "prettier.arrowParens": "avoid",
16
+ "prettier.useEditorConfig": true
17
+ }
@@ -1,5 +1,5 @@
1
1
  import type { ExternalReservation, ExternalReservationType, ReservationStatus } from './externalChannelManager.type';
2
- import { type BasicInformation as TBasicInformation, type DataClassificationType, type InfoTravelXML, type MealConditionType, type RoomInformation, type SpecificMealConditionType } from './tl-lincoln.types';
2
+ import { type DataClassificationType, type InfoTravelXML, type MealConditionType, type RoomInformation, type SpecificMealConditionType, type BasicInformation as TBasicInformation } from './tl-lincoln.types';
3
3
  interface CommonRequest {
4
4
  systemId: string;
5
5
  pmsUserId: string;
@@ -26,8 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.withAsyncBandwidth = exports.refineReservationData = exports.formattedPaxCountText = exports.formattedNameForMealCondition = exports.getExternalReservationTypeFromDataClassification = exports.getReservationStatusFromDataClassification = exports.xmlToJson = exports.jsonToXml = void 0;
27
27
  var fast_xml_parser_1 = require("fast-xml-parser");
28
28
  var moment_1 = __importDefault(require("moment"));
29
- var tl_lincoln_types_1 = require("./tl-lincoln.types");
30
29
  var tl_lincoln_ota_1 = require("../../types/tl-lincoln.ota");
30
+ var tl_lincoln_types_1 = require("./tl-lincoln.types");
31
31
  function jsonToXml(json) {
32
32
  var options = {
33
33
  ignoreAttributes: false,
@@ -179,7 +179,7 @@ var formattedPaxCountText = function (roomInformation, genderDivision) {
179
179
  };
180
180
  exports.formattedPaxCountText = formattedPaxCountText;
181
181
  function formatPhoneNumber(text) {
182
- var onlyNumberText = text === null || text === void 0 ? void 0 : text.replace(/[^0-9]/g, '');
182
+ var onlyNumberText = text === null || text === void 0 ? void 0 : text.replace(/[^0-9+]/g, '');
183
183
  var safeNumberRegex = /^0?50[0-9]{8,9}$/;
184
184
  // +로 시작하는 경우 처리
185
185
  if (text === null || text === void 0 ? void 0 : text.startsWith('+')) {
@@ -196,25 +196,22 @@ function formatPhoneNumber(text) {
196
196
  }
197
197
  return onlyNumberText;
198
198
  }
199
- return onlyNumberText ? "010".concat(onlyNumberText.slice(-8)) : '';
199
+ return onlyNumberText;
200
200
  }
201
201
  var makePaymentInfo = function (_a) {
202
- var datas = _a.datas, basicRateInformation = _a.basicRateInformation, basicInformation = _a.basicInformation, reservationType = _a.reservationType, OptionList = _a.OptionList;
202
+ var datas = _a.datas, basicInformation = _a.basicInformation, reservationType = _a.reservationType, OptionList = _a.OptionList;
203
203
  return datas.reduce(function (paymentInput, _a) {
204
- var _b, _c, _d;
204
+ var _b, _c, _d, _e;
205
205
  var RoomInfo = _a.RoomInformation, RoomRateInformation = _a.RoomRateInformation;
206
- var roomAmount = (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomRate) ||
207
- ((RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerMaleRate) || 0) *
208
- (RoomInfo.RoomPaxMaleCount || 0) +
209
- ((RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerFemaleRate) ||
210
- (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerMaleRate) ||
211
- 0) *
212
- (RoomInfo.RoomPaxFemaleCount || 0) ||
213
- (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomRate) ||
214
- basicRateInformation.TotalAccommodationCharge ||
215
- 0;
206
+ var roomAmount = (_b = RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomRate) !== null && _b !== void 0 ? _b : (((RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerMaleRate) || 0) *
207
+ (RoomInfo.RoomPaxMaleCount || 0) +
208
+ ((RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerFemaleRate) ||
209
+ (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerMaleRate) ||
210
+ 0) *
211
+ (RoomInfo.RoomPaxFemaleCount || 0) ||
212
+ 0);
216
213
  paymentInput.amount += roomAmount;
217
- (_b = paymentInput.segments) === null || _b === void 0 ? void 0 : _b.push({
214
+ (_c = paymentInput.segments) === null || _c === void 0 ? void 0 : _c.push({
218
215
  amount: roomAmount,
219
216
  servedAt: RoomRateInformation.RoomDate,
220
217
  referenceType: 'RESERVATION',
@@ -223,7 +220,7 @@ var makePaymentInfo = function (_a) {
223
220
  if (basicInformation.MealCondition !== 'Other' &&
224
221
  basicInformation.MealCondition !== 'WithoutMeal') {
225
222
  paymentInput.amount += (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomServiceFee) || 0;
226
- (_c = paymentInput.segments) === null || _c === void 0 ? void 0 : _c.push({
223
+ (_d = paymentInput.segments) === null || _d === void 0 ? void 0 : _d.push({
227
224
  amount: (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomServiceFee) || 0,
228
225
  servedAt: RoomRateInformation.RoomDate,
229
226
  referenceType: 'SERVICE',
@@ -231,7 +228,7 @@ var makePaymentInfo = function (_a) {
231
228
  });
232
229
  }
233
230
  if ((OptionList === null || OptionList === void 0 ? void 0 : OptionList.length) > 0) {
234
- (_d = paymentInput.segments) === null || _d === void 0 ? void 0 : _d.push.apply(_d, OptionList.map(function (option) { return ({
231
+ (_e = paymentInput.segments) === null || _e === void 0 ? void 0 : _e.push.apply(_e, OptionList.map(function (option) { return ({
235
232
  amount: 0,
236
233
  servedAt: option.OptionDate,
237
234
  referenceType: 'SERVICE',
@@ -330,7 +327,6 @@ var refineReservationData = function (infoTravelXML) {
330
327
  var DepositList = (BasicRate === null || BasicRate === void 0 ? void 0 : BasicRate.DepositList) && (0, tl_lincoln_types_1.makeArray)(BasicRate.DepositList);
331
328
  var paymentInfo = makePaymentInfo({
332
329
  datas: datas,
333
- basicRateInformation: BasicRateInformation,
334
330
  basicInformation: BasicInformation,
335
331
  reservationType: reservationType,
336
332
  OptionList: OptionList,
@@ -60,9 +60,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
60
60
  };
61
61
  Object.defineProperty(exports, "__esModule", { value: true });
62
62
  exports.TlLincoln = void 0;
63
+ var moment_1 = __importDefault(require("moment"));
63
64
  /* eslint-disable no-await-in-loop */
64
65
  var node_fetch_1 = __importDefault(require("node-fetch"));
65
- var moment_1 = __importDefault(require("moment"));
66
66
  var externalChannelManager_type_1 = require("./externalChannelManager.type");
67
67
  var tl_lincoln_helper_1 = require("./tl-lincoln.helper");
68
68
  var tl_lincoln_types_1 = require("./tl-lincoln.types");
package/package.json CHANGED
@@ -1,52 +1,50 @@
1
1
  {
2
- "name": "@vendit-dev/thirdparty-adapters",
3
- "version": "0.7.22",
4
- "description": "Third party adapters between v-cloud and other PMS/CMS providers.",
5
- "main": "lib/index.js",
6
- "scripts": {
7
- "build": "tsc",
8
- "dev": "node ./test/tl-lincoln.test.js",
9
- "npm-login": "npm login",
10
- "publish": "npm publish"
11
- },
12
- "keywords": [
13
- "vendit"
14
- ],
15
- "author": "Vendit <dev@vendit.co.kr> (https://vendit.co.kr)",
16
- "license": "MIT",
17
- "devDependencies": {
18
- "@babel/cli": "^7.10.5",
19
- "@babel/core": "^7.10.5",
20
- "@babel/node": "^7.10.5",
21
- "@babel/plugin-proposal-class-properties": "^7.10.4",
22
- "@babel/plugin-proposal-optional-chaining": "^7.10.4",
23
- "@babel/preset-env": "^7.10.4",
24
- "@babel/preset-flow": "^7.10.4",
25
- "@types/ioredis": "^5.0.0",
26
- "@types/node": "^20.4.5",
27
- "@types/node-fetch": "^2.6.1",
28
- "@types/npm": "^7.19.1",
29
- "@types/sequelize": "^4.28.15",
30
- "@types/tedious": "^4.0.9",
31
- "@types/validator": "^13.7.17",
32
- "@typescript-eslint/eslint-plugin": "^3.6.1",
33
- "@typescript-eslint/parser": "^3.6.1",
34
- "@vendit-dev/utility-modules": "^0.20.1",
35
- "babel-eslint": "^10.1.0",
36
- "babel-plugin-module-resolver": "^4.0.0",
37
- "cross-env": "^7.0.2",
38
- "eslint": "^7.4.0",
39
- "eslint-config-airbnb-base": "^13.1.0",
40
- "eslint-plugin-import": "^2.16.0",
41
- "typescript": "4.9.3"
42
- },
43
- "dependencies": {
44
- "fast-xml-parser": "^4.4.0",
45
- "moment": "^2.29.2",
46
- "node-fetch": "2",
47
- "npm": "6",
48
- "sequelize": "^6.32.1",
49
- "tedious": "6.2.1",
50
- "uuid": "^8.3.2"
51
- }
2
+ "name": "@vendit-dev/thirdparty-adapters",
3
+ "version": "0.7.24",
4
+ "description": "Third party adapters between v-cloud and other PMS/CMS providers.",
5
+ "main": "lib/index.js",
6
+ "scripts": {
7
+ "build": "tsc",
8
+ "dev": "node ./test/tl-lincoln.test.js",
9
+ "npm-login": "npm login",
10
+ "publish": "npm publish"
11
+ },
12
+ "keywords": ["vendit"],
13
+ "author": "Vendit <dev@vendit.co.kr> (https://vendit.co.kr)",
14
+ "license": "MIT",
15
+ "devDependencies": {
16
+ "@babel/cli": "^7.10.5",
17
+ "@babel/core": "^7.10.5",
18
+ "@babel/node": "^7.10.5",
19
+ "@babel/plugin-proposal-class-properties": "^7.10.4",
20
+ "@babel/plugin-proposal-optional-chaining": "^7.10.4",
21
+ "@babel/preset-env": "^7.10.4",
22
+ "@babel/preset-flow": "^7.10.4",
23
+ "@types/ioredis": "^5.0.0",
24
+ "@types/node": "^20.4.5",
25
+ "@types/node-fetch": "^2.6.1",
26
+ "@types/npm": "^7.19.1",
27
+ "@types/sequelize": "^4.28.15",
28
+ "@types/tedious": "^4.0.9",
29
+ "@types/validator": "^13.7.17",
30
+ "@typescript-eslint/eslint-plugin": "^3.6.1",
31
+ "@typescript-eslint/parser": "^3.6.1",
32
+ "@vendit-dev/utility-modules": "^0.20.1",
33
+ "babel-eslint": "^10.1.0",
34
+ "babel-plugin-module-resolver": "^4.0.0",
35
+ "cross-env": "^7.0.2",
36
+ "eslint": "^7.4.0",
37
+ "eslint-config-airbnb-base": "^13.1.0",
38
+ "eslint-plugin-import": "^2.16.0",
39
+ "typescript": "4.9.3"
40
+ },
41
+ "dependencies": {
42
+ "fast-xml-parser": "^4.4.0",
43
+ "moment": "^2.29.2",
44
+ "node-fetch": "2",
45
+ "npm": "6",
46
+ "sequelize": "^6.32.1",
47
+ "tedious": "6.2.1",
48
+ "uuid": "^8.3.2"
49
+ }
52
50
  }