@vendit-dev/thirdparty-adapters 0.4.0-beta.5 → 0.4.0-beta.7

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.
@@ -109,6 +109,7 @@ var AmanoKoreaAdapter = /** @class */ (function () {
109
109
  _b.trys.push([4, 9, 10, 12]);
110
110
  if (existingAuth) {
111
111
  parsedCredential_1 = this.parseJSONSafe(existingAuth);
112
+ console.log('🚀 ~ file: amanoKorea.ts:124 ~ AmanoKoreaAdapter ~ parsedCredential:', parsedCredential_1);
112
113
  if (parsedCredential_1 === null || parsedCredential_1 === void 0 ? void 0 : parsedCredential_1.authorization) {
113
114
  this.setAuthorization(parsedCredential_1.authorization);
114
115
  this.API_HOST = parsedCredential_1.apiHost;
@@ -128,6 +129,7 @@ var AmanoKoreaAdapter = /** @class */ (function () {
128
129
  return [2 /*return*/, false];
129
130
  case 7:
130
131
  parsedCredential = this.parseJSONSafe(newAuth.credential);
132
+ console.log('🚀 ~ file: amanoKorea.ts:151 ~ AmanoKoreaAdapter ~ parsedCredential:', parsedCredential);
131
133
  if (parsedCredential === null || parsedCredential === void 0 ? void 0 : parsedCredential.authorization) {
132
134
  this.setAuthorization(parsedCredential.authorization);
133
135
  this.API_HOST = parsedCredential.apiHost;
@@ -154,7 +156,7 @@ var AmanoKoreaAdapter = /** @class */ (function () {
154
156
  };
155
157
  this.setAuthorization = function (_a) {
156
158
  var authorization = _a.authorization;
157
- _this.authorization = "Basic " + authorization;
159
+ _this.authorization = authorization;
158
160
  };
159
161
  this.callAPI = function (_a) {
160
162
  var directory = _a.directory, resources = _a.resources;
@@ -163,7 +165,10 @@ var AmanoKoreaAdapter = /** @class */ (function () {
163
165
  return __generator(this, function (_b) {
164
166
  switch (_b.label) {
165
167
  case 0:
166
- _b.trys.push([0, 3, , 4]);
168
+ console.log('callAPI', this.authorization);
169
+ _b.label = 1;
170
+ case 1:
171
+ _b.trys.push([1, 4, , 5]);
167
172
  return [4 /*yield*/, node_fetch_1.default(this.API_HOST + ":" + this.API_PORT + "/interop/" + directory, {
168
173
  method: 'POST',
169
174
  headers: {
@@ -172,19 +177,19 @@ var AmanoKoreaAdapter = /** @class */ (function () {
172
177
  },
173
178
  body: JSON.stringify(__assign({}, resources)),
174
179
  })];
175
- case 1:
180
+ case 2:
176
181
  fetchResult = _b.sent();
177
182
  console.log('fetchResult', fetchResult);
178
183
  return [4 /*yield*/, (fetchResult === null || fetchResult === void 0 ? void 0 : fetchResult.json())];
179
- case 2:
184
+ case 3:
180
185
  fetchResultJson = _b.sent();
181
186
  data = fetchResultJson.data;
182
187
  return [2 /*return*/, data];
183
- case 3:
188
+ case 4:
184
189
  err_2 = _b.sent();
185
190
  console.error('err', err_2);
186
191
  return [2 /*return*/, err_2];
187
- case 4: return [2 /*return*/];
192
+ case 5: return [2 /*return*/];
188
193
  }
189
194
  });
190
195
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendit-dev/thirdparty-adapters",
3
- "version": "0.4.0-beta.5",
3
+ "version": "0.4.0-beta.7",
4
4
  "description": "Third party adapters between v-cloud and other PMS/CMS providers.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {