aeremmiddleware 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -239,11 +239,12 @@ export default class IdfyAPIWrapper {
239
239
  return response;
240
240
  } catch (error: any) {
241
241
  if (error?.response?.data?.error) {
242
- const errorObj = this.idfyError[error?.response?.data?.error];
242
+ let obj = this.idfyError;
243
+ const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
243
244
  if (errorObj)
244
245
  throw {
245
246
  ...this.standardErrorThrowFormat,
246
- message: this.idfyError[errorKey],
247
+ message: [errorObj.message],
247
248
  };
248
249
  }
249
250
 
@@ -266,9 +267,10 @@ export default class IdfyAPIWrapper {
266
267
  const successData = await this.pingTaskUntilSuccess(response.request_id);
267
268
 
268
269
  return successData?.[0]?.result?.source_output;
269
- } catch (error) {
270
+ } catch (error: any) {
270
271
  if (error?.response?.data?.error) {
271
- const errorObj = this.idfyError[error?.response?.data?.error];
272
+ let obj = this.idfyError;
273
+ const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
272
274
  if (errorObj)
273
275
  throw {
274
276
  ...this.standardErrorThrowFormat,
@@ -294,9 +296,10 @@ export default class IdfyAPIWrapper {
294
296
  const successData = await this.pingTaskUntilSuccess(response.request_id);
295
297
 
296
298
  return successData;
297
- } catch (error) {
299
+ } catch (error: any) {
298
300
  if (error?.response?.data?.error) {
299
- const errorObj = this.idfyError[error?.response?.data?.error];
301
+ let obj = this.idfyError;
302
+ const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
300
303
  if (errorObj)
301
304
  throw {
302
305
  ...this.standardErrorThrowFormat,
@@ -334,9 +337,10 @@ export default class IdfyAPIWrapper {
334
337
  );
335
338
 
336
339
  return response?.result;
337
- } catch (error) {
340
+ } catch (error: any) {
338
341
  if (error?.response?.data?.error) {
339
- const errorObj = this.idfyError[error?.response?.data?.error];
342
+ let obj = this.idfyError;
343
+ const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
340
344
  if (errorObj)
341
345
  throw {
342
346
  ...this.standardErrorThrowFormat,
@@ -367,9 +371,10 @@ export default class IdfyAPIWrapper {
367
371
  );
368
372
 
369
373
  return response?.result;
370
- } catch (error) {
374
+ } catch (error: any) {
371
375
  if (error?.response?.data?.error) {
372
- const errorObj = this.idfyError[error?.response?.data?.error];
376
+ let obj = this.idfyError;
377
+ const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
373
378
  if (errorObj)
374
379
  throw {
375
380
  ...this.standardErrorThrowFormat,
@@ -399,9 +404,10 @@ export default class IdfyAPIWrapper {
399
404
  );
400
405
 
401
406
  return response?.result;
402
- } catch (error) {
407
+ } catch (error: any) {
403
408
  if (error?.response?.data?.error) {
404
- const errorObj = this.idfyError[error?.response?.data?.error];
409
+ let obj = this.idfyError;
410
+ const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
405
411
  if (errorObj)
406
412
  throw {
407
413
  ...this.standardErrorThrowFormat,
@@ -432,9 +438,10 @@ export default class IdfyAPIWrapper {
432
438
  );
433
439
 
434
440
  return response?.result;
435
- } catch (error) {
441
+ } catch (error: any) {
436
442
  if (error?.response?.data?.error) {
437
- const errorObj = this.idfyError[error?.response?.data?.error];
443
+ let obj = this.idfyError;
444
+ const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
438
445
  if (errorObj)
439
446
  throw {
440
447
  ...this.standardErrorThrowFormat,
@@ -465,9 +472,10 @@ export default class IdfyAPIWrapper {
465
472
  const successData = await this.pingTaskUntilSuccess(response.request_id);
466
473
 
467
474
  return successData;
468
- } catch (error) {
475
+ } catch (error: any) {
469
476
  if (error?.response?.data?.error) {
470
- const errorObj = this.idfyError[error?.response?.data?.error];
477
+ let obj = this.idfyError;
478
+ const errorObj = obj[error?.response?.data?.error as keyof typeof obj];
471
479
  if (errorObj)
472
480
  throw {
473
481
  ...this.standardErrorThrowFormat,
@@ -1,7 +1,13 @@
1
1
  import IdfyAPIWrapper from "./idfy";
2
2
  import NovelApiWrapper from "./novel";
3
+ import IngenicoApiWrapper from "./ingenico";
4
+ import CrimeSearchAPIWrapper from "./crimeCheck";
5
+ import QbrikApiWrapper from "./qbrik";
3
6
 
4
7
  export const finance = {
5
8
  idFy: IdfyAPIWrapper,
6
9
  novel: NovelApiWrapper,
10
+ ingenico: IngenicoApiWrapper,
11
+ crimecheck: CrimeSearchAPIWrapper,
12
+ qbrik: QbrikApiWrapper,
7
13
  };