@fiado/api-invoker 1.1.41 → 1.1.42

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.
Files changed (99) hide show
  1. package/README.md +64 -64
  2. package/bin/bankAccount/BankAccountApi.d.ts +1 -0
  3. package/bin/bankAccount/BankAccountApi.js +9 -0
  4. package/bin/bankAccount/interfaces/IBankAccountApi.d.ts +1 -0
  5. package/package.json +28 -28
  6. package/src/account-beneficiary/AccountBeneficiaryApi.ts +18 -18
  7. package/src/account-beneficiary/index.ts +2 -2
  8. package/src/account-beneficiary/interfaces/IAccountBeneficiaryApi.ts +7 -7
  9. package/src/account-fiadoinc/AccountFiadoIncApi.ts +65 -65
  10. package/src/account-fiadoinc/index.ts +1 -1
  11. package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +32 -32
  12. package/src/account-fiadosa/AccountFiadoSAApi.ts +27 -27
  13. package/src/account-fiadosa/index.ts +1 -1
  14. package/src/account-fiadosa/interfaces/IAccountFiadoSAApi.ts +11 -11
  15. package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +42 -42
  16. package/src/account-pagoconfiado/index.ts +2 -2
  17. package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +22 -22
  18. package/src/activity-business/ActivityApi.ts +19 -19
  19. package/src/activity-business/index.ts +5 -5
  20. package/src/activity-business/interfaces/IActivityApi.ts +8 -8
  21. package/src/activity-business/queue/ActivityPublisher.ts +28 -28
  22. package/src/activity-business/queue/IActivityPublisher.ts +4 -4
  23. package/src/address/AddressApi.ts +46 -46
  24. package/src/address/index.ts +3 -3
  25. package/src/address/interfaces/IAddressApi.ts +30 -30
  26. package/src/authentication/AuthenticationApi.ts +16 -16
  27. package/src/authentication/index.ts +4 -4
  28. package/src/authentication/interfaces/IAuthenticationApi.ts +5 -5
  29. package/src/bankAccount/BankAccountApi.ts +48 -37
  30. package/src/bankAccount/index.ts +1 -1
  31. package/src/bankAccount/interfaces/IBankAccountApi.ts +6 -4
  32. package/src/bbvaRst/api/BBVARstApi.ts +16 -16
  33. package/src/bbvaRst/api/interfaces/IBBVARstApi.ts +4 -4
  34. package/src/bbvaRst/index.ts +1 -1
  35. package/src/card/CardApi.ts +36 -36
  36. package/src/card/index.ts +3 -3
  37. package/src/card/interfaces/ICardApi.ts +10 -10
  38. package/src/collector/CollectorApi.ts +25 -25
  39. package/src/collector/index.ts +2 -2
  40. package/src/collector/interfaces/ICollectorApi.ts +21 -21
  41. package/src/container.config.ts +81 -81
  42. package/src/contract-generator/ContractGeneratorApi.ts +18 -18
  43. package/src/contract-generator/index.ts +2 -2
  44. package/src/contract-generator/interfaces/IContractGeneratorApi.ts +16 -16
  45. package/src/directory/DirectoryApi.ts +115 -115
  46. package/src/directory/index.ts +3 -3
  47. package/src/directory/interfaces/IDirectoryApi.ts +66 -66
  48. package/src/exchangeRates/ExchangeRatesApi.ts +27 -27
  49. package/src/exchangeRates/index.ts +1 -1
  50. package/src/exchangeRates/interfaces/IExchangeRatesApi.ts +8 -8
  51. package/src/fraudPreventionEngine/api/FraudPreventionEngineApi.ts +22 -22
  52. package/src/fraudPreventionEngine/api/interfaces/IFraudPreventionEngineApi.ts +7 -7
  53. package/src/fraudPreventionEngine/index.ts +1 -1
  54. package/src/group/GroupApi.ts +24 -24
  55. package/src/group/index.ts +1 -1
  56. package/src/group/interfaces/IGroupApi.ts +23 -23
  57. package/src/identity/IdentityApi.ts +47 -47
  58. package/src/identity/index.ts +3 -3
  59. package/src/identity/interfaces/IIdentityApi.ts +33 -33
  60. package/src/index.ts +28 -28
  61. package/src/notificationMessages/index.ts +1 -1
  62. package/src/notificationMessages/queue/NotificationMessagePublisher.ts +22 -22
  63. package/src/notificationMessages/queue/interfaces/INotificationMessagesPublisher.ts +4 -4
  64. package/src/p2pContact/api/P2pContactApi.ts +19 -19
  65. package/src/p2pContact/api/interfaces/IP2pContactApi.ts +4 -4
  66. package/src/p2pContact/index.ts +1 -1
  67. package/src/pomelo/api/PomeloApi.ts +99 -99
  68. package/src/pomelo/api/interfaces/IPomeloApi.ts +27 -27
  69. package/src/pomelo/index.ts +1 -1
  70. package/src/product-catalog/ProductCatalogApi.ts +17 -17
  71. package/src/product-catalog/index.ts +1 -1
  72. package/src/product-catalog/interfaces/IProductCatalogApi.ts +6 -6
  73. package/src/riskProfile/api/RiskProfileApi.ts +29 -29
  74. package/src/riskProfile/api/interfaces/IRiskProfileApi.ts +10 -10
  75. package/src/riskProfile/index.ts +4 -4
  76. package/src/riskProfile/queue/TransactionAlarmPublisher.ts +24 -24
  77. package/src/riskProfile/queue/interfaces/ITransactionAlarmPublisher.ts +4 -4
  78. package/src/sessionActivity/index.ts +2 -2
  79. package/src/sessionActivity/queue/SessionActivityPublisher.ts +22 -22
  80. package/src/sessionActivity/queue/interfaces/ISessionActivityPublisher.ts +4 -4
  81. package/src/stpAccount/api/STPAccountApi.ts +106 -106
  82. package/src/stpAccount/api/interfaces/ISTPAccountApi.ts +6 -6
  83. package/src/stpAccount/index.ts +1 -1
  84. package/src/stpServicePayment/api/StpServicePaymentApi.ts +40 -40
  85. package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +13 -13
  86. package/src/stpServicePayment/index.ts +1 -1
  87. package/src/stpSpei/api/StpSpeiApi.ts +20 -20
  88. package/src/stpSpei/api/interfaces/IStpSpeiApi.ts +4 -4
  89. package/src/stpSpei/index.ts +1 -1
  90. package/src/tern/api/TernApi.ts +132 -132
  91. package/src/tern/api/interfaces/ITernApi.ts +36 -36
  92. package/src/tern/index.ts +1 -1
  93. package/src/transaction/index.ts +2 -2
  94. package/src/transaction/queue/TransactionPublisher.ts +24 -24
  95. package/src/transaction/queue/interfaces/ITransactionPublisher.ts +4 -4
  96. package/src/transactionProcessor/api/TransactionProcessorApi.ts +31 -31
  97. package/src/transactionProcessor/api/interfaces/ITransactionProcessorApi.ts +12 -12
  98. package/src/transactionProcessor/index.ts +1 -1
  99. package/tsconfig.json +21 -21
@@ -1,18 +1,18 @@
1
- import {IProductCatalogApi} from "./interfaces/IProductCatalogApi";
2
- import {inject, injectable} from "inversify";
3
- import {IHttpRequest} from "@fiado/http-client";
4
- import {ApiGatewayResponse} from "@fiado/gateway-adapter";
5
- import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/GetProductCatalogResponse";
6
-
7
- @injectable()
8
- export default class ProductCatalogApi implements IProductCatalogApi {
9
- private readonly baseUrl = process.env.PRODUCT_CATALOG_LAMBDA_URL || "";
10
-
11
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
12
- }
13
-
14
- async getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>> {
15
- const url = `${this.baseUrl}?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
16
- return await this.httpRequest.get(url);
17
- }
1
+ import {IProductCatalogApi} from "./interfaces/IProductCatalogApi";
2
+ import {inject, injectable} from "inversify";
3
+ import {IHttpRequest} from "@fiado/http-client";
4
+ import {ApiGatewayResponse} from "@fiado/gateway-adapter";
5
+ import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/GetProductCatalogResponse";
6
+
7
+ @injectable()
8
+ export default class ProductCatalogApi implements IProductCatalogApi {
9
+ private readonly baseUrl = process.env.PRODUCT_CATALOG_LAMBDA_URL || "";
10
+
11
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
12
+ }
13
+
14
+ async getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>> {
15
+ const url = `${this.baseUrl}?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
16
+ return await this.httpRequest.get(url);
17
+ }
18
18
  }
@@ -1,2 +1,2 @@
1
- export * from './interfaces/IProductCatalogApi';
1
+ export * from './interfaces/IProductCatalogApi';
2
2
  export * from './ProductCatalogApi';
@@ -1,7 +1,7 @@
1
- import {ApiGatewayResponse} from "@fiado/gateway-adapter";
2
- import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/GetProductCatalogResponse";
3
-
4
-
5
- export interface IProductCatalogApi {
6
- getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>>;
1
+ import {ApiGatewayResponse} from "@fiado/gateway-adapter";
2
+ import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/GetProductCatalogResponse";
3
+
4
+
5
+ export interface IProductCatalogApi {
6
+ getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>>;
7
7
  }
@@ -1,30 +1,30 @@
1
- import {IRiskProfileApi} from "./interfaces/IRiskProfileApi";
2
- import {inject, injectable} from "inversify";
3
- import {IHttpRequest} from "@fiado/http-client";
4
- import {CreateRiskProfileRequest} from "@fiado/type-kit/bin/riskProfile";
5
- import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
6
- import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
7
-
8
- @injectable()
9
- export default class RiskProfileApi implements IRiskProfileApi {
10
- private readonly baseUrl = process.env.RISK_PROFILE_LAMBDA_URL || "";
11
-
12
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
13
- }
14
-
15
- async createRiskProfile(request: CreateRiskProfileRequest): Promise<any> {
16
- const url = `${this.baseUrl}/profiles`;
17
- return await this.httpRequest.post(url, request);
18
- }
19
-
20
- async updateRiskProfile(request: UpdateRiskProfileRequest): Promise<any> {
21
- const url = `${this.baseUrl}/profiles`;
22
- return await this.httpRequest.put(url, request);
23
- }
24
-
25
- async updateAlarmProfile(request: UpdateAlarmProfileRequest): Promise<any> {
26
- const url = `${this.baseUrl}/alarms`;
27
- return await this.httpRequest.put(url, request);
28
- }
29
-
1
+ import {IRiskProfileApi} from "./interfaces/IRiskProfileApi";
2
+ import {inject, injectable} from "inversify";
3
+ import {IHttpRequest} from "@fiado/http-client";
4
+ import {CreateRiskProfileRequest} from "@fiado/type-kit/bin/riskProfile";
5
+ import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
6
+ import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
7
+
8
+ @injectable()
9
+ export default class RiskProfileApi implements IRiskProfileApi {
10
+ private readonly baseUrl = process.env.RISK_PROFILE_LAMBDA_URL || "";
11
+
12
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
13
+ }
14
+
15
+ async createRiskProfile(request: CreateRiskProfileRequest): Promise<any> {
16
+ const url = `${this.baseUrl}/profiles`;
17
+ return await this.httpRequest.post(url, request);
18
+ }
19
+
20
+ async updateRiskProfile(request: UpdateRiskProfileRequest): Promise<any> {
21
+ const url = `${this.baseUrl}/profiles`;
22
+ return await this.httpRequest.put(url, request);
23
+ }
24
+
25
+ async updateAlarmProfile(request: UpdateAlarmProfileRequest): Promise<any> {
26
+ const url = `${this.baseUrl}/alarms`;
27
+ return await this.httpRequest.put(url, request);
28
+ }
29
+
30
30
  }
@@ -1,11 +1,11 @@
1
- import {CreateRiskProfileRequest} from "@fiado/type-kit/bin/riskProfile";
2
- import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
3
- import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
4
-
5
- export interface IRiskProfileApi {
6
- createRiskProfile(request: CreateRiskProfileRequest): Promise<any>;
7
-
8
- updateRiskProfile(request: UpdateRiskProfileRequest): Promise<any>;
9
-
10
- updateAlarmProfile(request: UpdateAlarmProfileRequest): Promise<any>;
1
+ import {CreateRiskProfileRequest} from "@fiado/type-kit/bin/riskProfile";
2
+ import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
3
+ import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
4
+
5
+ export interface IRiskProfileApi {
6
+ createRiskProfile(request: CreateRiskProfileRequest): Promise<any>;
7
+
8
+ updateRiskProfile(request: UpdateRiskProfileRequest): Promise<any>;
9
+
10
+ updateAlarmProfile(request: UpdateAlarmProfileRequest): Promise<any>;
11
11
  }
@@ -1,5 +1,5 @@
1
- export * from './api/RiskProfileApi';
2
- export * from './api/interfaces/IRiskProfileApi'
3
-
4
- export * from './queue/TransactionAlarmPublisher';
1
+ export * from './api/RiskProfileApi';
2
+ export * from './api/interfaces/IRiskProfileApi'
3
+
4
+ export * from './queue/TransactionAlarmPublisher';
5
5
  export * from './queue/interfaces/ITransactionAlarmPublisher';
@@ -1,25 +1,25 @@
1
- import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
2
- import {injectable} from "inversify";
3
- import { TransactionAlarmQueueMessage } from "@fiado/type-kit/bin/riskProfile";
4
- import { ITransactionAlarmPublisher } from "./interfaces/ITransactionAlarmPublisher";
5
-
6
- @injectable()
7
- export class TransactionAlarmPublisher implements ITransactionAlarmPublisher {
8
- private readonly TRANSACTION_ALARM_QUEUE = process.env.TRANSACTION_ALARM_QUEUE
9
-
10
- async publish(message: TransactionAlarmQueueMessage): Promise<void> {
11
- try {
12
- const client: SQSClient = new SQSClient();
13
- const sendMessageRequest: SendMessageRequest = {
14
- QueueUrl: this.TRANSACTION_ALARM_QUEUE,
15
- MessageBody: JSON.stringify(message),
16
- MessageGroupId: message.transactionNumber,
17
- MessageDeduplicationId: message.transactionNumber
18
- };
19
- const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
20
- await client.send(command);
21
- } catch (error) {
22
- throw new Error(`Error publishing message to queue ${': ' + error.message ?? ''}`);
23
- }
24
- }
1
+ import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
2
+ import {injectable} from "inversify";
3
+ import { TransactionAlarmQueueMessage } from "@fiado/type-kit/bin/riskProfile";
4
+ import { ITransactionAlarmPublisher } from "./interfaces/ITransactionAlarmPublisher";
5
+
6
+ @injectable()
7
+ export class TransactionAlarmPublisher implements ITransactionAlarmPublisher {
8
+ private readonly TRANSACTION_ALARM_QUEUE = process.env.TRANSACTION_ALARM_QUEUE
9
+
10
+ async publish(message: TransactionAlarmQueueMessage): Promise<void> {
11
+ try {
12
+ const client: SQSClient = new SQSClient();
13
+ const sendMessageRequest: SendMessageRequest = {
14
+ QueueUrl: this.TRANSACTION_ALARM_QUEUE,
15
+ MessageBody: JSON.stringify(message),
16
+ MessageGroupId: message.transactionNumber,
17
+ MessageDeduplicationId: message.transactionNumber
18
+ };
19
+ const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
20
+ await client.send(command);
21
+ } catch (error) {
22
+ throw new Error(`Error publishing message to queue ${': ' + error.message ?? ''}`);
23
+ }
24
+ }
25
25
  }
@@ -1,5 +1,5 @@
1
- import { TransactionAlarmQueueMessage } from "@fiado/type-kit/bin/riskProfile";
2
-
3
- export interface ITransactionAlarmPublisher {
4
- publish(message: TransactionAlarmQueueMessage): Promise<void>;
1
+ import { TransactionAlarmQueueMessage } from "@fiado/type-kit/bin/riskProfile";
2
+
3
+ export interface ITransactionAlarmPublisher {
4
+ publish(message: TransactionAlarmQueueMessage): Promise<void>;
5
5
  }
@@ -1,2 +1,2 @@
1
- export * from './queue/SessionActivityPublisher';
2
- export * from './queue/interfaces/ISessionActivityPublisher';
1
+ export * from './queue/SessionActivityPublisher';
2
+ export * from './queue/interfaces/ISessionActivityPublisher';
@@ -1,23 +1,23 @@
1
- import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
2
- import {ISessionActivityPublisher} from "./interfaces/ISessionActivityPublisher";
3
- import {SessionActivityQueueMessageRequest} from "@fiado/type-kit/bin/sessionActivity";
4
- import {injectable} from "inversify";
5
-
6
- @injectable()
7
- export class SessionActivityPublisher implements ISessionActivityPublisher {
8
- private readonly SESSION_ACTIVITY_QUEUE = process.env.SESSION_ACTIVITY_QUEUE
9
-
10
- async publish(message: SessionActivityQueueMessageRequest): Promise<void> {
11
- try {
12
- const client: SQSClient = new SQSClient();
13
- const sendMessageRequest: SendMessageRequest = {
14
- QueueUrl: this.SESSION_ACTIVITY_QUEUE,
15
- MessageBody: JSON.stringify(message)
16
- };
17
- const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
18
- await client.send(command);
19
- } catch (error) {
20
- throw new Error(`Error publishing message to queue ${': ' + error.message ?? ''}`);
21
- }
22
- }
1
+ import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
2
+ import {ISessionActivityPublisher} from "./interfaces/ISessionActivityPublisher";
3
+ import {SessionActivityQueueMessageRequest} from "@fiado/type-kit/bin/sessionActivity";
4
+ import {injectable} from "inversify";
5
+
6
+ @injectable()
7
+ export class SessionActivityPublisher implements ISessionActivityPublisher {
8
+ private readonly SESSION_ACTIVITY_QUEUE = process.env.SESSION_ACTIVITY_QUEUE
9
+
10
+ async publish(message: SessionActivityQueueMessageRequest): Promise<void> {
11
+ try {
12
+ const client: SQSClient = new SQSClient();
13
+ const sendMessageRequest: SendMessageRequest = {
14
+ QueueUrl: this.SESSION_ACTIVITY_QUEUE,
15
+ MessageBody: JSON.stringify(message)
16
+ };
17
+ const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
18
+ await client.send(command);
19
+ } catch (error) {
20
+ throw new Error(`Error publishing message to queue ${': ' + error.message ?? ''}`);
21
+ }
22
+ }
23
23
  }
@@ -1,5 +1,5 @@
1
- import {SessionActivityQueueMessageRequest} from "@fiado/type-kit/bin/sessionActivity";
2
-
3
- export interface ISessionActivityPublisher {
4
- publish(message: SessionActivityQueueMessageRequest): Promise<void>;
1
+ import {SessionActivityQueueMessageRequest} from "@fiado/type-kit/bin/sessionActivity";
2
+
3
+ export interface ISessionActivityPublisher {
4
+ publish(message: SessionActivityQueueMessageRequest): Promise<void>;
5
5
  }
@@ -1,106 +1,106 @@
1
- import {ISTPAccountApi } from "./interfaces/ISTPAccountApi";
2
- import {inject, injectable} from "inversify";
3
- import {IHttpRequest} from "@fiado/http-client";
4
- import {AccountCreateRequest} from "@fiado/type-kit/bin/account";
5
- import { CreateAccountWebhookDetail } from "@fiado/type-kit/bin/stpAccount";
6
-
7
-
8
- @injectable()
9
- export default class STPAccountApi implements ISTPAccountApi {
10
-
11
-
12
- private readonly baseUrl = process.env.STP_ACCOUNT_LAMBDA_URL || "";
13
-
14
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
15
- }
16
-
17
- async updateAccountDetails(request: CreateAccountWebhookDetail): Promise<any> {
18
- const url: string = `${this.baseUrl}account/update`;
19
- return await this.httpRequest.put(url, request);
20
- }
21
-
22
- async createAccount(request: AccountCreateRequest): Promise<any> {
23
- const url: string = `${this.baseUrl}account/create`;
24
- return await this.httpRequest.post(url, request);
25
- }
26
-
27
-
28
- // //USER
29
- // async createUser(request: CreateBankAccountUserRequest): Promise<any> {
30
- // const url: string = `${this.baseUrl}users/create`;
31
- // return await this.httpRequest.post(url, request);
32
- // }
33
-
34
- // public async getUserById(externalUserId: string): Promise<any> {
35
- // const url: string = `${this.baseUrl}users/${externalUserId}`;
36
- // return await this.httpRequest.get(url);
37
- // }
38
-
39
- // public async updateUser(object: UpdateBankAccountUserRequest): Promise<any> {
40
- // const url: string = `${this.baseUrl}/users/${object.id}`;
41
- // return await this.httpRequest.put(url, object);
42
- // }
43
-
44
- // //Card
45
- // public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<GetBankAccountSensitiveInformationOutput> {
46
- // const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
47
- // return await this.httpRequest.get(url);
48
- // }
49
-
50
- // public async getCardsById(externalCardId: string): Promise<GetBankAccountCardOutput> {
51
- // const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
52
- // return await this.httpRequest.get(url);
53
- // }
54
-
55
- // public async getCardsByUserId(externalUserId: string): Promise<GetBankAccountCardOutput> {
56
- // const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
57
- // return await this.httpRequest.get(url);
58
- // }
59
-
60
- // public async createCard(object: CreateBankAccountCardInput): Promise<CreateBankAccountCardOutput> {
61
- // const url: string = `${this.baseUrl}cards/create`;
62
- // return await this.httpRequest.post(url, object);
63
- // }
64
-
65
- // public async blockCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
66
- // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
67
- // return await this.httpRequest.put(url, object);
68
- // }
69
-
70
- // public async changePin(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
71
- // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
72
- // return await this.httpRequest.put(url, object);
73
- // }
74
-
75
- // public async activateCard(object: ActivateBankAccountCardInput): Promise<ActivateBankAccountCardOutput> {
76
- // const url: string = `${this.baseUrl}cards/activate`;
77
- // return await this.httpRequest.post(url, object);
78
- // }
79
-
80
- // public async updateCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
81
- // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
82
- // return await this.httpRequest.put(url, object);
83
- // }
84
-
85
-
86
- // //Shipping
87
-
88
- // public async createShipment(object: CreateBankAccountCardShippingInput): Promise<any> {
89
- // const url: string = `${this.baseUrl}shipment/create`;
90
- // return await this.httpRequest.post(url, object);
91
- // }
92
-
93
- // public async getShipment(object: GetBankAccountShippingInput): Promise<GetBankAccountShippingOutput> {
94
- // const url: string = `${this.baseUrl}shipment/${object.shippingId}`;
95
- // return await this.httpRequest.get(url);
96
- // }
97
-
98
- // public async replaceCardByExternalId(object: ExternalReplaceCardInput): Promise<ExternalReplaceCardOutput> {
99
- // const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
100
- // return await this.httpRequest.put(url, object);
101
- // }
102
-
103
-
104
-
105
-
106
- }
1
+ import {ISTPAccountApi } from "./interfaces/ISTPAccountApi";
2
+ import {inject, injectable} from "inversify";
3
+ import {IHttpRequest} from "@fiado/http-client";
4
+ import {AccountCreateRequest} from "@fiado/type-kit/bin/account";
5
+ import { CreateAccountWebhookDetail } from "@fiado/type-kit/bin/stpAccount";
6
+
7
+
8
+ @injectable()
9
+ export default class STPAccountApi implements ISTPAccountApi {
10
+
11
+
12
+ private readonly baseUrl = process.env.STP_ACCOUNT_LAMBDA_URL || "";
13
+
14
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
15
+ }
16
+
17
+ async updateAccountDetails(request: CreateAccountWebhookDetail): Promise<any> {
18
+ const url: string = `${this.baseUrl}account/update`;
19
+ return await this.httpRequest.put(url, request);
20
+ }
21
+
22
+ async createAccount(request: AccountCreateRequest): Promise<any> {
23
+ const url: string = `${this.baseUrl}account/create`;
24
+ return await this.httpRequest.post(url, request);
25
+ }
26
+
27
+
28
+ // //USER
29
+ // async createUser(request: CreateBankAccountUserRequest): Promise<any> {
30
+ // const url: string = `${this.baseUrl}users/create`;
31
+ // return await this.httpRequest.post(url, request);
32
+ // }
33
+
34
+ // public async getUserById(externalUserId: string): Promise<any> {
35
+ // const url: string = `${this.baseUrl}users/${externalUserId}`;
36
+ // return await this.httpRequest.get(url);
37
+ // }
38
+
39
+ // public async updateUser(object: UpdateBankAccountUserRequest): Promise<any> {
40
+ // const url: string = `${this.baseUrl}/users/${object.id}`;
41
+ // return await this.httpRequest.put(url, object);
42
+ // }
43
+
44
+ // //Card
45
+ // public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<GetBankAccountSensitiveInformationOutput> {
46
+ // const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
47
+ // return await this.httpRequest.get(url);
48
+ // }
49
+
50
+ // public async getCardsById(externalCardId: string): Promise<GetBankAccountCardOutput> {
51
+ // const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
52
+ // return await this.httpRequest.get(url);
53
+ // }
54
+
55
+ // public async getCardsByUserId(externalUserId: string): Promise<GetBankAccountCardOutput> {
56
+ // const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
57
+ // return await this.httpRequest.get(url);
58
+ // }
59
+
60
+ // public async createCard(object: CreateBankAccountCardInput): Promise<CreateBankAccountCardOutput> {
61
+ // const url: string = `${this.baseUrl}cards/create`;
62
+ // return await this.httpRequest.post(url, object);
63
+ // }
64
+
65
+ // public async blockCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
66
+ // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
67
+ // return await this.httpRequest.put(url, object);
68
+ // }
69
+
70
+ // public async changePin(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
71
+ // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
72
+ // return await this.httpRequest.put(url, object);
73
+ // }
74
+
75
+ // public async activateCard(object: ActivateBankAccountCardInput): Promise<ActivateBankAccountCardOutput> {
76
+ // const url: string = `${this.baseUrl}cards/activate`;
77
+ // return await this.httpRequest.post(url, object);
78
+ // }
79
+
80
+ // public async updateCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
81
+ // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
82
+ // return await this.httpRequest.put(url, object);
83
+ // }
84
+
85
+
86
+ // //Shipping
87
+
88
+ // public async createShipment(object: CreateBankAccountCardShippingInput): Promise<any> {
89
+ // const url: string = `${this.baseUrl}shipment/create`;
90
+ // return await this.httpRequest.post(url, object);
91
+ // }
92
+
93
+ // public async getShipment(object: GetBankAccountShippingInput): Promise<GetBankAccountShippingOutput> {
94
+ // const url: string = `${this.baseUrl}shipment/${object.shippingId}`;
95
+ // return await this.httpRequest.get(url);
96
+ // }
97
+
98
+ // public async replaceCardByExternalId(object: ExternalReplaceCardInput): Promise<ExternalReplaceCardOutput> {
99
+ // const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
100
+ // return await this.httpRequest.put(url, object);
101
+ // }
102
+
103
+
104
+
105
+
106
+ }
@@ -1,7 +1,7 @@
1
- import {AccountCreateRequest} from "@fiado/type-kit/bin/account";
2
- import { CreateAccountWebhookDetail } from "@fiado/type-kit/bin/stpAccount";
3
-
4
- export interface ISTPAccountApi {
5
- createAccount(request: AccountCreateRequest): Promise<any>;
6
- updateAccountDetails(request: CreateAccountWebhookDetail): Promise<any>;
1
+ import {AccountCreateRequest} from "@fiado/type-kit/bin/account";
2
+ import { CreateAccountWebhookDetail } from "@fiado/type-kit/bin/stpAccount";
3
+
4
+ export interface ISTPAccountApi {
5
+ createAccount(request: AccountCreateRequest): Promise<any>;
6
+ updateAccountDetails(request: CreateAccountWebhookDetail): Promise<any>;
7
7
  }
@@ -1,2 +1,2 @@
1
- export * from './api/STPAccountApi';
1
+ export * from './api/STPAccountApi';
2
2
  export * from './api/interfaces/ISTPAccountApi';
@@ -1,41 +1,41 @@
1
- import {IStpServicePaymentApi} from "./interfaces/IStpServicePaymentApi";
2
- import {inject, injectable} from "inversify";
3
- import {IHttpRequest} from "@fiado/http-client";
4
- import {GetCatalogParams, ServicePaymentRequest} from "@fiado/type-kit/bin/servicePayment";
5
- import {ApiGatewayResponse} from "@fiado/gateway-adapter";
6
-
7
- @injectable()
8
- export default class StpServicePaymentApi implements IStpServicePaymentApi {
9
- private readonly baseUrl = process.env.STP_SERVICE_PAY_LAMBDA_URL || "";
10
-
11
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
12
- }
13
-
14
- async pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>> {
15
- const url = `${this.baseUrl}/pay`;
16
- return await this.httpRequest.post(url, request);
17
- }
18
-
19
- async getTransaction(transactionNumber: string): Promise<ApiGatewayResponse<any>> {
20
- const url = `${this.baseUrl}/transaction/${transactionNumber}`;
21
- return await this.httpRequest.get(url);
22
- }
23
-
24
- async getById(id: string): Promise<ApiGatewayResponse<any>> {
25
- const url = `${this.baseUrl}/transaction/${id}`;
26
- return await this.httpRequest.get(url);
27
- }
28
-
29
- async getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>> {
30
- const url = `${this.baseUrl}/pay/validation/${transactionNumber}`;
31
- return await this.httpRequest.get(url);
32
- }
33
-
34
- async getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>> {
35
- let url = `${this.baseUrl}/catalog`;
36
- if (params) {
37
- url += `?${Object.keys(params).map(key => `${key}=${encodeURIComponent(params[key])}`).join('&')}`;
38
- }
39
- return await this.httpRequest.get(url);
40
- }
1
+ import {IStpServicePaymentApi} from "./interfaces/IStpServicePaymentApi";
2
+ import {inject, injectable} from "inversify";
3
+ import {IHttpRequest} from "@fiado/http-client";
4
+ import {GetCatalogParams, ServicePaymentRequest} from "@fiado/type-kit/bin/servicePayment";
5
+ import {ApiGatewayResponse} from "@fiado/gateway-adapter";
6
+
7
+ @injectable()
8
+ export default class StpServicePaymentApi implements IStpServicePaymentApi {
9
+ private readonly baseUrl = process.env.STP_SERVICE_PAY_LAMBDA_URL || "";
10
+
11
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
12
+ }
13
+
14
+ async pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>> {
15
+ const url = `${this.baseUrl}/pay`;
16
+ return await this.httpRequest.post(url, request);
17
+ }
18
+
19
+ async getTransaction(transactionNumber: string): Promise<ApiGatewayResponse<any>> {
20
+ const url = `${this.baseUrl}/transaction/${transactionNumber}`;
21
+ return await this.httpRequest.get(url);
22
+ }
23
+
24
+ async getById(id: string): Promise<ApiGatewayResponse<any>> {
25
+ const url = `${this.baseUrl}/transaction/${id}`;
26
+ return await this.httpRequest.get(url);
27
+ }
28
+
29
+ async getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>> {
30
+ const url = `${this.baseUrl}/pay/validation/${transactionNumber}`;
31
+ return await this.httpRequest.get(url);
32
+ }
33
+
34
+ async getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>> {
35
+ let url = `${this.baseUrl}/catalog`;
36
+ if (params) {
37
+ url += `?${Object.keys(params).map(key => `${key}=${encodeURIComponent(params[key])}`).join('&')}`;
38
+ }
39
+ return await this.httpRequest.get(url);
40
+ }
41
41
  }
@@ -1,14 +1,14 @@
1
- import {GetCatalogParams, ServicePaymentRequest} from "@fiado/type-kit/bin/servicePayment";
2
- import {ApiGatewayResponse} from "@fiado/gateway-adapter";
3
-
4
- export interface IStpServicePaymentApi {
5
- pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>>;
6
-
7
- getTransaction(transactionNumber: string): Promise<ApiGatewayResponse<any>>;
8
-
9
- getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>>
10
-
11
- getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>>;
12
-
13
- getById(id: string)
1
+ import {GetCatalogParams, ServicePaymentRequest} from "@fiado/type-kit/bin/servicePayment";
2
+ import {ApiGatewayResponse} from "@fiado/gateway-adapter";
3
+
4
+ export interface IStpServicePaymentApi {
5
+ pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>>;
6
+
7
+ getTransaction(transactionNumber: string): Promise<ApiGatewayResponse<any>>;
8
+
9
+ getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>>
10
+
11
+ getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>>;
12
+
13
+ getById(id: string)
14
14
  }
@@ -1,2 +1,2 @@
1
- export * from './api/interfaces/IStpServicePaymentApi';
1
+ export * from './api/interfaces/IStpServicePaymentApi';
2
2
  export * from './api/StpServicePaymentApi';