@fiado/api-invoker 1.1.61 → 1.1.62
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.
- package/README.md +64 -64
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/bin/pomeloProcessor/api/PomeloProcessorApi.d.ts +8 -0
- package/bin/pomeloProcessor/api/PomeloProcessorApi.js +32 -0
- package/bin/pomeloProcessor/api/interfaces/IPomeloProcessorApi.d.ts +3 -0
- package/bin/pomeloProcessor/api/interfaces/IPomeloProcessorApi.js +2 -0
- package/bin/pomeloProcessor/index.d.ts +2 -0
- package/bin/pomeloProcessor/index.js +18 -0
- package/package.json +28 -28
- package/src/account-beneficiary/AccountBeneficiaryApi.ts +18 -18
- package/src/account-beneficiary/index.ts +2 -2
- package/src/account-beneficiary/interfaces/IAccountBeneficiaryApi.ts +7 -7
- package/src/account-fiadoinc/AccountFiadoIncApi.ts +65 -65
- package/src/account-fiadoinc/index.ts +1 -1
- package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +32 -32
- package/src/account-fiadosa/AccountFiadoSAApi.ts +32 -32
- package/src/account-fiadosa/index.ts +1 -1
- package/src/account-fiadosa/interfaces/IAccountFiadoSAApi.ts +13 -13
- package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +46 -46
- package/src/account-pagoconfiado/index.ts +2 -2
- package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +24 -24
- package/src/activity-business/ActivityApi.ts +34 -34
- package/src/activity-business/index.ts +5 -5
- package/src/activity-business/interfaces/IActivityApi.ts +9 -9
- package/src/activity-business/queue/ActivityPublisher.ts +28 -28
- package/src/activity-business/queue/IActivityPublisher.ts +4 -4
- package/src/address/AddressApi.ts +46 -46
- package/src/address/index.ts +3 -3
- package/src/address/interfaces/IAddressApi.ts +30 -30
- package/src/authentication/AuthenticationApi.ts +16 -16
- package/src/authentication/index.ts +4 -4
- package/src/authentication/interfaces/IAuthenticationApi.ts +5 -5
- package/src/bankAccount/BankAccountApi.ts +48 -48
- package/src/bankAccount/index.ts +1 -1
- package/src/bankAccount/interfaces/IBankAccountApi.ts +6 -6
- package/src/bbvaRst/api/BBVARstApi.ts +16 -16
- package/src/bbvaRst/api/interfaces/IBBVARstApi.ts +4 -4
- package/src/bbvaRst/index.ts +1 -1
- package/src/card/CardApi.ts +36 -36
- package/src/card/index.ts +3 -3
- package/src/card/interfaces/ICardApi.ts +10 -10
- package/src/cnbv-business/CnbvApi.ts +22 -22
- package/src/cnbv-business/index.ts +4 -4
- package/src/cnbv-business/interfaces/ICnbvApi.ts +6 -6
- package/src/collector/CollectorApi.ts +25 -25
- package/src/collector/index.ts +2 -2
- package/src/collector/interfaces/ICollectorApi.ts +21 -21
- package/src/contactInformation/ContactInformationApi.ts +20 -20
- package/src/contactInformation/index.ts +2 -2
- package/src/contactInformation/interface/IContactInformationApi.ts +8 -8
- package/src/container.config.ts +88 -88
- package/src/contract-generator/ContractGeneratorApi.ts +18 -18
- package/src/contract-generator/index.ts +2 -2
- package/src/contract-generator/interfaces/IContractGeneratorApi.ts +16 -16
- package/src/directory/DirectoryApi.ts +128 -128
- package/src/directory/index.ts +3 -3
- package/src/directory/interfaces/IDirectoryApi.ts +63 -63
- package/src/exchangeRates/ExchangeRatesApi.ts +27 -27
- package/src/exchangeRates/index.ts +1 -1
- package/src/exchangeRates/interfaces/IExchangeRatesApi.ts +8 -8
- package/src/fiadoMessages/api/FiadoMessagesApi.ts +20 -20
- package/src/fiadoMessages/api/interfaces/IFiadoMessagesApi.ts +2 -2
- package/src/fiadoMessages/index.ts +1 -1
- package/src/fraudPreventionEngine/api/FraudPreventionEngineApi.ts +22 -22
- package/src/fraudPreventionEngine/api/interfaces/IFraudPreventionEngineApi.ts +7 -7
- package/src/fraudPreventionEngine/index.ts +1 -1
- package/src/group/GroupApi.ts +24 -24
- package/src/group/index.ts +1 -1
- package/src/group/interfaces/IGroupApi.ts +23 -23
- package/src/identity/IdentityApi.ts +47 -47
- package/src/identity/index.ts +3 -3
- package/src/identity/interfaces/IIdentityApi.ts +33 -33
- package/src/index.ts +32 -31
- package/src/notificationMessages/index.ts +1 -1
- package/src/notificationMessages/queue/NotificationMessagePublisher.ts +22 -22
- package/src/notificationMessages/queue/interfaces/INotificationMessagesPublisher.ts +4 -4
- package/src/p2pContact/api/P2pContactApi.ts +19 -19
- package/src/p2pContact/api/interfaces/IP2pContactApi.ts +4 -4
- package/src/p2pContact/index.ts +1 -1
- package/src/pomelo/api/PomeloApi.ts +99 -99
- package/src/pomelo/api/interfaces/IPomeloApi.ts +27 -27
- package/src/pomelo/index.ts +1 -1
- package/src/pomeloProcessor/api/PomeloProcessorApi.ts +18 -0
- package/src/pomeloProcessor/api/interfaces/IPomeloProcessorApi.ts +3 -0
- package/src/pomeloProcessor/index.ts +2 -0
- package/src/product-catalog/ProductCatalogApi.ts +17 -17
- package/src/product-catalog/index.ts +1 -1
- package/src/product-catalog/interfaces/IProductCatalogApi.ts +6 -6
- package/src/riskProfile/api/RiskProfileApi.ts +29 -29
- package/src/riskProfile/api/interfaces/IRiskProfileApi.ts +10 -10
- package/src/riskProfile/index.ts +4 -4
- package/src/riskProfile/queue/TransactionAlarmPublisher.ts +24 -24
- package/src/riskProfile/queue/interfaces/ITransactionAlarmPublisher.ts +4 -4
- package/src/sessionActivity/index.ts +2 -2
- package/src/sessionActivity/queue/SessionActivityPublisher.ts +22 -22
- package/src/sessionActivity/queue/interfaces/ISessionActivityPublisher.ts +4 -4
- package/src/stpAccount/api/STPAccountApi.ts +111 -111
- package/src/stpAccount/api/interfaces/ISTPAccountApi.ts +7 -7
- package/src/stpAccount/index.ts +1 -1
- package/src/stpServicePayment/api/StpServicePaymentApi.ts +40 -40
- package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +13 -13
- package/src/stpServicePayment/index.ts +1 -1
- package/src/stpSpei/api/StpSpeiApi.ts +32 -32
- package/src/stpSpei/api/interfaces/IStpSpeiApi.ts +6 -6
- package/src/stpSpei/index.ts +1 -1
- package/src/tern/api/TernApi.ts +137 -137
- package/src/tern/api/interfaces/ITernApi.ts +38 -38
- package/src/tern/index.ts +1 -1
- package/src/transaction/index.ts +2 -2
- package/src/transaction/queue/TransactionPublisher.ts +24 -24
- package/src/transaction/queue/interfaces/ITransactionPublisher.ts +4 -4
- package/src/transactionProcessor/api/TransactionProcessorApi.ts +37 -37
- package/src/transactionProcessor/api/interfaces/ITransactionProcessorApi.ts +15 -15
- package/src/transactionProcessor/index.ts +1 -1
- package/tsconfig.json +21 -21
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './interfaces/IContractGeneratorApi';
|
|
1
|
+
|
|
2
|
+
export * from './interfaces/IContractGeneratorApi';
|
|
3
3
|
export * from './ContractGeneratorApi';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ContractCreateRequest } from "@fiado/type-kit/bin/contract";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Interfaz para el servicio Contract Generator.
|
|
5
|
-
*/
|
|
6
|
-
export interface IContractGeneratorApi {
|
|
7
|
-
/**
|
|
8
|
-
* Obtiene una lista de people por sus IDs.
|
|
9
|
-
* @param ids Array de IDs de peopleId (UUIDs) a buscar.
|
|
10
|
-
* @returns Una promesa que resuelve a un arreglo de objetos de people.
|
|
11
|
-
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
12
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
13
|
-
*/
|
|
14
|
-
generate(params:ContractCreateRequest): Promise<any>;
|
|
15
|
-
|
|
16
|
-
}
|
|
1
|
+
import { ContractCreateRequest } from "@fiado/type-kit/bin/contract";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interfaz para el servicio Contract Generator.
|
|
5
|
+
*/
|
|
6
|
+
export interface IContractGeneratorApi {
|
|
7
|
+
/**
|
|
8
|
+
* Obtiene una lista de people por sus IDs.
|
|
9
|
+
* @param ids Array de IDs de peopleId (UUIDs) a buscar.
|
|
10
|
+
* @returns Una promesa que resuelve a un arreglo de objetos de people.
|
|
11
|
+
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
12
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
13
|
+
*/
|
|
14
|
+
generate(params:ContractCreateRequest): Promise<any>;
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
import dotenv from 'dotenv';
|
|
2
|
-
import { inject, injectable } from "inversify";
|
|
3
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
-
import { IDirectoryApi } from "./interfaces/IDirectoryApi";
|
|
5
|
-
import { Provider } from '@fiado/type-kit/bin/provider';
|
|
6
|
-
import { Profile } from '@fiado/type-kit/bin/directory/enums/Profile';
|
|
7
|
-
import { Status } from '@fiado/type-kit/bin/directory/enums/Status';
|
|
8
|
-
dotenv.config();
|
|
9
|
-
|
|
10
|
-
@injectable()
|
|
11
|
-
export class DirectoryApi implements IDirectoryApi {
|
|
12
|
-
|
|
13
|
-
private readonly baseUrl = process.env.DIRECTORY_LAMBDA_URL || "";
|
|
14
|
-
|
|
15
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
public async getByIds(ids: string[]): Promise<any> {
|
|
19
|
-
|
|
20
|
-
if (ids.length === 0) {
|
|
21
|
-
throw new Error("At least one directory ID is required.")
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const url = `${this.baseUrl}?${ids.map(id => `directoryId=${encodeURIComponent(id)}`).join('&')}`;
|
|
25
|
-
const operationName = "getUserInfoByIds";
|
|
26
|
-
|
|
27
|
-
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public async updateExternalUserId(directoryId: string, provider: Provider, externalUserId: string): Promise<void> {
|
|
31
|
-
|
|
32
|
-
const url = `${this.baseUrl}`;
|
|
33
|
-
const operationName = "updateExternalUser";
|
|
34
|
-
|
|
35
|
-
const body = {
|
|
36
|
-
directoryId: directoryId,
|
|
37
|
-
typeOfDirectoryId: "USER",
|
|
38
|
-
provider: provider,
|
|
39
|
-
user: externalUserId
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public async updateScope(directoryId: string, scope: string[]): Promise<void> {
|
|
46
|
-
|
|
47
|
-
const url = `${this.baseUrl}`;
|
|
48
|
-
const operationName = "updateScope";
|
|
49
|
-
|
|
50
|
-
const body = {
|
|
51
|
-
directoryId: directoryId,
|
|
52
|
-
typeOfDirectoryId: "USER",
|
|
53
|
-
scope: scope
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
public async getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any> {
|
|
60
|
-
|
|
61
|
-
const url = `${this.baseUrl}?ownerDirectoryId=${ownerDirectoryId}`;
|
|
62
|
-
const operationName = "getByOwnerDirectoryId";
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
public async getByPhoneNumber(phoneNumber: string): Promise<any> {
|
|
69
|
-
|
|
70
|
-
const url = `${this.baseUrl}?phoneNumber=${phoneNumber}`;
|
|
71
|
-
const operationName = "getUserInfoByParams";
|
|
72
|
-
|
|
73
|
-
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
public async addOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any> {
|
|
77
|
-
|
|
78
|
-
const url = `${this.baseUrl}`;
|
|
79
|
-
const operationName = "addOwnerDirectoryId";
|
|
80
|
-
|
|
81
|
-
const data = {
|
|
82
|
-
directoryId: directoryId,
|
|
83
|
-
ownerDirectoryId: newOwnerDirectoryId
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return await this.httpRequest.post(`${url}`, data, { 'operationName': operationName });
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
public async updateOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any> {
|
|
90
|
-
|
|
91
|
-
const url = `${this.baseUrl}`;
|
|
92
|
-
const operationName = "updateOwnerDirectoryId";
|
|
93
|
-
|
|
94
|
-
const data = {
|
|
95
|
-
directoryId: directoryId,
|
|
96
|
-
ownerDirectoryId: newOwnerDirectoryId
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return await this.httpRequest.post(`${url}`, data, { 'operationName': operationName });
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
public async updateUserProfile(directoryId: string, profile: Profile): Promise<void> {
|
|
103
|
-
|
|
104
|
-
const url = `${this.baseUrl}`;
|
|
105
|
-
const operationName = "updateUserProfile";
|
|
106
|
-
|
|
107
|
-
const body = {
|
|
108
|
-
directoryId: directoryId,
|
|
109
|
-
typeOfDirectoryId: "USER",
|
|
110
|
-
profile: profile
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
public async updateStatus(directoryId: string, status: Status): Promise<void> {
|
|
117
|
-
|
|
118
|
-
const url = `${this.baseUrl}`;
|
|
119
|
-
const operationName = "updateStatus";
|
|
120
|
-
|
|
121
|
-
const body = {
|
|
122
|
-
directoryId: directoryId,
|
|
123
|
-
status: status
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
|
|
127
|
-
}
|
|
128
|
-
}
|
|
1
|
+
import dotenv from 'dotenv';
|
|
2
|
+
import { inject, injectable } from "inversify";
|
|
3
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
+
import { IDirectoryApi } from "./interfaces/IDirectoryApi";
|
|
5
|
+
import { Provider } from '@fiado/type-kit/bin/provider';
|
|
6
|
+
import { Profile } from '@fiado/type-kit/bin/directory/enums/Profile';
|
|
7
|
+
import { Status } from '@fiado/type-kit/bin/directory/enums/Status';
|
|
8
|
+
dotenv.config();
|
|
9
|
+
|
|
10
|
+
@injectable()
|
|
11
|
+
export class DirectoryApi implements IDirectoryApi {
|
|
12
|
+
|
|
13
|
+
private readonly baseUrl = process.env.DIRECTORY_LAMBDA_URL || "";
|
|
14
|
+
|
|
15
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public async getByIds(ids: string[]): Promise<any> {
|
|
19
|
+
|
|
20
|
+
if (ids.length === 0) {
|
|
21
|
+
throw new Error("At least one directory ID is required.")
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const url = `${this.baseUrl}?${ids.map(id => `directoryId=${encodeURIComponent(id)}`).join('&')}`;
|
|
25
|
+
const operationName = "getUserInfoByIds";
|
|
26
|
+
|
|
27
|
+
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public async updateExternalUserId(directoryId: string, provider: Provider, externalUserId: string): Promise<void> {
|
|
31
|
+
|
|
32
|
+
const url = `${this.baseUrl}`;
|
|
33
|
+
const operationName = "updateExternalUser";
|
|
34
|
+
|
|
35
|
+
const body = {
|
|
36
|
+
directoryId: directoryId,
|
|
37
|
+
typeOfDirectoryId: "USER",
|
|
38
|
+
provider: provider,
|
|
39
|
+
user: externalUserId
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public async updateScope(directoryId: string, scope: string[]): Promise<void> {
|
|
46
|
+
|
|
47
|
+
const url = `${this.baseUrl}`;
|
|
48
|
+
const operationName = "updateScope";
|
|
49
|
+
|
|
50
|
+
const body = {
|
|
51
|
+
directoryId: directoryId,
|
|
52
|
+
typeOfDirectoryId: "USER",
|
|
53
|
+
scope: scope
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public async getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any> {
|
|
60
|
+
|
|
61
|
+
const url = `${this.baseUrl}?ownerDirectoryId=${ownerDirectoryId}`;
|
|
62
|
+
const operationName = "getByOwnerDirectoryId";
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public async getByPhoneNumber(phoneNumber: string): Promise<any> {
|
|
69
|
+
|
|
70
|
+
const url = `${this.baseUrl}?phoneNumber=${phoneNumber}`;
|
|
71
|
+
const operationName = "getUserInfoByParams";
|
|
72
|
+
|
|
73
|
+
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public async addOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any> {
|
|
77
|
+
|
|
78
|
+
const url = `${this.baseUrl}`;
|
|
79
|
+
const operationName = "addOwnerDirectoryId";
|
|
80
|
+
|
|
81
|
+
const data = {
|
|
82
|
+
directoryId: directoryId,
|
|
83
|
+
ownerDirectoryId: newOwnerDirectoryId
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return await this.httpRequest.post(`${url}`, data, { 'operationName': operationName });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public async updateOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any> {
|
|
90
|
+
|
|
91
|
+
const url = `${this.baseUrl}`;
|
|
92
|
+
const operationName = "updateOwnerDirectoryId";
|
|
93
|
+
|
|
94
|
+
const data = {
|
|
95
|
+
directoryId: directoryId,
|
|
96
|
+
ownerDirectoryId: newOwnerDirectoryId
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return await this.httpRequest.post(`${url}`, data, { 'operationName': operationName });
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
public async updateUserProfile(directoryId: string, profile: Profile): Promise<void> {
|
|
103
|
+
|
|
104
|
+
const url = `${this.baseUrl}`;
|
|
105
|
+
const operationName = "updateUserProfile";
|
|
106
|
+
|
|
107
|
+
const body = {
|
|
108
|
+
directoryId: directoryId,
|
|
109
|
+
typeOfDirectoryId: "USER",
|
|
110
|
+
profile: profile
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
public async updateStatus(directoryId: string, status: Status): Promise<void> {
|
|
117
|
+
|
|
118
|
+
const url = `${this.baseUrl}`;
|
|
119
|
+
const operationName = "updateStatus";
|
|
120
|
+
|
|
121
|
+
const body = {
|
|
122
|
+
directoryId: directoryId,
|
|
123
|
+
status: status
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
|
|
127
|
+
}
|
|
128
|
+
}
|
package/src/directory/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './interfaces/IDirectoryApi';
|
|
3
|
-
export * from './DirectoryApi';
|
|
1
|
+
|
|
2
|
+
export * from './interfaces/IDirectoryApi';
|
|
3
|
+
export * from './DirectoryApi';
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { Profile } from "@fiado/type-kit/bin/directory/enums/Profile";
|
|
2
|
-
import { Status } from "@fiado/type-kit/bin/directory/enums/Status";
|
|
3
|
-
import { Provider } from "@fiado/type-kit/bin/provider";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
7
|
-
*/
|
|
8
|
-
export interface IDirectoryApi {
|
|
9
|
-
/**
|
|
10
|
-
* Obtiene una lista de directorios por sus IDs.
|
|
11
|
-
* @param ids Array de IDs de directorios (UUIDs) a buscar.
|
|
12
|
-
* @returns Una promesa que resuelve a un arreglo de objetos de directorio.
|
|
13
|
-
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
14
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
15
|
-
*/
|
|
16
|
-
getByIds(ids: string[]): Promise<any>;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Actualiza el ID de usuario externo en un directorio.
|
|
20
|
-
* @param directoryId ID del directorio (UUID) a actualizar.
|
|
21
|
-
* @param provider Proveedor de autenticación del usuario.
|
|
22
|
-
* @param externalUserId ID de usuario externo.
|
|
23
|
-
* @returns Una promesa que resuelve a un objeto vacío.
|
|
24
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
updateExternalUserId(directoryId: string, provider: Provider, externalUserId: string): Promise<void>;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Actualiza el alcance de un directorio.
|
|
31
|
-
* @param directoryId ID del directorio (UUID) a actualizar.
|
|
32
|
-
* @param scope Alcance a actualizar.
|
|
33
|
-
* @returns Una promesa que resuelve a un objeto vacío.
|
|
34
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
35
|
-
*/
|
|
36
|
-
updateScope(directoryId: string, scope: string[]): Promise<void>;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Obtiene un directorio por su ID de directorio propietario.
|
|
40
|
-
* @param ownerDirectoryId ID de directorio propietario (UUID) a buscar.
|
|
41
|
-
* @returns Una promesa que resuelve a un objeto de directorio.
|
|
42
|
-
* Puede devolver un objeto vacío si no se encuentra coincidencia.
|
|
43
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
44
|
-
*/
|
|
45
|
-
getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any>
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Obtiene un directorio por su número de teléfono.
|
|
49
|
-
* @param phoneNumber Número de teléfono a buscar.
|
|
50
|
-
* @returns Una promesa que resuelve a un objeto de directorio.
|
|
51
|
-
* Puede devolver un objeto vacío si no se encuentra coincidencia.
|
|
52
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
53
|
-
*/
|
|
54
|
-
getByPhoneNumber(phoneNumber: string): Promise<any>
|
|
55
|
-
|
|
56
|
-
addOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any>
|
|
57
|
-
|
|
58
|
-
updateUserProfile(directoryId: string, profile: Profile): Promise<void>
|
|
59
|
-
|
|
60
|
-
updateOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any>
|
|
61
|
-
|
|
62
|
-
updateStatus(directoryId: string, status: Status): Promise<void>
|
|
63
|
-
}
|
|
1
|
+
import { Profile } from "@fiado/type-kit/bin/directory/enums/Profile";
|
|
2
|
+
import { Status } from "@fiado/type-kit/bin/directory/enums/Status";
|
|
3
|
+
import { Provider } from "@fiado/type-kit/bin/provider";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
7
|
+
*/
|
|
8
|
+
export interface IDirectoryApi {
|
|
9
|
+
/**
|
|
10
|
+
* Obtiene una lista de directorios por sus IDs.
|
|
11
|
+
* @param ids Array de IDs de directorios (UUIDs) a buscar.
|
|
12
|
+
* @returns Una promesa que resuelve a un arreglo de objetos de directorio.
|
|
13
|
+
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
14
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
15
|
+
*/
|
|
16
|
+
getByIds(ids: string[]): Promise<any>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Actualiza el ID de usuario externo en un directorio.
|
|
20
|
+
* @param directoryId ID del directorio (UUID) a actualizar.
|
|
21
|
+
* @param provider Proveedor de autenticación del usuario.
|
|
22
|
+
* @param externalUserId ID de usuario externo.
|
|
23
|
+
* @returns Una promesa que resuelve a un objeto vacío.
|
|
24
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
updateExternalUserId(directoryId: string, provider: Provider, externalUserId: string): Promise<void>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Actualiza el alcance de un directorio.
|
|
31
|
+
* @param directoryId ID del directorio (UUID) a actualizar.
|
|
32
|
+
* @param scope Alcance a actualizar.
|
|
33
|
+
* @returns Una promesa que resuelve a un objeto vacío.
|
|
34
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
35
|
+
*/
|
|
36
|
+
updateScope(directoryId: string, scope: string[]): Promise<void>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Obtiene un directorio por su ID de directorio propietario.
|
|
40
|
+
* @param ownerDirectoryId ID de directorio propietario (UUID) a buscar.
|
|
41
|
+
* @returns Una promesa que resuelve a un objeto de directorio.
|
|
42
|
+
* Puede devolver un objeto vacío si no se encuentra coincidencia.
|
|
43
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
44
|
+
*/
|
|
45
|
+
getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any>
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Obtiene un directorio por su número de teléfono.
|
|
49
|
+
* @param phoneNumber Número de teléfono a buscar.
|
|
50
|
+
* @returns Una promesa que resuelve a un objeto de directorio.
|
|
51
|
+
* Puede devolver un objeto vacío si no se encuentra coincidencia.
|
|
52
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
53
|
+
*/
|
|
54
|
+
getByPhoneNumber(phoneNumber: string): Promise<any>
|
|
55
|
+
|
|
56
|
+
addOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any>
|
|
57
|
+
|
|
58
|
+
updateUserProfile(directoryId: string, profile: Profile): Promise<void>
|
|
59
|
+
|
|
60
|
+
updateOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any>
|
|
61
|
+
|
|
62
|
+
updateStatus(directoryId: string, status: Status): Promise<void>
|
|
63
|
+
}
|
|
@@ -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';
|