t1c-sdk-js
Advanced tools
Comparing version 3.7.1 to 3.7.2
@@ -85,3 +85,3 @@ var __extends = (this && this.__extends) || (function () { | ||
.then(function (response) { | ||
if (response.data.signature && ConnectorKeyUtil.getPubKey() != undefined) { | ||
if (response.data && response.data.signature && ConnectorKeyUtil.getPubKey() != undefined) { | ||
var verification = ConnectorKeyUtil.verifySignature(JSON.stringify(response.data.data), response.data.signature); | ||
@@ -104,3 +104,3 @@ if (verification) { | ||
.catch(function (error) { | ||
var _a, _b, _c, _d, _e; | ||
var _a, _b, _c, _d, _e, _f; | ||
if (!error.code && !error.response) { | ||
@@ -117,4 +117,9 @@ var thrownError = new T1CLibException("112999", "Internal error"); | ||
} | ||
callback(new T1CLibException((_b = error.response) === null || _b === void 0 ? void 0 : _b.data.code, (_c = error.response) === null || _c === void 0 ? void 0 : _c.data.description), null); | ||
return reject(new T1CLibException((_d = error.response) === null || _d === void 0 ? void 0 : _d.data.code, (_e = error.response) === null || _e === void 0 ? void 0 : _e.data.description)); | ||
if (((_b = error.response) === null || _b === void 0 ? void 0 : _b.status) === 404) { | ||
var thrownError = new T1CLibException("112999", "Functionality not found"); | ||
callback(thrownError, null); | ||
return reject(thrownError); | ||
} | ||
callback(new T1CLibException((_c = error.response) === null || _c === void 0 ? void 0 : _c.data.code, (_d = error.response) === null || _d === void 0 ? void 0 : _d.data.description), null); | ||
return reject(new T1CLibException((_e = error.response) === null || _e === void 0 ? void 0 : _e.data.code, (_f = error.response) === null || _f === void 0 ? void 0 : _f.data.description)); | ||
} | ||
@@ -154,3 +159,13 @@ }); | ||
.catch(function (error) { | ||
var _a, _b, _c, _d; | ||
var _a, _b, _c, _d, _e, _f; | ||
if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 401) { | ||
var thrownError = new T1CLibException("112999", "Unauthorized"); | ||
callback(thrownError, null); | ||
return reject(thrownError); | ||
} | ||
if (((_b = error.response) === null || _b === void 0 ? void 0 : _b.status) === 404) { | ||
var thrownError = new T1CLibException("112999", "Functionality not found"); | ||
callback(thrownError, null); | ||
return reject(thrownError); | ||
} | ||
if (!error.code && !error.response) { | ||
@@ -162,4 +177,4 @@ var thrownError = new T1CLibException("112999", "Internal error"); | ||
else { | ||
callback(new T1CLibException((_a = error.response) === null || _a === void 0 ? void 0 : _a.data.code, (_b = error.response) === null || _b === void 0 ? void 0 : _b.data.description), null); | ||
return reject(new T1CLibException((_c = error.response) === null || _c === void 0 ? void 0 : _c.data.code, (_d = error.response) === null || _d === void 0 ? void 0 : _d.data.description)); | ||
callback(new T1CLibException((_c = error.response) === null || _c === void 0 ? void 0 : _c.data.code, (_d = error.response) === null || _d === void 0 ? void 0 : _d.data.description), null); | ||
return reject(new T1CLibException((_e = error.response) === null || _e === void 0 ? void 0 : _e.data.code, (_f = error.response) === null || _f === void 0 ? void 0 : _f.data.description)); | ||
} | ||
@@ -166,0 +181,0 @@ }); |
@@ -87,3 +87,3 @@ "use strict"; | ||
.then(function (response) { | ||
if (response.data.signature && __1.ConnectorKeyUtil.getPubKey() != undefined) { | ||
if (response.data && response.data.signature && __1.ConnectorKeyUtil.getPubKey() != undefined) { | ||
var verification = __1.ConnectorKeyUtil.verifySignature(JSON.stringify(response.data.data), response.data.signature); | ||
@@ -106,3 +106,3 @@ if (verification) { | ||
.catch(function (error) { | ||
var _a, _b, _c, _d, _e; | ||
var _a, _b, _c, _d, _e, _f; | ||
if (!error.code && !error.response) { | ||
@@ -119,4 +119,9 @@ var thrownError = new CoreExceptions_1.T1CLibException("112999", "Internal error"); | ||
} | ||
callback(new CoreExceptions_1.T1CLibException((_b = error.response) === null || _b === void 0 ? void 0 : _b.data.code, (_c = error.response) === null || _c === void 0 ? void 0 : _c.data.description), null); | ||
return reject(new CoreExceptions_1.T1CLibException((_d = error.response) === null || _d === void 0 ? void 0 : _d.data.code, (_e = error.response) === null || _e === void 0 ? void 0 : _e.data.description)); | ||
if (((_b = error.response) === null || _b === void 0 ? void 0 : _b.status) === 404) { | ||
var thrownError = new CoreExceptions_1.T1CLibException("112999", "Functionality not found"); | ||
callback(thrownError, null); | ||
return reject(thrownError); | ||
} | ||
callback(new CoreExceptions_1.T1CLibException((_c = error.response) === null || _c === void 0 ? void 0 : _c.data.code, (_d = error.response) === null || _d === void 0 ? void 0 : _d.data.description), null); | ||
return reject(new CoreExceptions_1.T1CLibException((_e = error.response) === null || _e === void 0 ? void 0 : _e.data.code, (_f = error.response) === null || _f === void 0 ? void 0 : _f.data.description)); | ||
} | ||
@@ -156,3 +161,13 @@ }); | ||
.catch(function (error) { | ||
var _a, _b, _c, _d; | ||
var _a, _b, _c, _d, _e, _f; | ||
if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 401) { | ||
var thrownError = new CoreExceptions_1.T1CLibException("112999", "Unauthorized"); | ||
callback(thrownError, null); | ||
return reject(thrownError); | ||
} | ||
if (((_b = error.response) === null || _b === void 0 ? void 0 : _b.status) === 404) { | ||
var thrownError = new CoreExceptions_1.T1CLibException("112999", "Functionality not found"); | ||
callback(thrownError, null); | ||
return reject(thrownError); | ||
} | ||
if (!error.code && !error.response) { | ||
@@ -164,4 +179,4 @@ var thrownError = new CoreExceptions_1.T1CLibException("112999", "Internal error"); | ||
else { | ||
callback(new CoreExceptions_1.T1CLibException((_a = error.response) === null || _a === void 0 ? void 0 : _a.data.code, (_b = error.response) === null || _b === void 0 ? void 0 : _b.data.description), null); | ||
return reject(new CoreExceptions_1.T1CLibException((_c = error.response) === null || _c === void 0 ? void 0 : _c.data.code, (_d = error.response) === null || _d === void 0 ? void 0 : _d.data.description)); | ||
callback(new CoreExceptions_1.T1CLibException((_c = error.response) === null || _c === void 0 ? void 0 : _c.data.code, (_d = error.response) === null || _d === void 0 ? void 0 : _d.data.description), null); | ||
return reject(new CoreExceptions_1.T1CLibException((_e = error.response) === null || _e === void 0 ? void 0 : _e.data.code, (_f = error.response) === null || _f === void 0 ? void 0 : _f.data.description)); | ||
} | ||
@@ -168,0 +183,0 @@ }); |
{ | ||
"name": "t1c-sdk-js", | ||
"version": "3.7.1", | ||
"version": "3.7.2", | ||
"description": "Trust1Connector JavaScript SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/T1CSdk.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4713241
22042