@fiado/api-invoker 1.2.53 → 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 (150) hide show
  1. package/README.md +64 -64
  2. package/bin/centralPayments/CentralPaymentsConnectorApi.d.ts +1 -0
  3. package/bin/centralPayments/CentralPaymentsConnectorApi.js +4 -0
  4. package/bin/centralPayments/interfaces/ICentralPaymentsConnectorApi.d.ts +1 -0
  5. package/package.json +27 -27
  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 +73 -73
  10. package/src/account-fiadoinc/index.ts +1 -1
  11. package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +36 -36
  12. package/src/account-fiadosa/AccountFiadoSAApi.ts +37 -37
  13. package/src/account-fiadosa/index.ts +1 -1
  14. package/src/account-fiadosa/interfaces/IAccountFiadoSAApi.ts +15 -15
  15. package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +46 -46
  16. package/src/account-pagoconfiado/index.ts +2 -2
  17. package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +24 -24
  18. package/src/activity-business/ActivityApi.ts +36 -36
  19. package/src/activity-business/index.ts +5 -5
  20. package/src/activity-business/interfaces/IActivityApi.ts +13 -13
  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 -48
  30. package/src/bankAccount/index.ts +1 -1
  31. package/src/bankAccount/interfaces/IBankAccountApi.ts +6 -6
  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/blacklist/BlackListApi.ts +19 -19
  36. package/src/blacklist/index.ts +2 -2
  37. package/src/blacklist/interfaces/IBlackListApi.ts +20 -20
  38. package/src/card/CardApi.ts +53 -53
  39. package/src/card/index.ts +3 -3
  40. package/src/card/interfaces/ICardApi.ts +16 -16
  41. package/src/centralPayments/CentralPaymentsConnectorApi.ts +177 -172
  42. package/src/centralPayments/index.ts +1 -1
  43. package/src/centralPayments/interfaces/ICentralPaymentsConnectorApi.ts +83 -81
  44. package/src/cnbv-business/CnbvApi.ts +22 -22
  45. package/src/cnbv-business/index.ts +4 -4
  46. package/src/cnbv-business/interfaces/ICnbvApi.ts +6 -6
  47. package/src/cognitoConnector/CognitoConnectorApi.ts +106 -106
  48. package/src/cognitoConnector/CognitoConnectorV2.ts +81 -81
  49. package/src/cognitoConnector/index.ts +11 -11
  50. package/src/cognitoConnector/interfaces/ICognitoConnectorApi.ts +15 -15
  51. package/src/cognitoConnector/interfaces/ICognitoV2Api.ts +58 -58
  52. package/src/collector/CollectorApi.ts +25 -25
  53. package/src/collector/index.ts +2 -2
  54. package/src/collector/interfaces/ICollectorApi.ts +21 -21
  55. package/src/contactInformation/ContactInformationApi.ts +20 -20
  56. package/src/contactInformation/index.ts +2 -2
  57. package/src/contactInformation/interface/IContactInformationApi.ts +8 -8
  58. package/src/container.config.ts +126 -126
  59. package/src/contract-generator/ContractGeneratorApi.ts +18 -18
  60. package/src/contract-generator/index.ts +2 -2
  61. package/src/contract-generator/interfaces/IContractGeneratorApi.ts +16 -16
  62. package/src/device/DeviceApi.ts +23 -23
  63. package/src/device/index.ts +2 -2
  64. package/src/device/interfaces/IDeviceApi.ts +24 -24
  65. package/src/directories/DirectoriesApi.ts +53 -53
  66. package/src/directories/index.ts +3 -3
  67. package/src/directories/interfaces/IDirectoriesApi.ts +16 -16
  68. package/src/directory/DirectoryApi.ts +150 -150
  69. package/src/directory/index.ts +3 -3
  70. package/src/directory/interfaces/IDirectoryApi.ts +69 -69
  71. package/src/disputes/DisputesApi.ts +50 -50
  72. package/src/disputes/index.ts +2 -2
  73. package/src/disputes/interfaces/IDisputesApi.ts +54 -54
  74. package/src/exchangeRates/ExchangeRatesApi.ts +27 -27
  75. package/src/exchangeRates/index.ts +1 -1
  76. package/src/exchangeRates/interfaces/IExchangeRatesApi.ts +8 -8
  77. package/src/fiadoMessages/api/FiadoMessagesApi.ts +20 -20
  78. package/src/fiadoMessages/api/interfaces/IFiadoMessagesApi.ts +2 -2
  79. package/src/fiadoMessages/index.ts +1 -1
  80. package/src/fraudPreventionEngine/api/FraudPreventionEngineApi.ts +22 -22
  81. package/src/fraudPreventionEngine/api/interfaces/IFraudPreventionEngineApi.ts +7 -7
  82. package/src/fraudPreventionEngine/index.ts +1 -1
  83. package/src/group/GroupApi.ts +24 -24
  84. package/src/group/index.ts +1 -1
  85. package/src/group/interfaces/IGroupApi.ts +23 -23
  86. package/src/identity/IdentityApi.ts +78 -78
  87. package/src/identity/index.ts +3 -3
  88. package/src/identity/interfaces/IIdentityApi.ts +38 -38
  89. package/src/index.ts +41 -41
  90. package/src/legalDocument/api/LegalDocumentApi.ts +26 -26
  91. package/src/legalDocument/api/interfaces/ILegalDocumentApi.ts +6 -6
  92. package/src/legalDocument/index.ts +3 -3
  93. package/src/notificationMessages/index.ts +1 -1
  94. package/src/notificationMessages/queue/NotificationMessagePublisher.ts +22 -22
  95. package/src/notificationMessages/queue/interfaces/INotificationMessagesPublisher.ts +4 -4
  96. package/src/observations/ObservationsApi.ts +23 -23
  97. package/src/observations/index.ts +3 -3
  98. package/src/observations/interfaces/IObservationsApi.ts +9 -9
  99. package/src/p2pContact/api/P2pContactApi.ts +19 -19
  100. package/src/p2pContact/api/interfaces/IP2pContactApi.ts +4 -4
  101. package/src/p2pContact/index.ts +1 -1
  102. package/src/pomelo/api/PomeloApi.ts +99 -99
  103. package/src/pomelo/api/interfaces/IPomeloApi.ts +27 -27
  104. package/src/pomelo/index.ts +1 -1
  105. package/src/pomeloProcessor/api/PomeloProcessorApi.ts +17 -17
  106. package/src/pomeloProcessor/api/interfaces/IPomeloProcessorApi.ts +2 -2
  107. package/src/pomeloProcessor/index.ts +2 -2
  108. package/src/product-catalog/ProductCatalogApi.ts +17 -17
  109. package/src/product-catalog/index.ts +1 -1
  110. package/src/product-catalog/interfaces/IProductCatalogApi.ts +6 -6
  111. package/src/riskProfile/api/RiskProfileApi.ts +39 -39
  112. package/src/riskProfile/api/TransactionAlertApi.ts +22 -22
  113. package/src/riskProfile/api/interfaces/IRiskProfileApi.ts +14 -14
  114. package/src/riskProfile/api/interfaces/ITransactionAlertApi.ts +7 -7
  115. package/src/riskProfile/index.ts +7 -7
  116. package/src/riskProfile/queue/TransactionAlarmPublisher.ts +24 -24
  117. package/src/riskProfile/queue/interfaces/ITransactionAlarmPublisher.ts +4 -4
  118. package/src/service-business/ServiceApi.ts +60 -60
  119. package/src/service-business/index.ts +2 -2
  120. package/src/service-business/interfaces/IServiceApi.ts +44 -44
  121. package/src/sessionActivity/index.ts +2 -2
  122. package/src/sessionActivity/queue/SessionActivityPublisher.ts +22 -22
  123. package/src/sessionActivity/queue/interfaces/ISessionActivityPublisher.ts +4 -4
  124. package/src/stpAccount/api/STPAccountApi.ts +111 -111
  125. package/src/stpAccount/api/interfaces/ISTPAccountApi.ts +7 -7
  126. package/src/stpAccount/index.ts +1 -1
  127. package/src/stpServicePayment/api/StpServicePaymentApi.ts +40 -40
  128. package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +13 -13
  129. package/src/stpServicePayment/index.ts +1 -1
  130. package/src/stpSpei/api/StpSpeiApi.ts +32 -32
  131. package/src/stpSpei/api/interfaces/IStpSpeiApi.ts +6 -6
  132. package/src/stpSpei/index.ts +1 -1
  133. package/src/tern/api/TernApi.ts +137 -137
  134. package/src/tern/api/interfaces/ITernApi.ts +38 -38
  135. package/src/tern/index.ts +1 -1
  136. package/src/transaction/api/TransactionApi.ts +92 -92
  137. package/src/transaction/api/interfaces/ITransactionApi.ts +35 -35
  138. package/src/transaction/index.ts +5 -5
  139. package/src/transaction/queue/TransactionPublisher.ts +24 -24
  140. package/src/transaction/queue/interfaces/ITransactionPublisher.ts +4 -4
  141. package/src/transactionProcessor/api/TransactionProcessorApi.ts +42 -42
  142. package/src/transactionProcessor/api/interfaces/ITransactionProcessorApi.ts +18 -18
  143. package/src/transactionProcessor/index.ts +1 -1
  144. package/src/utils/InvokerUtils.ts +18 -18
  145. package/src/zendesk/ZendeskApi.ts +24 -24
  146. package/src/zendesk/index.ts +3 -3
  147. package/src/zendesk/interfaces/IZendeskApi.ts +10 -10
  148. package/tsconfig.json +21 -21
  149. package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +0 -46
  150. package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.js +0 -2
@@ -1,54 +1,54 @@
1
-
2
- /**
3
- * Interfaz que define las operaciones que se pueden realizar en el servicio de disputas.
4
- */
5
- export interface IDisputesApi {
6
-
7
- /**
8
- * Obtener disputas por directoryId.
9
- * @param directoryId DirectoryId del usuario a consultar.
10
- * @param pageSize Tamaño de la página.
11
- * @param index Índice de la página.
12
- * @returns Una promesa que resuelve a void.
13
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
14
- */
15
- getByDirectoryId(params:{
16
- directoryId:string,
17
- pageSize?:number,
18
- index?:string
19
- }): Promise<void>;
20
-
21
-
22
- /**
23
- * Agregar PROV Y REV_PROV a una disputa.
24
- * @param disputeId Id de la disputa.
25
- * @param amount Monto de la transacción.
26
- * @param date Fecha de la transacción.
27
- * @param type REV ó PROV.
28
- * @returns Una promesa que resuelve a void.
29
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
30
- */
31
- addProvisional(params:{
32
- disputeId:string,
33
- amount:number,
34
- date:string,
35
- type:"PROV"|"REV_PROV"
36
- }): Promise<void>;
37
-
38
-
39
- /**
40
- * Consultar disputas entre fechas.
41
- * @param index indice de consulta.
42
- * @param pageSize tamaño de paginación.
43
- * @param startDate Fecha inicial de consulta.
44
- * @param endDate Fecha final de consulta
45
- * @returns Una promesa que resuelve a void.
46
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
47
- */
48
- getListBetweenDates(params:{
49
- index?:string,
50
- pageSize?:number,
51
- startDate:string,
52
- endDate:string
53
- }): Promise<void>;
54
- }
1
+
2
+ /**
3
+ * Interfaz que define las operaciones que se pueden realizar en el servicio de disputas.
4
+ */
5
+ export interface IDisputesApi {
6
+
7
+ /**
8
+ * Obtener disputas por directoryId.
9
+ * @param directoryId DirectoryId del usuario a consultar.
10
+ * @param pageSize Tamaño de la página.
11
+ * @param index Índice de la página.
12
+ * @returns Una promesa que resuelve a void.
13
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
14
+ */
15
+ getByDirectoryId(params:{
16
+ directoryId:string,
17
+ pageSize?:number,
18
+ index?:string
19
+ }): Promise<void>;
20
+
21
+
22
+ /**
23
+ * Agregar PROV Y REV_PROV a una disputa.
24
+ * @param disputeId Id de la disputa.
25
+ * @param amount Monto de la transacción.
26
+ * @param date Fecha de la transacción.
27
+ * @param type REV ó PROV.
28
+ * @returns Una promesa que resuelve a void.
29
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
30
+ */
31
+ addProvisional(params:{
32
+ disputeId:string,
33
+ amount:number,
34
+ date:string,
35
+ type:"PROV"|"REV_PROV"
36
+ }): Promise<void>;
37
+
38
+
39
+ /**
40
+ * Consultar disputas entre fechas.
41
+ * @param index indice de consulta.
42
+ * @param pageSize tamaño de paginación.
43
+ * @param startDate Fecha inicial de consulta.
44
+ * @param endDate Fecha final de consulta
45
+ * @returns Una promesa que resuelve a void.
46
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
47
+ */
48
+ getListBetweenDates(params:{
49
+ index?:string,
50
+ pageSize?:number,
51
+ startDate:string,
52
+ endDate:string
53
+ }): Promise<void>;
54
+ }
@@ -1,28 +1,28 @@
1
- import {IExchangeRatesApi} from "./interfaces/IExchangeRatesApi";
2
- import {inject, injectable} from "inversify";
3
- import {IHttpRequest} from "@fiado/http-client";
4
- import GetExchangeRatesRequest from "@fiado/type-kit/bin/exchangeRate/dtos/GetExchangeRatesRequest";
5
- import {ExchangeRateCreateRequest} from "@fiado/type-kit/bin/exchangeRate";
6
- import {promises} from "node:dns";
7
-
8
- @injectable()
9
- export default class ExchangeRatesApi implements IExchangeRatesApi {
10
- private readonly baseUrl = process.env.EXCHANGE_RATES_LAMBDA_URL || "";
11
-
12
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
13
- }
14
-
15
- async getExchangeRates(request: GetExchangeRatesRequest): Promise<any> {
16
- const headers = {
17
- "operationName": "getExchangeRates"
18
- }
19
- return await this.httpRequest.post(this.baseUrl, request, headers);
20
- }
21
-
22
- async postExchangeRates(request: ExchangeRateCreateRequest): Promise<any> {
23
- const headers = {
24
- "operationName": "postExchangeRates"
25
- }
26
- return await this.httpRequest.post(this.baseUrl, request, headers);
27
- }
1
+ import {IExchangeRatesApi} from "./interfaces/IExchangeRatesApi";
2
+ import {inject, injectable} from "inversify";
3
+ import {IHttpRequest} from "@fiado/http-client";
4
+ import GetExchangeRatesRequest from "@fiado/type-kit/bin/exchangeRate/dtos/GetExchangeRatesRequest";
5
+ import {ExchangeRateCreateRequest} from "@fiado/type-kit/bin/exchangeRate";
6
+ import {promises} from "node:dns";
7
+
8
+ @injectable()
9
+ export default class ExchangeRatesApi implements IExchangeRatesApi {
10
+ private readonly baseUrl = process.env.EXCHANGE_RATES_LAMBDA_URL || "";
11
+
12
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
13
+ }
14
+
15
+ async getExchangeRates(request: GetExchangeRatesRequest): Promise<any> {
16
+ const headers = {
17
+ "operationName": "getExchangeRates"
18
+ }
19
+ return await this.httpRequest.post(this.baseUrl, request, headers);
20
+ }
21
+
22
+ async postExchangeRates(request: ExchangeRateCreateRequest): Promise<any> {
23
+ const headers = {
24
+ "operationName": "postExchangeRates"
25
+ }
26
+ return await this.httpRequest.post(this.baseUrl, request, headers);
27
+ }
28
28
  }
@@ -1,2 +1,2 @@
1
- export * from './interfaces/IExchangeRatesApi';
1
+ export * from './interfaces/IExchangeRatesApi';
2
2
  export * from './ExchangeRatesApi';
@@ -1,9 +1,9 @@
1
- import GetExchangeRatesRequest from "@fiado/type-kit/bin/exchangeRate/dtos/GetExchangeRatesRequest";
2
- import {ExchangeRateCreateRequest} from "@fiado/type-kit/bin/exchangeRate";
3
-
4
-
5
- export interface IExchangeRatesApi {
6
- getExchangeRates(request: GetExchangeRatesRequest): Promise<any>;
7
-
8
- postExchangeRates(request: ExchangeRateCreateRequest): Promise<any>;
1
+ import GetExchangeRatesRequest from "@fiado/type-kit/bin/exchangeRate/dtos/GetExchangeRatesRequest";
2
+ import {ExchangeRateCreateRequest} from "@fiado/type-kit/bin/exchangeRate";
3
+
4
+
5
+ export interface IExchangeRatesApi {
6
+ getExchangeRates(request: GetExchangeRatesRequest): Promise<any>;
7
+
8
+ postExchangeRates(request: ExchangeRateCreateRequest): Promise<any>;
9
9
  }
@@ -1,21 +1,21 @@
1
- import {inject, injectable} from "inversify";
2
- import {IHttpRequest} from "@fiado/http-client";
3
- import {IFiadoMessagesApi} from "./interfaces/IFiadoMessagesApi";
4
-
5
- @injectable()
6
- export class FiadoMessagesApi implements IFiadoMessagesApi {
7
- private readonly baseUrl = process.env.MESSAGE_LAMBDA_URL || "";
8
-
9
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
10
- }
11
-
12
- async getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any> {
13
- const url: string = `${this.baseUrl}`;
14
- const operationName: string = "getValidatedOtpByDirectoryIdAndOtpCode";
15
- const request = {
16
- directoryId: directoryId,
17
- otpCode: otpCode
18
- };
19
- return await this.httpRequest.post(`${url}`, request, {'operationName': operationName});
20
- }
1
+ import {inject, injectable} from "inversify";
2
+ import {IHttpRequest} from "@fiado/http-client";
3
+ import {IFiadoMessagesApi} from "./interfaces/IFiadoMessagesApi";
4
+
5
+ @injectable()
6
+ export class FiadoMessagesApi implements IFiadoMessagesApi {
7
+ private readonly baseUrl = process.env.MESSAGE_LAMBDA_URL || "";
8
+
9
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
10
+ }
11
+
12
+ async getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any> {
13
+ const url: string = `${this.baseUrl}`;
14
+ const operationName: string = "getValidatedOtpByDirectoryIdAndOtpCode";
15
+ const request = {
16
+ directoryId: directoryId,
17
+ otpCode: otpCode
18
+ };
19
+ return await this.httpRequest.post(`${url}`, request, {'operationName': operationName});
20
+ }
21
21
  }
@@ -1,3 +1,3 @@
1
- export interface IFiadoMessagesApi {
2
- getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any>;
1
+ export interface IFiadoMessagesApi {
2
+ getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any>;
3
3
  }
@@ -1,2 +1,2 @@
1
- export * from './api/interfaces/IFiadoMessagesApi';
1
+ export * from './api/interfaces/IFiadoMessagesApi';
2
2
  export * from './api/FiadoMessagesApi';
@@ -1,23 +1,23 @@
1
- import {IFraudPreventionEngineApi} from "./interfaces/IFraudPreventionEngineApi";
2
- import {inject, injectable} from "inversify";
3
- import {IHttpRequest} from "@fiado/http-client";
4
- import GetAccountLevelParams from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/GetAccountLevelParams";
5
- import CreateAccountLevelRequest from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/CreateAccountLevelRequest";
6
-
7
- @injectable()
8
- export default class FraudPreventionEngineApi implements IFraudPreventionEngineApi {
9
- private readonly baseUrl = process.env.FRAUD_PREVENTION_ENGINE_LAMBDA_URL || "";
10
-
11
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
12
- }
13
-
14
- async getAccountLevel(params: GetAccountLevelParams): Promise<any> {
15
- const url: string = `${this.baseUrl}/account/levels?${Object.entries(params).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join('&')}`;
16
- return await this.httpRequest.get(url);
17
- }
18
-
19
- async createAccountLevel(request: CreateAccountLevelRequest): Promise<any> {
20
- const url: string = `${this.baseUrl}/account/levels`;
21
- return await this.httpRequest.post(url, request);
22
- }
1
+ import {IFraudPreventionEngineApi} from "./interfaces/IFraudPreventionEngineApi";
2
+ import {inject, injectable} from "inversify";
3
+ import {IHttpRequest} from "@fiado/http-client";
4
+ import GetAccountLevelParams from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/GetAccountLevelParams";
5
+ import CreateAccountLevelRequest from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/CreateAccountLevelRequest";
6
+
7
+ @injectable()
8
+ export default class FraudPreventionEngineApi implements IFraudPreventionEngineApi {
9
+ private readonly baseUrl = process.env.FRAUD_PREVENTION_ENGINE_LAMBDA_URL || "";
10
+
11
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
12
+ }
13
+
14
+ async getAccountLevel(params: GetAccountLevelParams): Promise<any> {
15
+ const url: string = `${this.baseUrl}/account/levels?${Object.entries(params).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join('&')}`;
16
+ return await this.httpRequest.get(url);
17
+ }
18
+
19
+ async createAccountLevel(request: CreateAccountLevelRequest): Promise<any> {
20
+ const url: string = `${this.baseUrl}/account/levels`;
21
+ return await this.httpRequest.post(url, request);
22
+ }
23
23
  }
@@ -1,8 +1,8 @@
1
- import GetAccountLevelParams from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/GetAccountLevelParams";
2
- import CreateAccountLevelRequest from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/CreateAccountLevelRequest";
3
-
4
- export interface IFraudPreventionEngineApi {
5
- getAccountLevel(params: GetAccountLevelParams): Promise<any>;
6
-
7
- createAccountLevel(request: CreateAccountLevelRequest): Promise<any>;
1
+ import GetAccountLevelParams from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/GetAccountLevelParams";
2
+ import CreateAccountLevelRequest from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/CreateAccountLevelRequest";
3
+
4
+ export interface IFraudPreventionEngineApi {
5
+ getAccountLevel(params: GetAccountLevelParams): Promise<any>;
6
+
7
+ createAccountLevel(request: CreateAccountLevelRequest): Promise<any>;
8
8
  }
@@ -1,2 +1,2 @@
1
- export * from './api/interfaces/IFraudPreventionEngineApi';
1
+ export * from './api/interfaces/IFraudPreventionEngineApi';
2
2
  export * from './api/FraudPreventionEngineApi';
@@ -1,25 +1,25 @@
1
- import { inject, injectable } from "inversify";
2
- import { IHttpRequest } from "@fiado/http-client";
3
- import dotenv from 'dotenv';
4
- import { GroupAddDirectoryRequest } from "@fiado/type-kit/bin/group";
5
- import { IGroupApi } from "./interfaces/IGroupApi";
6
-
7
- dotenv.config();
8
-
9
- @injectable()
10
- export class GroupApi implements IGroupApi {
11
-
12
- private readonly baseUrl = process.env.FIADO_GROUP_LAMBDA_URL || "";
13
-
14
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
15
-
16
- async findByCategory(categoryId: string): Promise<any> {
17
- const url = `${this.baseUrl}groups/categories/${categoryId}`;
18
- return await this.httpRequest.get(`${url}`);
19
- }
20
-
21
- async members(params: GroupAddDirectoryRequest): Promise<any> {
22
- const url = `${this.baseUrl}members`;
23
- return await this.httpRequest.post(`${url}`,params);
24
- }
1
+ import { inject, injectable } from "inversify";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ import dotenv from 'dotenv';
4
+ import { GroupAddDirectoryRequest } from "@fiado/type-kit/bin/group";
5
+ import { IGroupApi } from "./interfaces/IGroupApi";
6
+
7
+ dotenv.config();
8
+
9
+ @injectable()
10
+ export class GroupApi implements IGroupApi {
11
+
12
+ private readonly baseUrl = process.env.FIADO_GROUP_LAMBDA_URL || "";
13
+
14
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
15
+
16
+ async findByCategory(categoryId: string): Promise<any> {
17
+ const url = `${this.baseUrl}groups/categories/${categoryId}`;
18
+ return await this.httpRequest.get(`${url}`);
19
+ }
20
+
21
+ async members(params: GroupAddDirectoryRequest): Promise<any> {
22
+ const url = `${this.baseUrl}members`;
23
+ return await this.httpRequest.post(`${url}`,params);
24
+ }
25
25
  }
@@ -1,2 +1,2 @@
1
- export * from './interfaces/IGroupApi';
1
+ export * from './interfaces/IGroupApi';
2
2
  export * from './GroupApi';
@@ -1,23 +1,23 @@
1
- import { GroupAddDirectoryRequest } from "@fiado/type-kit/bin/group";
2
-
3
- /**
4
- * Interfaz para el servicio Directory que permite operaciones sobre directorios.
5
- */
6
- export interface IGroupApi {
7
-
8
- /**
9
- * Agrega o elimina miembros a un grupo.
10
- * @param GroupAddDirectoryRequest
11
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
12
- */
13
- members(params: GroupAddDirectoryRequest): Promise<any>;
14
-
15
-
16
- /**
17
- * Buscar grupos por categoria.
18
- * @param categoryId ID de la categoria.
19
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
20
- */
21
- findByCategory(categoryId: string): Promise<any>;
22
-
23
- }
1
+ import { GroupAddDirectoryRequest } from "@fiado/type-kit/bin/group";
2
+
3
+ /**
4
+ * Interfaz para el servicio Directory que permite operaciones sobre directorios.
5
+ */
6
+ export interface IGroupApi {
7
+
8
+ /**
9
+ * Agrega o elimina miembros a un grupo.
10
+ * @param GroupAddDirectoryRequest
11
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
12
+ */
13
+ members(params: GroupAddDirectoryRequest): Promise<any>;
14
+
15
+
16
+ /**
17
+ * Buscar grupos por categoria.
18
+ * @param categoryId ID de la categoria.
19
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
20
+ */
21
+ findByCategory(categoryId: string): Promise<any>;
22
+
23
+ }
@@ -1,79 +1,79 @@
1
- import {inject, injectable} from "inversify";
2
- import {IIdentityApi} from "./interfaces/IIdentityApi";
3
- import {IHttpRequest} from "@fiado/http-client";
4
- import dotenv from 'dotenv';
5
- import {PeopleUpdateRequest, UploadDocumentRequest} from "@fiado/type-kit/bin/identity";
6
-
7
- dotenv.config();
8
-
9
- @injectable()
10
- export class IdentityApi implements IIdentityApi {
11
-
12
- private readonly baseUrl = process.env.IDENTITY_LAMBDA_URL || "";
13
-
14
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
15
- }
16
-
17
- async getPeopleByIds(ids: string[]): Promise<any> {
18
-
19
- if (ids.length === 0) {
20
- throw new Error("At least one people ID is required.")
21
- }
22
-
23
- const url = `${this.baseUrl}identities/people?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
24
- return await this.httpRequest.get(`${url}`);
25
- }
26
-
27
- async getPeopleByCurp(curp: string): Promise<any> {
28
-
29
- if (!curp) {
30
- throw new Error("CURP is required.")
31
- }
32
-
33
- const operationName = "getPeopleByCurp";
34
-
35
- const url = `${this.baseUrl}?curp=${curp}`;
36
-
37
- return await this.httpRequest.post(`${url}`, null, {'operationName': operationName});
38
- }
39
-
40
- async updatePeopleById(id: string, data: PeopleUpdateRequest): Promise<void> {
41
-
42
- if (!id) {
43
- throw new Error("People ID is required.")
44
- }
45
-
46
- const url = `${this.baseUrl}identities/people/${id}`;
47
- await this.httpRequest.put<void>(url, data);
48
-
49
- }
50
-
51
- async getProfilePicture(directoryId: string): Promise<any> {
52
-
53
- if (!directoryId) {
54
- throw new Error("Directory ID is required.")
55
- }
56
-
57
- const url = `${this.baseUrl}identities/profile?directoryId=${directoryId}&typeOfDirectoryId=USER`;
58
- // const operationName = "getUserInfoByIds";
59
-
60
- return await this.httpRequest.get<any>(url);
61
-
62
- }
63
-
64
- async privateUploadDocument(directoryId: string, document: UploadDocumentRequest): Promise<any> {
65
- if (!directoryId) {
66
- throw new Error("Directory ID is required.")
67
- }
68
- const url = `${this.baseUrl}/documents/${directoryId}/upload`;
69
- return await this.httpRequest.post(url, document);
70
- }
71
-
72
- async getPeopleByFullName(fullName: string): Promise<any> {
73
- if (!fullName) {
74
- throw new Error("Full name is required.")
75
- }
76
- const url = `${this.baseUrl}identities/people/search?fullName=${fullName}`;
77
- return await this.httpRequest.get(url);
78
- }
1
+ import {inject, injectable} from "inversify";
2
+ import {IIdentityApi} from "./interfaces/IIdentityApi";
3
+ import {IHttpRequest} from "@fiado/http-client";
4
+ import dotenv from 'dotenv';
5
+ import {PeopleUpdateRequest, UploadDocumentRequest} from "@fiado/type-kit/bin/identity";
6
+
7
+ dotenv.config();
8
+
9
+ @injectable()
10
+ export class IdentityApi implements IIdentityApi {
11
+
12
+ private readonly baseUrl = process.env.IDENTITY_LAMBDA_URL || "";
13
+
14
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
15
+ }
16
+
17
+ async getPeopleByIds(ids: string[]): Promise<any> {
18
+
19
+ if (ids.length === 0) {
20
+ throw new Error("At least one people ID is required.")
21
+ }
22
+
23
+ const url = `${this.baseUrl}identities/people?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
24
+ return await this.httpRequest.get(`${url}`);
25
+ }
26
+
27
+ async getPeopleByCurp(curp: string): Promise<any> {
28
+
29
+ if (!curp) {
30
+ throw new Error("CURP is required.")
31
+ }
32
+
33
+ const operationName = "getPeopleByCurp";
34
+
35
+ const url = `${this.baseUrl}?curp=${curp}`;
36
+
37
+ return await this.httpRequest.post(`${url}`, null, {'operationName': operationName});
38
+ }
39
+
40
+ async updatePeopleById(id: string, data: PeopleUpdateRequest): Promise<void> {
41
+
42
+ if (!id) {
43
+ throw new Error("People ID is required.")
44
+ }
45
+
46
+ const url = `${this.baseUrl}identities/people/${id}`;
47
+ await this.httpRequest.put<void>(url, data);
48
+
49
+ }
50
+
51
+ async getProfilePicture(directoryId: string): Promise<any> {
52
+
53
+ if (!directoryId) {
54
+ throw new Error("Directory ID is required.")
55
+ }
56
+
57
+ const url = `${this.baseUrl}identities/profile?directoryId=${directoryId}&typeOfDirectoryId=USER`;
58
+ // const operationName = "getUserInfoByIds";
59
+
60
+ return await this.httpRequest.get<any>(url);
61
+
62
+ }
63
+
64
+ async privateUploadDocument(directoryId: string, document: UploadDocumentRequest): Promise<any> {
65
+ if (!directoryId) {
66
+ throw new Error("Directory ID is required.")
67
+ }
68
+ const url = `${this.baseUrl}/documents/${directoryId}/upload`;
69
+ return await this.httpRequest.post(url, document);
70
+ }
71
+
72
+ async getPeopleByFullName(fullName: string): Promise<any> {
73
+ if (!fullName) {
74
+ throw new Error("Full name is required.")
75
+ }
76
+ const url = `${this.baseUrl}identities/people/search?fullName=${fullName}`;
77
+ return await this.httpRequest.get(url);
78
+ }
79
79
  }
@@ -1,4 +1,4 @@
1
-
2
-
3
- export * from './interfaces/IIdentityApi';
1
+
2
+
3
+ export * from './interfaces/IIdentityApi';
4
4
  export * from './IdentityApi';