@@ -43,34 +43,37 @@ export class AIS {
4343 state ?: string ,
4444 model ?: string ,
4545 psuId ?: string ,
46- psuIpAddress ?: string
46+ psuIpAddress ?: string ,
4747 ) : Promise < object > {
4848 if ( accessToken ) {
49- return await this . _authorizeWithAccessToken ( accessToken , providerId , redirectUri , state , model , psuId , psuIpAddress ) ;
49+ return await this . _authorizeWithAccessToken (
50+ accessToken ,
51+ providerId ,
52+ redirectUri ,
53+ state ,
54+ model ,
55+ psuId ,
56+ psuIpAddress ,
57+ ) ;
5058 } else {
5159 return await this . _authorizeWithAppId ( providerId , redirectUri , state , model , psuId , psuIpAddress ) ;
5260 }
5361 }
5462
55-
5663 /**
57- * This API is used to poll the authentication status within
64+ * This API is used to poll the authentication status within
5865 * the decoupled model. Once the decoupled authentication flow
59- * as initiated, the status is "PENDING". Once the PSU has
60- * successfully authenticated, the status becomes "COMPLETED".
61- * If the authentication times out, is cancelled or failed,
66+ * as initiated, the status is "PENDING". Once the PSU has
67+ * successfully authenticated, the status becomes "COMPLETED".
68+ * If the authentication times out, is cancelled or failed,
6269 * the status becomes "FAILED".
6370 *
6471 * @param {string } accessToken
6572 * @param {string } providerId
6673 * @param {string } pollingId
6774 * @returns {Promise<object> }
6875 */
69- public async decoupled (
70- accessToken : string ,
71- providerId : string ,
72- pollingId : string
73- ) : Promise < object > {
76+ public async decoupled ( accessToken : string , providerId : string , pollingId : string ) : Promise < object > {
7477 if ( accessToken ) {
7578 return await this . _decoupledWithAccesToken ( accessToken , providerId , pollingId ) ;
7679 } else {
@@ -86,16 +89,21 @@ export class AIS {
8689 * @param {object } queryParameters (optional)
8790 * @returns {Promise<object> }
8891 */
89- public async getAccounts ( accessToken : string , customerId : string , queryParameters ?: object , headerParameters ?: object ) : Promise < object > {
90- const url = `${ Endpoints . AISCUSTOMER } /${ customerId } /accounts${ queryParameters ? '?' + qs . stringify ( queryParameters ) : '' } ` ;
92+ public async getAccounts (
93+ accessToken : string ,
94+ customerId : string ,
95+ queryParameters ?: object ,
96+ headerParameters ?: object ,
97+ ) : Promise < object > {
98+ const url = `${ Endpoints . AISCUSTOMER } /${ customerId } /accounts${
99+ queryParameters ? '?' + qs . stringify ( queryParameters ) : ''
100+ } `;
91101
92102 const headers = apiService . getHeaders ( 'get' , url , accessToken , this . config , null , headerParameters ) ;
93103
94- return await this . axiosInstance
95- . get ( url , { headers } )
96- . then ( response => {
97- return response . data ;
98- } ) ;
104+ return await this . axiosInstance . get ( url , { headers } ) . then ( response => {
105+ return response . data ;
106+ } ) ;
99107 }
100108
101109 /**
@@ -109,21 +117,27 @@ export class AIS {
109117 * @param {string } paginationUrl (optional)
110118 * @returns {Promise<object> }
111119 */
112- public async getTransactions ( accessToken : string , customerId : string , accountId : string , queryParameters ?: object , headerParameters ?: object , paginationUrl ?: string ) : Promise < object > {
113-
120+ public async getTransactions (
121+ accessToken : string ,
122+ customerId : string ,
123+ accountId : string ,
124+ queryParameters ?: object ,
125+ headerParameters ?: object ,
126+ paginationUrl ?: string ,
127+ ) : Promise < object > {
114128 let url = paginationUrl ;
115129
116130 if ( ! url ) {
117- url = `${ Endpoints . AISCUSTOMER } /${ customerId } /accounts/${ accountId } /transactions${ queryParameters ? '?' + qs . stringify ( queryParameters ) : '' } ` ;
131+ url = `${ Endpoints . AISCUSTOMER } /${ customerId } /accounts/${ accountId } /transactions${
132+ queryParameters ? '?' + qs . stringify ( queryParameters ) : ''
133+ } `;
118134 }
119135
120136 const headers = apiService . getHeaders ( 'get' , url , accessToken , this . config , null , headerParameters ) ;
121137
122- return await this . axiosInstance
123- . get ( url , { headers } )
124- . then ( response => {
125- return response . data ;
126- } ) ;
138+ return await this . axiosInstance . get ( url , { headers } ) . then ( response => {
139+ return response . data ;
140+ } ) ;
127141 }
128142
129143 /**
@@ -135,16 +149,21 @@ export class AIS {
135149 * @param {object } queryParameters (optional)
136150 * @returns {Promise<object> }
137151 */
138- public async getAccountHolders ( accessToken : string , customerId : string , queryParameters : object , headerParameters ?: object ) : Promise < object > {
139- const url = `${ Endpoints . AISCUSTOMER } /${ customerId } /accountholders${ queryParameters ? '?' + qs . stringify ( queryParameters ) : '' } ` ;
152+ public async getAccountHolders (
153+ accessToken : string ,
154+ customerId : string ,
155+ queryParameters : object ,
156+ headerParameters ?: object ,
157+ ) : Promise < object > {
158+ const url = `${ Endpoints . AISCUSTOMER } /${ customerId } /accountholders${
159+ queryParameters ? '?' + qs . stringify ( queryParameters ) : ''
160+ } `;
140161
141162 const headers = apiService . getHeaders ( 'get' , url , accessToken , this . config , null , headerParameters ) ;
142163
143- return await this . axiosInstance
144- . get ( url , { headers } , )
145- . then ( response => {
146- return response . data ;
147- } ) ;
164+ return await this . axiosInstance . get ( url , { headers } ) . then ( response => {
165+ return response . data ;
166+ } ) ;
148167 }
149168
150169 /**
@@ -159,9 +178,7 @@ export class AIS {
159178
160179 const headers = apiService . getHeaders ( 'delete' , url , accessToken , this . config ) ;
161180
162- return await this . axiosInstance
163- . delete ( url , { headers } )
164- . then ( response => response . data ) ;
181+ return await this . axiosInstance . delete ( url , { headers } ) . then ( response => response . data ) ;
165182 }
166183
167184 /**
@@ -181,11 +198,10 @@ export class AIS {
181198 providerId : string ,
182199 redirectUri : string ,
183200 state ?: string ,
184- model ?: string ,
185- psuId ?: string ,
186- psuIpAddress ?: string
201+ model ?: string ,
202+ psuId ?: string ,
203+ psuIpAddress ?: string ,
187204 ) : Promise < object > {
188-
189205 const queryParameters = {
190206 redirect_uri : redirectUri ,
191207 } ;
@@ -203,12 +219,10 @@ export class AIS {
203219 const headers = apiService . getHeaders ( 'get' , url , accessToken , this . config ) ;
204220
205221 if ( model === Constants . DECOUPLEDMODEL ) {
206- headers [ " x-psu-id" ] = psuId ;
207- headers [ " x-psu-ip-address" ] = psuIpAddress
222+ headers [ ' x-psu-id' ] = psuId ;
223+ headers [ ' x-psu-ip-address' ] = psuIpAddress ;
208224 }
209225
210-
211-
212226 const response = await this . axiosInstance . get ( url , { headers } ) ;
213227 return response . data ;
214228 }
@@ -218,10 +232,9 @@ export class AIS {
218232 redirectUri : string ,
219233 state ?: string ,
220234 model ?: string ,
221- psuId ?: string ,
222- psuIpAddress ?: string
235+ psuId ?: string ,
236+ psuIpAddress ?: string ,
223237 ) : Promise < object > {
224-
225238 const queryParameters = {
226239 response_type : 'code' ,
227240 redirect_uri : redirectUri ,
@@ -240,19 +253,15 @@ export class AIS {
240253 const headers = apiService . getHeaders ( 'get' , url , null , this . config ) ;
241254
242255 if ( model === Constants . DECOUPLEDMODEL ) {
243- headers [ " x-psu-id" ] = psuId ;
244- headers [ " x-psu-ip-address" ] = psuIpAddress
256+ headers [ ' x-psu-id' ] = psuId ;
257+ headers [ ' x-psu-ip-address' ] = psuIpAddress ;
245258 }
246259
247260 const response = await this . axiosInstance . get ( url , { headers } ) ;
248261 return response . data ;
249262 }
250263
251- private async _decoupledWithAccesToken (
252- accessToken : string ,
253- providerId : string ,
254- pollingId : string
255- ) : Promise < object > {
264+ private async _decoupledWithAccesToken ( accessToken : string , providerId : string , pollingId : string ) : Promise < object > {
256265 const url = `${ Endpoints . AISPROVIDER } /${ providerId } /authorize/decoupled/${ pollingId } ` ;
257266
258267 const headers = apiService . getHeaders ( 'get' , url , accessToken , this . config ) ;
@@ -261,10 +270,7 @@ export class AIS {
261270 return response . data ;
262271 }
263272
264- private async _decoupledWithAppId (
265- providerId : string ,
266- pollingId : string
267- ) : Promise < object > {
273+ private async _decoupledWithAppId ( providerId : string , pollingId : string ) : Promise < object > {
268274 const url = `${ Endpoints . AISPROVIDER } /${ providerId } /authorize/decoupled/${ pollingId } ` ;
269275
270276 const headers = apiService . getHeaders ( 'get' , url , null , this . config ) ;
0 commit comments