@pallasoft/ps-mail 1.4.0 → 1.4.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.
@@ -96,22 +96,21 @@ var GraphRequestService = /** @class */ (function () {
96
96
  return [4 /*yield*/, this._attempt(credentials, request, url, body)];
97
97
  case 2:
98
98
  outcome = _b.sent();
99
- if (outcome instanceof Response && outcome.ok)
99
+ if (!graph_mail_error_service_1.GraphMailErrorService.isGraphMailError(outcome) && outcome.ok)
100
100
  return [2 /*return*/, outcome];
101
- if (outcome instanceof Response &&
101
+ if (!graph_mail_error_service_1.GraphMailErrorService.isGraphMailError(outcome) &&
102
102
  outcome.status === Attributes.Common.Response.ErrorCodes.Unauthorized &&
103
103
  !refreshed) {
104
104
  refreshed = true;
105
105
  graph_token_service_1.GraphTokenService.clear(credentials);
106
106
  return [3 /*break*/, 1];
107
107
  }
108
- if (!(outcome instanceof Response)) return [3 /*break*/, 4];
109
- return [4 /*yield*/, graph_mail_error_service_1.GraphMailErrorService.fromResponse(outcome)];
110
- case 3:
111
- _a = _b.sent();
108
+ if (!graph_mail_error_service_1.GraphMailErrorService.isGraphMailError(outcome)) return [3 /*break*/, 3];
109
+ _a = outcome;
112
110
  return [3 /*break*/, 5];
111
+ case 3: return [4 /*yield*/, graph_mail_error_service_1.GraphMailErrorService.fromResponse(outcome)];
113
112
  case 4:
114
- _a = outcome;
113
+ _a = _b.sent();
115
114
  _b.label = 5;
116
115
  case 5:
117
116
  error = _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pallasoft/ps-mail",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",