@vendit-dev/thirdparty-adapters 0.7.24 → 0.7.25
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.
- package/lib/adapters/amanoKorea.js +13 -21
- package/package.json +1 -1
|
@@ -50,6 +50,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
50
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
51
|
};
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
var node_https_1 = require("node:https");
|
|
53
54
|
var node_fetch_1 = __importDefault(require("node-fetch"));
|
|
54
55
|
var mutex_1 = __importDefault(require("../utils/mutex"));
|
|
55
56
|
var AmanoKoreaAdapter = /** @class */ (function () {
|
|
@@ -159,11 +160,16 @@ var AmanoKoreaAdapter = /** @class */ (function () {
|
|
|
159
160
|
this.callAPI = function (_a) {
|
|
160
161
|
var directory = _a.directory, resources = _a.resources;
|
|
161
162
|
return __awaiter(_this, void 0, void 0, function () {
|
|
162
|
-
var fetchResult, fetchResultJson, err_2;
|
|
163
|
+
var agent, fetchResult, fetchResultJson, err_2;
|
|
163
164
|
return __generator(this, function (_b) {
|
|
164
165
|
switch (_b.label) {
|
|
165
166
|
case 0:
|
|
166
|
-
|
|
167
|
+
agent = new node_https_1.Agent({
|
|
168
|
+
rejectUnauthorized: false,
|
|
169
|
+
});
|
|
170
|
+
_b.label = 1;
|
|
171
|
+
case 1:
|
|
172
|
+
_b.trys.push([1, 4, , 5]);
|
|
167
173
|
return [4 /*yield*/, (0, node_fetch_1.default)("".concat(this.API_HOST, ":").concat(this.API_PORT, "/interop/").concat(directory), {
|
|
168
174
|
method: 'POST',
|
|
169
175
|
headers: {
|
|
@@ -171,37 +177,23 @@ var AmanoKoreaAdapter = /** @class */ (function () {
|
|
|
171
177
|
Authorization: this.authorization,
|
|
172
178
|
},
|
|
173
179
|
body: JSON.stringify(__assign({}, resources)),
|
|
180
|
+
agent: agent,
|
|
174
181
|
})];
|
|
175
|
-
case
|
|
182
|
+
case 2:
|
|
176
183
|
fetchResult = _b.sent();
|
|
177
184
|
return [4 /*yield*/, (fetchResult === null || fetchResult === void 0 ? void 0 : fetchResult.json())];
|
|
178
|
-
case
|
|
185
|
+
case 3:
|
|
179
186
|
fetchResultJson = _b.sent();
|
|
180
187
|
return [2 /*return*/, fetchResultJson];
|
|
181
|
-
case
|
|
188
|
+
case 4:
|
|
182
189
|
err_2 = _b.sent();
|
|
183
190
|
console.error('err', err_2);
|
|
184
191
|
return [2 /*return*/, err_2];
|
|
185
|
-
case
|
|
192
|
+
case 5: return [2 /*return*/];
|
|
186
193
|
}
|
|
187
194
|
});
|
|
188
195
|
});
|
|
189
196
|
};
|
|
190
|
-
// syncTimeToMCS = async (): Promise<string> => {
|
|
191
|
-
// const fetchRes = await fetch(
|
|
192
|
-
// `${'http://deploy.amanopark.co.kr:9848/getTime'}`,
|
|
193
|
-
// {
|
|
194
|
-
// method: 'POST',
|
|
195
|
-
// headers: {
|
|
196
|
-
// 'Content-Type': 'application/json',
|
|
197
|
-
// Authorization: this.authorization,
|
|
198
|
-
// },
|
|
199
|
-
// body: JSON.stringify({}),
|
|
200
|
-
// },
|
|
201
|
-
// );
|
|
202
|
-
// const fetchResJson = await fetchRes.json();
|
|
203
|
-
// return fetchResJson;
|
|
204
|
-
// };
|
|
205
197
|
// 방문차량 등록 내역 조회
|
|
206
198
|
this.getPreDiscountListInfo = function (resources) { return __awaiter(_this, void 0, void 0, function () {
|
|
207
199
|
var _a, lotAreaNo, discCodeNo;
|