@sasjs/cli 3.8.4 → 3.8.5

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.
@@ -158,7 +158,7 @@ var AddCommand = /** @class */ (function (_super) {
158
158
  })
159
159
  .catch(function (err) {
160
160
  var _a;
161
- (_a = process.logger) === null || _a === void 0 ? void 0 : _a.error('Error adding credentials: ', err);
161
+ (_a = process.logger) === null || _a === void 0 ? void 0 : _a.error('Error adding credentials: ', err.toString());
162
162
  return command_1.ReturnCode.InternalError;
163
163
  })];
164
164
  case 2: return [2 /*return*/, _b.sent()];
@@ -174,7 +174,7 @@ var getTokens = function (target, client, secret, httpsAgentOptions) { return __
174
174
  });
175
175
  return [4 /*yield*/, (0, auth_1.getNewAccessToken)(adapter, client, secret, target).catch(function (e) {
176
176
  var _a;
177
- (_a = process.logger) === null || _a === void 0 ? void 0 : _a.error("An error has occurred while validating your credentials: ", e, "\nPlease check your Client ID ".concat(target.serverType === types_1.ServerType.Sasjs ? '' : 'and Client Secret ', "and try again.\n"));
177
+ (_a = process.logger) === null || _a === void 0 ? void 0 : _a.error("An error has occurred while validating your credentials: ".concat(e, "\nPlease check your Client ID ").concat(target.serverType === types_1.ServerType.Sasjs ? '' : 'and Client Secret ', "and try again.\n"));
178
178
  throw e;
179
179
  })];
180
180
  case 1:
@@ -254,7 +254,7 @@ describe('AddCommand - cred', function () {
254
254
  case 1:
255
255
  returnCode = _a.sent();
256
256
  expect(returnCode).toEqual(command_1.ReturnCode.InternalError);
257
- expect(process.logger.error).toHaveBeenCalledWith('Error adding credentials: ', new Error('Test Error'));
257
+ expect(process.logger.error).toHaveBeenCalledWith('Error adding credentials: ', new Error('Test Error').toString());
258
258
  return [2 /*return*/];
259
259
  }
260
260
  });
@@ -124,14 +124,7 @@ function getNewAccessToken(sasjsInstance, clientId, clientSecret, target) {
124
124
  return [4 /*yield*/, getAuthCode(authUrl)];
125
125
  case 1:
126
126
  authCode = _b.sent();
127
- return [4 /*yield*/, sasjsInstance
128
- .getAccessToken(clientId, clientSecret, authCode)
129
- .then(function (res) {
130
- var access_token = res.access_token, refresh_token = res.refresh_token;
131
- if (access_token && refresh_token)
132
- return res;
133
- throw res;
134
- })];
127
+ return [4 /*yield*/, sasjsInstance.getAccessToken(clientId, clientSecret, authCode)];
135
128
  case 2:
136
129
  _a = _b.sent(), access_token = _a.access_token, refresh_token = _a.refresh_token;
137
130
  return [2 /*return*/, { access_token: access_token, refresh_token: refresh_token }];
package/package.json CHANGED
@@ -47,7 +47,7 @@
47
47
  "access": "public"
48
48
  },
49
49
  "dependencies": {
50
- "@sasjs/adapter": "3.7.8",
50
+ "@sasjs/adapter": "3.7.12",
51
51
  "@sasjs/core": "4.15.3",
52
52
  "@sasjs/lint": "1.11.2",
53
53
  "@sasjs/utils": "2.36.0",
@@ -94,5 +94,5 @@
94
94
  "typescript": "4.5.4",
95
95
  "util": "0.12.4"
96
96
  },
97
- "version": "3.8.4"
97
+ "version": "3.8.5"
98
98
  }