fintecture-client
Advanced tools
Comparing version 1.0.15 to 1.0.16
@@ -40,4 +40,4 @@ import { AIS } from './src/Ais'; | ||
public async getAccessToken(authCode?: string): Promise<object> { | ||
return this.authentication.accessToken(authCode); | ||
public async getAccessToken(authCode?: string, scopes?: string): Promise<object> { | ||
return this.authentication.accessToken(authCode, scopes); | ||
} | ||
@@ -44,0 +44,0 @@ |
@@ -20,3 +20,3 @@ import { IPisConnect, IAisConnect } from './src/interfaces/connect/ConnectInterface'; | ||
constructor(config: object); | ||
getAccessToken(authCode?: string): Promise<object>; | ||
getAccessToken(authCode?: string, scopes?: string): Promise<object>; | ||
refreshAccessToken(refreshToken: string): Promise<object>; | ||
@@ -23,0 +23,0 @@ getProviders(search?: object): Promise<object>; |
@@ -37,5 +37,5 @@ "use strict"; | ||
} | ||
getAccessToken(authCode) { | ||
getAccessToken(authCode, scopes) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.authentication.accessToken(authCode); | ||
return this.authentication.accessToken(authCode, scopes); | ||
}); | ||
@@ -42,0 +42,0 @@ } |
{ | ||
"name": "fintecture-client", | ||
"version": "1.0.15", | ||
"version": "1.0.16", | ||
"description": "Fintecture Open Banking API Gateway enabling secure bank connections and payments", | ||
@@ -5,0 +5,0 @@ "main": "lib/fintecture-client.js", |
@@ -26,3 +26,3 @@ import { IFintectureConfig } from './interfaces/ConfigInterface'; | ||
*/ | ||
accessToken(authCode?: string): Promise<object>; | ||
accessToken(authCode?: string, scopes?: string): Promise<object>; | ||
/** | ||
@@ -29,0 +29,0 @@ * The accesstoken API is used to exchange the code received |
@@ -50,5 +50,5 @@ "use strict"; | ||
*/ | ||
accessToken(authCode) { | ||
accessToken(authCode, scopes) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const data = this._getAccessTokenData(authCode); | ||
const data = this._getAccessTokenData(authCode, scopes); | ||
const response = yield this.axiosInstance.post(Endpoints_1.Endpoints.OAUTHACCESSTOKEN, data); | ||
@@ -80,8 +80,4 @@ return response.data; | ||
*/ | ||
_getAccessTokenData(authCode) { | ||
let data = { | ||
scope: 'PIS', | ||
app_id: this.appId, | ||
grant_type: 'client_credentials', | ||
}; | ||
_getAccessTokenData(authCode, scopes) { | ||
let data = {}; | ||
if (authCode) { | ||
@@ -94,2 +90,12 @@ data = { | ||
} | ||
else { | ||
data = { | ||
scope: 'PIS', | ||
app_id: this.appId, | ||
grant_type: 'client_credentials', | ||
}; | ||
} | ||
if (scopes) { | ||
data["scope"] = scopes; | ||
} | ||
return qs_1.default.stringify(data); | ||
@@ -96,0 +102,0 @@ } |
@@ -47,4 +47,4 @@ "use strict"; | ||
origin_uri: connectConfig.origin_uri, | ||
error_redirect_uri: connectConfig.error_redirect_uri ? connectConfig.error_redirect_uri : null, | ||
state: connectConfig.state ? connectConfig.state : null, | ||
error_redirect_uri: connectConfig.error_redirect_uri, | ||
state: connectConfig.state, | ||
psu_type: connectConfig.psu_type, | ||
@@ -89,4 +89,4 @@ country: connectConfig.country, | ||
origin_uri: connectConfig.origin_uri, | ||
error_redirect_uri: connectConfig.error_redirect_uri ? connectConfig.error_redirect_uri : null, | ||
state: connectConfig.state ? connectConfig.state : null, | ||
error_redirect_uri: connectConfig.error_redirect_uri, | ||
state: connectConfig.state, | ||
payload: sessionPayload, | ||
@@ -93,0 +93,0 @@ psu_type: connectConfig.psu_type, |
@@ -20,4 +20,4 @@ import { ISessionPayload } from '../pis/PisInterface'; | ||
customer_ip?: string; | ||
redirect_uri: string; | ||
origin_uri: string; | ||
redirect_uri?: string; | ||
origin_uri?: string; | ||
error_redirect_uri?: string; | ||
@@ -28,3 +28,3 @@ state?: string; | ||
redirect_uri: string; | ||
origin_uri: string; | ||
origin_uri?: string; | ||
error_redirect_uri?: string; | ||
@@ -38,4 +38,4 @@ state?: string; | ||
signature: string; | ||
redirect_uri: string; | ||
origin_uri: string; | ||
redirect_uri?: string; | ||
origin_uri?: string; | ||
error_redirect_uri?: string; | ||
@@ -57,3 +57,3 @@ state: string; | ||
redirect_uri: string; | ||
origin_uri: string; | ||
origin_uri?: string; | ||
error_redirect_uri?: string; | ||
@@ -60,0 +60,0 @@ state?: string; |
"use strict"; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const uuid_1 = require("uuid"); | ||
const crypto = __importStar(require("crypto")); | ||
const crypto_1 = require("crypto"); | ||
function generateUUID() { | ||
@@ -56,3 +49,3 @@ return uuid_1.v4().replace(/-/g, ''); | ||
try { | ||
const signature = crypto.createSign('RSA-SHA256'); | ||
const signature = crypto_1.createSign('RSA-SHA256'); | ||
signature.update(payload); | ||
@@ -70,8 +63,5 @@ signature.end(); | ||
function hashBase64(plainText) { | ||
return crypto | ||
.createHash('sha256') | ||
.update(plainText) | ||
.digest('base64'); | ||
return crypto_1.createHash('sha256').update(plainText).digest('base64'); | ||
} | ||
exports.hashBase64 = hashBase64; | ||
//# sourceMappingURL=Crypto.js.map |
{ | ||
"name": "fintecture-client", | ||
"version": "1.0.15", | ||
"version": "1.0.16", | ||
"description": "Fintecture Open Banking API Gateway enabling secure bank connections and payments", | ||
@@ -5,0 +5,0 @@ "main": "lib/fintecture-client.js", |
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
0
163113
86
2355