@vendit-dev/thirdparty-adapters 0.7.32 → 0.7.33-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.
|
@@ -26,6 +26,7 @@ export type ReservationStatus = 'CANCELLED' | 'AWAIT' | 'RESERVED' | 'ROOM_ASSIG
|
|
|
26
26
|
export type ExternalReservationType = 'CREATED' | 'UPDATED' | 'CANCELLED';
|
|
27
27
|
export interface ExternalReservation {
|
|
28
28
|
type: ExternalReservationType;
|
|
29
|
+
outputId: string;
|
|
29
30
|
externalId: string;
|
|
30
31
|
externalRevision: string;
|
|
31
32
|
guestOrGroupInfo: {
|
|
@@ -16,7 +16,7 @@ export declare function getReservationStatusFromDataClassification(dataClassific
|
|
|
16
16
|
export declare function getExternalReservationTypeFromDataClassification(dataClassification: DataClassificationType): ExternalReservationType;
|
|
17
17
|
export declare const formattedNameForMealCondition: (mealCondition: MealConditionType, specificMealCondition?: SpecificMealConditionType) => string;
|
|
18
18
|
export declare const formattedPaxCountText: (roomInformation: RoomInformation | TBasicInformation, genderDivision?: boolean) => string;
|
|
19
|
-
export declare const refineReservationData: (infoTravelXML: InfoTravelXML) => ExternalReservation
|
|
19
|
+
export declare const refineReservationData: (infoTravelXML: InfoTravelXML) => Omit<ExternalReservation, 'outputId'>;
|
|
20
20
|
export declare const withAsyncBandwidth: <T = unknown>(array: T[], asyncMapper: (arg0: T, index: number) => void, { bandwidth }?: {
|
|
21
21
|
bandwidth?: number | undefined;
|
|
22
22
|
}) => Promise<void>[];
|
|
@@ -80,17 +80,13 @@ var TlLincoln = /** @class */ (function () {
|
|
|
80
80
|
TlLincoln.prototype.getReservations = function (input, options) {
|
|
81
81
|
var _a;
|
|
82
82
|
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
-
var
|
|
83
|
+
var result, reservations, _b, isSuccess, errorDescription, failureReason, _c, bookingInfoList, configurationSettings, refinedArrayReservationList;
|
|
84
84
|
return __generator(this, function (_d) {
|
|
85
85
|
switch (_d.label) {
|
|
86
86
|
case 0:
|
|
87
|
-
continueFetching = true;
|
|
88
87
|
result = __spreadArray([], ((_a = options === null || options === void 0 ? void 0 : options.mergedReservations) !== null && _a !== void 0 ? _a : []), true);
|
|
89
|
-
_d.label = 1;
|
|
90
|
-
case 1:
|
|
91
|
-
if (!continueFetching) return [3 /*break*/, 5];
|
|
92
88
|
return [4 /*yield*/, this.bookingInfoOutputService(input)];
|
|
93
|
-
case
|
|
89
|
+
case 1:
|
|
94
90
|
reservations = _d.sent();
|
|
95
91
|
_b = reservations['S:Envelope']['S:Body']['ns2:executeResponse'].return
|
|
96
92
|
.commonResponse, isSuccess = _b.isSuccess, errorDescription = _b.errorDescription, failureReason = _b.failureReason;
|
|
@@ -110,23 +106,21 @@ var TlLincoln = /** @class */ (function () {
|
|
|
110
106
|
description: 'outputId is not found',
|
|
111
107
|
});
|
|
112
108
|
}
|
|
113
|
-
if (!(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
if (!(configurationSettings === null || configurationSettings === void 0 ? void 0 : configurationSettings.outputId)) {
|
|
110
|
+
throw new externalChannelManager_type_1.ExternalChannelManagerError({
|
|
111
|
+
message: 'Failed to load Reservations - outputId is not found',
|
|
112
|
+
code: 'outputId is not found',
|
|
113
|
+
description: 'outputId is not found',
|
|
114
|
+
});
|
|
115
|
+
}
|
|
119
116
|
result = refinedArrayReservationList.reduce(function (acc, reservation) {
|
|
120
117
|
if (reservation === null || reservation === void 0 ? void 0 : reservation.infoTravelXML) {
|
|
121
118
|
var refinedData = (0, tl_lincoln_helper_1.refineReservationData)((0, tl_lincoln_helper_1.xmlToJson)(reservation.infoTravelXML));
|
|
122
|
-
acc.push(refinedData);
|
|
119
|
+
acc.push(__assign(__assign({}, refinedData), { outputId: configurationSettings.outputId }));
|
|
123
120
|
}
|
|
124
121
|
return acc;
|
|
125
122
|
}, result);
|
|
126
|
-
|
|
127
|
-
continueFetching = refinedArrayReservationList.length === 100;
|
|
128
|
-
return [3 /*break*/, 1];
|
|
129
|
-
case 5: return [2 /*return*/, result];
|
|
123
|
+
return [2 /*return*/, result];
|
|
130
124
|
}
|
|
131
125
|
});
|
|
132
126
|
});
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
2
|
+
"name": "@vendit-dev/thirdparty-adapters",
|
|
3
|
+
"version": "0.7.33-beta.1",
|
|
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
|
+
}
|
|
52
52
|
}
|