diff --git a/ts/tink.classes.tinkaccount.ts b/ts/tink.classes.tinkaccount.ts index 9ea5713..3a4a93a 100644 --- a/ts/tink.classes.tinkaccount.ts +++ b/ts/tink.classes.tinkaccount.ts @@ -4,13 +4,13 @@ import { TinkUser } from './tink.classes.tinkuser'; export class TinkAccount { public clientId: string; - private clientSecret: string; + private _clientSecret: string; - private apiBaseUrl: string = 'https://api.tink.com'; + private _apiBaseUrl: string = 'https://api.tink.com'; constructor(clientIdArg: string, clientSecretArg: string) { this.clientId = clientIdArg; - this.clientSecret = clientSecretArg; + this._clientSecret = clientSecretArg; } public async getTinkHealthyBoolean(): Promise { @@ -26,7 +26,7 @@ export class TinkAccount { public async getClientAccessTokenForScope(scopeArg: string): Promise { // lets get an accessToken for the request const response = await plugins.smartrequest.postFormDataUrlEncoded( - `${this.apiBaseUrl}/api/v1/oauth/token`, + `${this._apiBaseUrl}/api/v1/oauth/token`, { keepAlive: false, }, @@ -37,7 +37,7 @@ export class TinkAccount { }, { key: 'client_secret', - content: this.clientSecret, + content: this._clientSecret, }, { key: 'grant_type', @@ -65,7 +65,7 @@ export class TinkAccount { ) { const accessToken = await this.getClientAccessTokenForScope('authorization:grant'); const response = await plugins.smartrequest.postFormDataUrlEncoded( - `${this.apiBaseUrl}/api/v1/oauth/authorization-grant/delegate`, + `${this._apiBaseUrl}/api/v1/oauth/authorization-grant/delegate`, { keepAlive: false, headers: { @@ -107,7 +107,7 @@ export class TinkAccount { public async getUserAccessToken(authorizationCode: string): Promise { const accessToken = await this.getClientAccessTokenForScope('authorization:grant'); const response = await plugins.smartrequest.postFormDataUrlEncoded( - `${this.apiBaseUrl}/api/v1/oauth/token`, + `${this._apiBaseUrl}/api/v1/oauth/token`, { keepAlive: false, }, @@ -122,7 +122,7 @@ export class TinkAccount { }, { key: 'client_secret', - content: this.clientSecret, + content: this._clientSecret, }, { key: 'grant_type', @@ -153,7 +153,7 @@ export class TinkAccount { } else { console.log('tink is healthy, continuing...'); } - const response = await plugins.smartrequest.request(`${this.apiBaseUrl}${optionsArg.urlArg}`, { + const response = await plugins.smartrequest.request(`${this._apiBaseUrl}${optionsArg.urlArg}`, { keepAlive: false, headers: { Authorization: `Bearer ${optionsArg.accessToken}`,