@fiado/api-invoker 1.2.52 → 1.2.54

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 (153) hide show
  1. package/README.md +64 -64
  2. package/bin/account-fiadoinc/AccountFiadoIncApi.d.ts +1 -0
  3. package/bin/account-fiadoinc/AccountFiadoIncApi.js +4 -0
  4. package/bin/account-fiadoinc/interfaces/IAccountFiadoIncApi.d.ts +1 -0
  5. package/bin/centralPayments/CentralPaymentsConnectorApi.d.ts +1 -2
  6. package/bin/centralPayments/CentralPaymentsConnectorApi.js +4 -4
  7. package/bin/centralPayments/interfaces/ICentralPaymentsConnectorApi.d.ts +1 -1
  8. package/package.json +27 -27
  9. package/src/account-beneficiary/AccountBeneficiaryApi.ts +18 -18
  10. package/src/account-beneficiary/index.ts +2 -2
  11. package/src/account-beneficiary/interfaces/IAccountBeneficiaryApi.ts +7 -7
  12. package/src/account-fiadoinc/AccountFiadoIncApi.ts +73 -68
  13. package/src/account-fiadoinc/index.ts +1 -1
  14. package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +36 -33
  15. package/src/account-fiadosa/AccountFiadoSAApi.ts +37 -37
  16. package/src/account-fiadosa/index.ts +1 -1
  17. package/src/account-fiadosa/interfaces/IAccountFiadoSAApi.ts +15 -15
  18. package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +46 -46
  19. package/src/account-pagoconfiado/index.ts +2 -2
  20. package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +24 -24
  21. package/src/activity-business/ActivityApi.ts +36 -36
  22. package/src/activity-business/index.ts +5 -5
  23. package/src/activity-business/interfaces/IActivityApi.ts +13 -13
  24. package/src/activity-business/queue/ActivityPublisher.ts +28 -28
  25. package/src/activity-business/queue/IActivityPublisher.ts +4 -4
  26. package/src/address/AddressApi.ts +46 -46
  27. package/src/address/index.ts +3 -3
  28. package/src/address/interfaces/IAddressApi.ts +30 -30
  29. package/src/authentication/AuthenticationApi.ts +16 -16
  30. package/src/authentication/index.ts +4 -4
  31. package/src/authentication/interfaces/IAuthenticationApi.ts +5 -5
  32. package/src/bankAccount/BankAccountApi.ts +48 -48
  33. package/src/bankAccount/index.ts +1 -1
  34. package/src/bankAccount/interfaces/IBankAccountApi.ts +6 -6
  35. package/src/bbvaRst/api/BBVARstApi.ts +16 -16
  36. package/src/bbvaRst/api/interfaces/IBBVARstApi.ts +4 -4
  37. package/src/bbvaRst/index.ts +1 -1
  38. package/src/blacklist/BlackListApi.ts +19 -19
  39. package/src/blacklist/index.ts +2 -2
  40. package/src/blacklist/interfaces/IBlackListApi.ts +20 -20
  41. package/src/card/CardApi.ts +53 -53
  42. package/src/card/index.ts +3 -3
  43. package/src/card/interfaces/ICardApi.ts +16 -16
  44. package/src/centralPayments/CentralPaymentsConnectorApi.ts +177 -178
  45. package/src/centralPayments/index.ts +1 -1
  46. package/src/centralPayments/interfaces/ICentralPaymentsConnectorApi.ts +83 -83
  47. package/src/cnbv-business/CnbvApi.ts +22 -22
  48. package/src/cnbv-business/index.ts +4 -4
  49. package/src/cnbv-business/interfaces/ICnbvApi.ts +6 -6
  50. package/src/cognitoConnector/CognitoConnectorApi.ts +106 -106
  51. package/src/cognitoConnector/CognitoConnectorV2.ts +81 -81
  52. package/src/cognitoConnector/index.ts +11 -11
  53. package/src/cognitoConnector/interfaces/ICognitoConnectorApi.ts +15 -15
  54. package/src/cognitoConnector/interfaces/ICognitoV2Api.ts +58 -58
  55. package/src/collector/CollectorApi.ts +25 -25
  56. package/src/collector/index.ts +2 -2
  57. package/src/collector/interfaces/ICollectorApi.ts +21 -21
  58. package/src/contactInformation/ContactInformationApi.ts +20 -20
  59. package/src/contactInformation/index.ts +2 -2
  60. package/src/contactInformation/interface/IContactInformationApi.ts +8 -8
  61. package/src/container.config.ts +126 -126
  62. package/src/contract-generator/ContractGeneratorApi.ts +18 -18
  63. package/src/contract-generator/index.ts +2 -2
  64. package/src/contract-generator/interfaces/IContractGeneratorApi.ts +16 -16
  65. package/src/device/DeviceApi.ts +23 -23
  66. package/src/device/index.ts +2 -2
  67. package/src/device/interfaces/IDeviceApi.ts +24 -24
  68. package/src/directories/DirectoriesApi.ts +53 -53
  69. package/src/directories/index.ts +3 -3
  70. package/src/directories/interfaces/IDirectoriesApi.ts +16 -16
  71. package/src/directory/DirectoryApi.ts +150 -150
  72. package/src/directory/index.ts +3 -3
  73. package/src/directory/interfaces/IDirectoryApi.ts +69 -69
  74. package/src/disputes/DisputesApi.ts +50 -50
  75. package/src/disputes/index.ts +2 -2
  76. package/src/disputes/interfaces/IDisputesApi.ts +54 -54
  77. package/src/exchangeRates/ExchangeRatesApi.ts +27 -27
  78. package/src/exchangeRates/index.ts +1 -1
  79. package/src/exchangeRates/interfaces/IExchangeRatesApi.ts +8 -8
  80. package/src/fiadoMessages/api/FiadoMessagesApi.ts +20 -20
  81. package/src/fiadoMessages/api/interfaces/IFiadoMessagesApi.ts +2 -2
  82. package/src/fiadoMessages/index.ts +1 -1
  83. package/src/fraudPreventionEngine/api/FraudPreventionEngineApi.ts +22 -22
  84. package/src/fraudPreventionEngine/api/interfaces/IFraudPreventionEngineApi.ts +7 -7
  85. package/src/fraudPreventionEngine/index.ts +1 -1
  86. package/src/group/GroupApi.ts +24 -24
  87. package/src/group/index.ts +1 -1
  88. package/src/group/interfaces/IGroupApi.ts +23 -23
  89. package/src/identity/IdentityApi.ts +78 -78
  90. package/src/identity/index.ts +3 -3
  91. package/src/identity/interfaces/IIdentityApi.ts +38 -38
  92. package/src/index.ts +41 -41
  93. package/src/legalDocument/api/LegalDocumentApi.ts +26 -26
  94. package/src/legalDocument/api/interfaces/ILegalDocumentApi.ts +6 -6
  95. package/src/legalDocument/index.ts +3 -3
  96. package/src/notificationMessages/index.ts +1 -1
  97. package/src/notificationMessages/queue/NotificationMessagePublisher.ts +22 -22
  98. package/src/notificationMessages/queue/interfaces/INotificationMessagesPublisher.ts +4 -4
  99. package/src/observations/ObservationsApi.ts +23 -23
  100. package/src/observations/index.ts +3 -3
  101. package/src/observations/interfaces/IObservationsApi.ts +9 -9
  102. package/src/p2pContact/api/P2pContactApi.ts +19 -19
  103. package/src/p2pContact/api/interfaces/IP2pContactApi.ts +4 -4
  104. package/src/p2pContact/index.ts +1 -1
  105. package/src/pomelo/api/PomeloApi.ts +99 -99
  106. package/src/pomelo/api/interfaces/IPomeloApi.ts +27 -27
  107. package/src/pomelo/index.ts +1 -1
  108. package/src/pomeloProcessor/api/PomeloProcessorApi.ts +17 -17
  109. package/src/pomeloProcessor/api/interfaces/IPomeloProcessorApi.ts +2 -2
  110. package/src/pomeloProcessor/index.ts +2 -2
  111. package/src/product-catalog/ProductCatalogApi.ts +17 -17
  112. package/src/product-catalog/index.ts +1 -1
  113. package/src/product-catalog/interfaces/IProductCatalogApi.ts +6 -6
  114. package/src/riskProfile/api/RiskProfileApi.ts +39 -39
  115. package/src/riskProfile/api/TransactionAlertApi.ts +22 -22
  116. package/src/riskProfile/api/interfaces/IRiskProfileApi.ts +14 -14
  117. package/src/riskProfile/api/interfaces/ITransactionAlertApi.ts +7 -7
  118. package/src/riskProfile/index.ts +7 -7
  119. package/src/riskProfile/queue/TransactionAlarmPublisher.ts +24 -24
  120. package/src/riskProfile/queue/interfaces/ITransactionAlarmPublisher.ts +4 -4
  121. package/src/service-business/ServiceApi.ts +60 -60
  122. package/src/service-business/index.ts +2 -2
  123. package/src/service-business/interfaces/IServiceApi.ts +44 -44
  124. package/src/sessionActivity/index.ts +2 -2
  125. package/src/sessionActivity/queue/SessionActivityPublisher.ts +22 -22
  126. package/src/sessionActivity/queue/interfaces/ISessionActivityPublisher.ts +4 -4
  127. package/src/stpAccount/api/STPAccountApi.ts +111 -111
  128. package/src/stpAccount/api/interfaces/ISTPAccountApi.ts +7 -7
  129. package/src/stpAccount/index.ts +1 -1
  130. package/src/stpServicePayment/api/StpServicePaymentApi.ts +40 -40
  131. package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +13 -13
  132. package/src/stpServicePayment/index.ts +1 -1
  133. package/src/stpSpei/api/StpSpeiApi.ts +32 -32
  134. package/src/stpSpei/api/interfaces/IStpSpeiApi.ts +6 -6
  135. package/src/stpSpei/index.ts +1 -1
  136. package/src/tern/api/TernApi.ts +137 -137
  137. package/src/tern/api/interfaces/ITernApi.ts +38 -38
  138. package/src/tern/index.ts +1 -1
  139. package/src/transaction/api/TransactionApi.ts +92 -92
  140. package/src/transaction/api/interfaces/ITransactionApi.ts +35 -35
  141. package/src/transaction/index.ts +5 -5
  142. package/src/transaction/queue/TransactionPublisher.ts +24 -24
  143. package/src/transaction/queue/interfaces/ITransactionPublisher.ts +4 -4
  144. package/src/transactionProcessor/api/TransactionProcessorApi.ts +42 -42
  145. package/src/transactionProcessor/api/interfaces/ITransactionProcessorApi.ts +18 -18
  146. package/src/transactionProcessor/index.ts +1 -1
  147. package/src/utils/InvokerUtils.ts +18 -18
  148. package/src/zendesk/ZendeskApi.ts +24 -24
  149. package/src/zendesk/index.ts +3 -3
  150. package/src/zendesk/interfaces/IZendeskApi.ts +10 -10
  151. package/tsconfig.json +21 -21
  152. package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +0 -46
  153. package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.js +0 -2
@@ -1,44 +1,44 @@
1
- import { RegisterDeviceRequest } from "@fiado/type-kit/bin/device";
2
- import { ServiceFlowEnum, ServiceMembershipStatusEnum, UpdateServiceMembershipRequest } from "@fiado/type-kit/bin/services";
3
- import { ServiceCompanyEnum } from "@fiado/type-kit/bin/services/enums/ServiceCompanyEnum";
4
-
5
- /**
6
- * Interfaz que define las operaciones que se pueden realizar en el servicio de black list.
7
- */
8
- export interface IServiceApi {
9
-
10
- /**
11
- * Consulta de membresias
12
- * @param value valor del parametro.
13
- * @returns Una promesa que resuelve a void.
14
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
15
- */
16
- getServices(params: { pageSize?: number; index?: string; company?:ServiceCompanyEnum, flow?:ServiceFlowEnum }): Promise<void>;
17
-
18
- /**
19
- * Consulta de membresias de un directorio dado un directoryId
20
- * @param value valor del parametro.
21
- * @returns Una promesa que resuelve a void.
22
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
23
- */
24
- getServiceMembershipsByDirectoryId(params: { directoryId: string; pageSize?: number; index?: string; }): Promise<void>;
25
-
26
-
27
- /**
28
- * Consulta de membresias de un directorio dado un directoryId y un status
29
- * @param value valor del parametro.
30
- * @returns Una promesa que resuelve a void.
31
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
32
- */
33
- getServiceMembershipsByDirectoryIdAndStatus(params: { pageSize?: number; index?: string; directoryId:string,status:ServiceMembershipStatusEnum }): Promise<void>;
34
-
35
-
36
- /**
37
- * Actualizar una membresia de un servicio
38
- * @param value valor del parametro.
39
- * @returns Una promesa que resuelve a void.
40
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
41
- */
42
- updateServiceMembership(serviceMembershipId:string,params: UpdateServiceMembershipRequest): Promise<void>;
43
-
44
- }
1
+ import { RegisterDeviceRequest } from "@fiado/type-kit/bin/device";
2
+ import { ServiceFlowEnum, ServiceMembershipStatusEnum, UpdateServiceMembershipRequest } from "@fiado/type-kit/bin/services";
3
+ import { ServiceCompanyEnum } from "@fiado/type-kit/bin/services/enums/ServiceCompanyEnum";
4
+
5
+ /**
6
+ * Interfaz que define las operaciones que se pueden realizar en el servicio de black list.
7
+ */
8
+ export interface IServiceApi {
9
+
10
+ /**
11
+ * Consulta de membresias
12
+ * @param value valor del parametro.
13
+ * @returns Una promesa que resuelve a void.
14
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
15
+ */
16
+ getServices(params: { pageSize?: number; index?: string; company?:ServiceCompanyEnum, flow?:ServiceFlowEnum }): Promise<void>;
17
+
18
+ /**
19
+ * Consulta de membresias de un directorio dado un directoryId
20
+ * @param value valor del parametro.
21
+ * @returns Una promesa que resuelve a void.
22
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
23
+ */
24
+ getServiceMembershipsByDirectoryId(params: { directoryId: string; pageSize?: number; index?: string; }): Promise<void>;
25
+
26
+
27
+ /**
28
+ * Consulta de membresias de un directorio dado un directoryId y un status
29
+ * @param value valor del parametro.
30
+ * @returns Una promesa que resuelve a void.
31
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
32
+ */
33
+ getServiceMembershipsByDirectoryIdAndStatus(params: { pageSize?: number; index?: string; directoryId:string,status:ServiceMembershipStatusEnum }): Promise<void>;
34
+
35
+
36
+ /**
37
+ * Actualizar una membresia de un servicio
38
+ * @param value valor del parametro.
39
+ * @returns Una promesa que resuelve a void.
40
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
41
+ */
42
+ updateServiceMembership(serviceMembershipId:string,params: UpdateServiceMembershipRequest): Promise<void>;
43
+
44
+ }
@@ -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,111 +1,111 @@
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
- async cancelAccount(request: {accountNumber:string, documentNumber:string}): Promise<any> {
28
- const url: string = `${this.baseUrl}account/cancel`;
29
- return await this.httpRequest.post(url, request);
30
- }
31
-
32
-
33
- // //USER
34
- // async createUser(request: CreateBankAccountUserRequest): Promise<any> {
35
- // const url: string = `${this.baseUrl}users/create`;
36
- // return await this.httpRequest.post(url, request);
37
- // }
38
-
39
- // public async getUserById(externalUserId: string): Promise<any> {
40
- // const url: string = `${this.baseUrl}users/${externalUserId}`;
41
- // return await this.httpRequest.get(url);
42
- // }
43
-
44
- // public async updateUser(object: UpdateBankAccountUserRequest): Promise<any> {
45
- // const url: string = `${this.baseUrl}/users/${object.id}`;
46
- // return await this.httpRequest.put(url, object);
47
- // }
48
-
49
- // //Card
50
- // public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<GetBankAccountSensitiveInformationOutput> {
51
- // const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
52
- // return await this.httpRequest.get(url);
53
- // }
54
-
55
- // public async getCardsById(externalCardId: string): Promise<GetBankAccountCardOutput> {
56
- // const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
57
- // return await this.httpRequest.get(url);
58
- // }
59
-
60
- // public async getCardsByUserId(externalUserId: string): Promise<GetBankAccountCardOutput> {
61
- // const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
62
- // return await this.httpRequest.get(url);
63
- // }
64
-
65
- // public async createCard(object: CreateBankAccountCardInput): Promise<CreateBankAccountCardOutput> {
66
- // const url: string = `${this.baseUrl}cards/create`;
67
- // return await this.httpRequest.post(url, object);
68
- // }
69
-
70
- // public async blockCard(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 changePin(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
76
- // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
77
- // return await this.httpRequest.put(url, object);
78
- // }
79
-
80
- // public async activateCard(object: ActivateBankAccountCardInput): Promise<ActivateBankAccountCardOutput> {
81
- // const url: string = `${this.baseUrl}cards/activate`;
82
- // return await this.httpRequest.post(url, object);
83
- // }
84
-
85
- // public async updateCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
86
- // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
87
- // return await this.httpRequest.put(url, object);
88
- // }
89
-
90
-
91
- // //Shipping
92
-
93
- // public async createShipment(object: CreateBankAccountCardShippingInput): Promise<any> {
94
- // const url: string = `${this.baseUrl}shipment/create`;
95
- // return await this.httpRequest.post(url, object);
96
- // }
97
-
98
- // public async getShipment(object: GetBankAccountShippingInput): Promise<GetBankAccountShippingOutput> {
99
- // const url: string = `${this.baseUrl}shipment/${object.shippingId}`;
100
- // return await this.httpRequest.get(url);
101
- // }
102
-
103
- // public async replaceCardByExternalId(object: ExternalReplaceCardInput): Promise<ExternalReplaceCardOutput> {
104
- // const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
105
- // return await this.httpRequest.put(url, object);
106
- // }
107
-
108
-
109
-
110
-
111
- }
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
+ async cancelAccount(request: {accountNumber:string, documentNumber:string}): Promise<any> {
28
+ const url: string = `${this.baseUrl}account/cancel`;
29
+ return await this.httpRequest.post(url, request);
30
+ }
31
+
32
+
33
+ // //USER
34
+ // async createUser(request: CreateBankAccountUserRequest): Promise<any> {
35
+ // const url: string = `${this.baseUrl}users/create`;
36
+ // return await this.httpRequest.post(url, request);
37
+ // }
38
+
39
+ // public async getUserById(externalUserId: string): Promise<any> {
40
+ // const url: string = `${this.baseUrl}users/${externalUserId}`;
41
+ // return await this.httpRequest.get(url);
42
+ // }
43
+
44
+ // public async updateUser(object: UpdateBankAccountUserRequest): Promise<any> {
45
+ // const url: string = `${this.baseUrl}/users/${object.id}`;
46
+ // return await this.httpRequest.put(url, object);
47
+ // }
48
+
49
+ // //Card
50
+ // public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<GetBankAccountSensitiveInformationOutput> {
51
+ // const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
52
+ // return await this.httpRequest.get(url);
53
+ // }
54
+
55
+ // public async getCardsById(externalCardId: string): Promise<GetBankAccountCardOutput> {
56
+ // const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
57
+ // return await this.httpRequest.get(url);
58
+ // }
59
+
60
+ // public async getCardsByUserId(externalUserId: string): Promise<GetBankAccountCardOutput> {
61
+ // const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
62
+ // return await this.httpRequest.get(url);
63
+ // }
64
+
65
+ // public async createCard(object: CreateBankAccountCardInput): Promise<CreateBankAccountCardOutput> {
66
+ // const url: string = `${this.baseUrl}cards/create`;
67
+ // return await this.httpRequest.post(url, object);
68
+ // }
69
+
70
+ // public async blockCard(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 changePin(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
76
+ // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
77
+ // return await this.httpRequest.put(url, object);
78
+ // }
79
+
80
+ // public async activateCard(object: ActivateBankAccountCardInput): Promise<ActivateBankAccountCardOutput> {
81
+ // const url: string = `${this.baseUrl}cards/activate`;
82
+ // return await this.httpRequest.post(url, object);
83
+ // }
84
+
85
+ // public async updateCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
86
+ // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
87
+ // return await this.httpRequest.put(url, object);
88
+ // }
89
+
90
+
91
+ // //Shipping
92
+
93
+ // public async createShipment(object: CreateBankAccountCardShippingInput): Promise<any> {
94
+ // const url: string = `${this.baseUrl}shipment/create`;
95
+ // return await this.httpRequest.post(url, object);
96
+ // }
97
+
98
+ // public async getShipment(object: GetBankAccountShippingInput): Promise<GetBankAccountShippingOutput> {
99
+ // const url: string = `${this.baseUrl}shipment/${object.shippingId}`;
100
+ // return await this.httpRequest.get(url);
101
+ // }
102
+
103
+ // public async replaceCardByExternalId(object: ExternalReplaceCardInput): Promise<ExternalReplaceCardOutput> {
104
+ // const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
105
+ // return await this.httpRequest.put(url, object);
106
+ // }
107
+
108
+
109
+
110
+
111
+ }
@@ -1,8 +1,8 @@
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
- cancelAccount(request: {accountNumber:string, documentNumber:string}): 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
+ cancelAccount(request: {accountNumber:string, documentNumber:string}): Promise<any>
8
8
  }
@@ -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';
@@ -1,33 +1,33 @@
1
- import {IStpSpeiApi} from "./interfaces/IStpSpeiApi";
2
- import {inject, injectable} from "inversify";
3
- import {IHttpRequest} from "@fiado/http-client";
4
- import {BusinessNameEnum, PutStpOrderRequest} from "@fiado/type-kit/bin/stpSpei";
5
-
6
- @injectable()
7
- export class StpSpeiApi implements IStpSpeiApi {
8
- private readonly baseUrl = process.env.STP_SPEI_LAMBDA_URL || "";
9
-
10
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
11
- }
12
-
13
- async putStpOrder(request: PutStpOrderRequest): Promise<any> {
14
- const url = `${this.baseUrl}`;
15
- const headers = {
16
- 'Content-Type': 'application/json',
17
- operationName: "putConnectorStpOrders"
18
- }
19
- return await this.httpRequest.post(url, request, headers);
20
- }
21
-
22
- async getBusinessAccountBalance(businessName: BusinessNameEnum): Promise<any> {
23
- const url: string = `${this.baseUrl}`;
24
- const request = {
25
- business: businessName
26
- }
27
- const headers = {
28
- 'Content-Type': 'application/json',
29
- operationName: "getBusinessAccountBalance"
30
- }
31
- return await this.httpRequest.post(url, request, headers);
32
- }
1
+ import {IStpSpeiApi} from "./interfaces/IStpSpeiApi";
2
+ import {inject, injectable} from "inversify";
3
+ import {IHttpRequest} from "@fiado/http-client";
4
+ import {BusinessNameEnum, PutStpOrderRequest} from "@fiado/type-kit/bin/stpSpei";
5
+
6
+ @injectable()
7
+ export class StpSpeiApi implements IStpSpeiApi {
8
+ private readonly baseUrl = process.env.STP_SPEI_LAMBDA_URL || "";
9
+
10
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
11
+ }
12
+
13
+ async putStpOrder(request: PutStpOrderRequest): Promise<any> {
14
+ const url = `${this.baseUrl}`;
15
+ const headers = {
16
+ 'Content-Type': 'application/json',
17
+ operationName: "putConnectorStpOrders"
18
+ }
19
+ return await this.httpRequest.post(url, request, headers);
20
+ }
21
+
22
+ async getBusinessAccountBalance(businessName: BusinessNameEnum): Promise<any> {
23
+ const url: string = `${this.baseUrl}`;
24
+ const request = {
25
+ business: businessName
26
+ }
27
+ const headers = {
28
+ 'Content-Type': 'application/json',
29
+ operationName: "getBusinessAccountBalance"
30
+ }
31
+ return await this.httpRequest.post(url, request, headers);
32
+ }
33
33
  }
@@ -1,7 +1,7 @@
1
- import {BusinessNameEnum, PutStpOrderRequest} from "@fiado/type-kit/bin/stpSpei";
2
-
3
- export interface IStpSpeiApi {
4
- putStpOrder(request: PutStpOrderRequest): Promise<any>;
5
-
6
- getBusinessAccountBalance(businessName: BusinessNameEnum): Promise<any>;
1
+ import {BusinessNameEnum, PutStpOrderRequest} from "@fiado/type-kit/bin/stpSpei";
2
+
3
+ export interface IStpSpeiApi {
4
+ putStpOrder(request: PutStpOrderRequest): Promise<any>;
5
+
6
+ getBusinessAccountBalance(businessName: BusinessNameEnum): Promise<any>;
7
7
  }
@@ -1,2 +1,2 @@
1
- export * from './api/interfaces/IStpSpeiApi';
1
+ export * from './api/interfaces/IStpSpeiApi';
2
2
  export * from './api/StpSpeiApi';