@bankingserviceai/sdk
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -9,2 +9,3 @@ import { RequestInit, RequestInfo } from "node-fetch"; | ||
declare class BankingServiceAISDK { | ||
credentialId: string; | ||
accessToken?: string; | ||
@@ -14,3 +15,3 @@ refreshToken?: string; | ||
privateKey: Secret; | ||
constructor(partnerId: string, privateKey: Secret); | ||
constructor(credentialId: string, partnerId: string, privateKey: Secret); | ||
fetch<T = any>(url: URL | RequestInfo, init?: RequestInit): Promise<T>; | ||
@@ -30,4 +31,4 @@ requestAccessToken(): Promise<void>; | ||
declare const _default: { | ||
partner: (partnerId: string, privateKey: Secret) => BankingServiceAISDK; | ||
partner: (credentialId: string, partnerId: string, privateKey: Secret) => BankingServiceAISDK; | ||
}; | ||
export default _default; |
@@ -9,2 +9,3 @@ import { Headers, default as nodeFetch } from "node-fetch"; | ||
class BankingServiceAISDK { | ||
credentialId; | ||
accessToken; | ||
@@ -14,4 +15,5 @@ refreshToken; | ||
privateKey; | ||
constructor(partnerId, privateKey) { | ||
constructor(credentialId, partnerId, privateKey) { | ||
this.partnerId = partnerId; | ||
this.credentialId = credentialId; | ||
this.privateKey = privateKey; | ||
@@ -51,3 +53,3 @@ } | ||
issuer: this.partnerId, | ||
subject: this.partnerId, | ||
subject: this.credentialId, | ||
audience: 'api.bankignservice.ai', | ||
@@ -60,3 +62,3 @@ algorithm: 'RS256', | ||
grant_type: 'client_credentials', | ||
client_id: this.partnerId, | ||
client_id: this.credentialId, | ||
}), | ||
@@ -85,5 +87,5 @@ headers: { | ||
export default { | ||
partner: (partnerId, privateKey) => { | ||
return new BankingServiceAISDK(partnerId, privateKey); | ||
partner: (credentialId, partnerId, privateKey) => { | ||
return new BankingServiceAISDK(credentialId, partnerId, privateKey); | ||
} | ||
}; |
{ | ||
"name": "@bankingserviceai/sdk", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
49097
513