@vendit-dev/thirdparty-adapters 0.7.10 → 0.7.12
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,5 +1,5 @@
|
|
|
1
|
-
import { UserServiceGrpcCaller } from '@vendit-dev/utility-modules';
|
|
2
|
-
import { AmanoHttpResponse, DeletePreDiscountInfoInput, DeletePreDiscountInfoResponse, FeeCarSearchInput, GetFeeCarSearchResponse, GetPreDiscountListInfoResponse, InsertPreDiscountInfoInput, InsertPreDiscountInfoResponse, PreDiscountListInfoInput, UpdatePreDiscountInfoInput, UpdatePreDiscountInfoResponse } from '../types/amanoKorea';
|
|
1
|
+
import type { UserServiceGrpcCaller } from '@vendit-dev/utility-modules';
|
|
2
|
+
import type { AmanoHttpResponse, DeletePreDiscountInfoInput, DeletePreDiscountInfoResponse, FeeCarSearchInput, GetFeeCarSearchResponse, GetPreDiscountListInfoResponse, InsertPreDiscountInfoInput, InsertPreDiscountInfoResponse, PreDiscountListInfoInput, UpdatePreDiscountInfoInput, UpdatePreDiscountInfoResponse } from '../types/amanoKorea';
|
|
3
3
|
import MutexLock from '../utils/mutex';
|
|
4
4
|
type VenditAmanoKoreaAuthInfo = {
|
|
5
5
|
scope: string;
|
|
@@ -163,10 +163,7 @@ var AmanoKoreaAdapter = /** @class */ (function () {
|
|
|
163
163
|
return __generator(this, function (_b) {
|
|
164
164
|
switch (_b.label) {
|
|
165
165
|
case 0:
|
|
166
|
-
|
|
167
|
-
_b.label = 1;
|
|
168
|
-
case 1:
|
|
169
|
-
_b.trys.push([1, 4, , 5]);
|
|
166
|
+
_b.trys.push([0, 3, , 4]);
|
|
170
167
|
return [4 /*yield*/, (0, node_fetch_1.default)("".concat(this.API_HOST, ":").concat(this.API_PORT, "/interop/").concat(directory), {
|
|
171
168
|
method: 'POST',
|
|
172
169
|
headers: {
|
|
@@ -175,18 +172,17 @@ var AmanoKoreaAdapter = /** @class */ (function () {
|
|
|
175
172
|
},
|
|
176
173
|
body: JSON.stringify(__assign({}, resources)),
|
|
177
174
|
})];
|
|
178
|
-
case
|
|
175
|
+
case 1:
|
|
179
176
|
fetchResult = _b.sent();
|
|
180
|
-
console.log('fetchResult', fetchResult);
|
|
181
177
|
return [4 /*yield*/, (fetchResult === null || fetchResult === void 0 ? void 0 : fetchResult.json())];
|
|
182
|
-
case
|
|
178
|
+
case 2:
|
|
183
179
|
fetchResultJson = _b.sent();
|
|
184
180
|
return [2 /*return*/, fetchResultJson];
|
|
185
|
-
case
|
|
181
|
+
case 3:
|
|
186
182
|
err_2 = _b.sent();
|
|
187
183
|
console.error('err', err_2);
|
|
188
184
|
return [2 /*return*/, err_2];
|
|
189
|
-
case
|
|
185
|
+
case 4: return [2 /*return*/];
|
|
190
186
|
}
|
|
191
187
|
});
|
|
192
188
|
});
|
|
@@ -159,7 +159,7 @@ var formattedPaxCountText = function (roomInformation, genderDivision) {
|
|
|
159
159
|
exports.formattedPaxCountText = formattedPaxCountText;
|
|
160
160
|
function formatPhoneNumber(text) {
|
|
161
161
|
var onlyNumberText = text === null || text === void 0 ? void 0 : text.replace(/[^0-9]/g, '');
|
|
162
|
-
var safeNumberRegex = /^050{1}[0-9]{
|
|
162
|
+
var safeNumberRegex = /^050{1}[0-9]{9}$/;
|
|
163
163
|
if (safeNumberRegex.test(onlyNumberText || '')) {
|
|
164
164
|
return onlyNumberText;
|
|
165
165
|
}
|
|
@@ -185,29 +185,23 @@ var TlLincoln = /** @class */ (function () {
|
|
|
185
185
|
var _this = this;
|
|
186
186
|
return __generator(this, function (_a) {
|
|
187
187
|
refinedDatas = input.map(this.refineUpdateStockData.bind(this));
|
|
188
|
-
refinedDatas.map(function (refinedData) { return __awaiter(_this, void 0, void 0, function () {
|
|
189
|
-
var
|
|
190
|
-
return __generator(this, function (
|
|
191
|
-
(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
code: failureReason,
|
|
203
|
-
description: "".concat(errorDescription, ": ").concat(JSON.stringify(data)),
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
return [2 /*return*/, result === null || result === void 0 ? void 0 : result['S:Envelope']['S:Body']['ns2:executeResponse'].return.commonResponse.isSuccess];
|
|
188
|
+
refinedDatas.flat().map(function (refinedData) { return __awaiter(_this, void 0, void 0, function () {
|
|
189
|
+
var result, _a, errorDescription, failureReason;
|
|
190
|
+
return __generator(this, function (_b) {
|
|
191
|
+
switch (_b.label) {
|
|
192
|
+
case 0: return [4 /*yield*/, this.netStockAdjustmentService(refinedData)];
|
|
193
|
+
case 1:
|
|
194
|
+
result = _b.sent();
|
|
195
|
+
if (!result['S:Envelope']['S:Body']['ns2:executeResponse'].return.commonResponse.isSuccess) {
|
|
196
|
+
_a = result['S:Envelope']['S:Body']['ns2:executeResponse'].return.commonResponse, errorDescription = _a.errorDescription, failureReason = _a.failureReason;
|
|
197
|
+
throw new externalChannelManager_type_1.ExternalChannelManagerError({
|
|
198
|
+
message: "Failed to update RoomType stocks - ".concat(errorDescription, ": ").concat(failureReason),
|
|
199
|
+
code: failureReason,
|
|
200
|
+
description: "".concat(errorDescription, ": ").concat(JSON.stringify(refinedData)),
|
|
201
|
+
});
|
|
207
202
|
}
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
return [2 /*return*/];
|
|
203
|
+
return [2 /*return*/, result === null || result === void 0 ? void 0 : result['S:Envelope']['S:Body']['ns2:executeResponse'].return.commonResponse.isSuccess];
|
|
204
|
+
}
|
|
211
205
|
});
|
|
212
206
|
}); });
|
|
213
207
|
return [2 /*return*/, true];
|