@fiado/api-invoker 1.1.6 → 1.1.8
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/exchangeRates/ExchangeRatesApi.d.ts +2 -0
- package/bin/exchangeRates/ExchangeRatesApi.js +6 -0
- package/bin/exchangeRates/interfaces/IExchangeRatesApi.d.ts +2 -0
- package/bin/group/GroupApi.d.ts +1 -0
- package/bin/group/GroupApi.js +4 -0
- package/bin/group/interfaces/IGroupApi.d.ts +6 -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 +60 -60
- package/src/account-fiadoinc/index.ts +1 -1
- package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +29 -29
- package/src/account-fiadosa/AccountFiadoSAApi.ts +22 -22
- package/src/account-fiadosa/index.ts +1 -1
- package/src/account-fiadosa/interfaces/IAccountFiadoSAApi.ts +9 -9
- package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +27 -27
- package/src/account-pagoconfiado/index.ts +2 -2
- package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +8 -8
- 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 +37 -37
- package/src/bankAccount/index.ts +1 -1
- package/src/bankAccount/interfaces/IBankAccountApi.ts +4 -4
- 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 +33 -33
- package/src/card/index.ts +3 -3
- package/src/card/interfaces/ICardApi.ts +10 -10
- package/src/collector/CollectorApi.ts +21 -21
- package/src/collector/index.ts +2 -2
- package/src/collector/interfaces/ICollectorApi.ts +19 -19
- package/src/container.config.ts +70 -70
- 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 +115 -115
- package/src/directory/index.ts +3 -3
- package/src/directory/interfaces/IDirectoryApi.ts +66 -66
- package/src/exchangeRates/ExchangeRatesApi.ts +27 -18
- package/src/exchangeRates/index.ts +1 -1
- package/src/exchangeRates/interfaces/IExchangeRatesApi.ts +8 -5
- 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 -18
- package/src/group/index.ts +1 -1
- package/src/group/interfaces/IGroupApi.ts +23 -15
- 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 +25 -25
- 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/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/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 +102 -102
- package/src/stpAccount/api/interfaces/ISTPAccountApi.ts +6 -6
- package/src/stpAccount/index.ts +1 -1
- package/src/stpServicePayment/api/StpServicePaymentApi.ts +35 -35
- package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +11 -11
- package/src/stpServicePayment/index.ts +1 -1
- package/src/stpSpei/api/StpSpeiApi.ts +20 -20
- package/src/stpSpei/api/interfaces/IStpSpeiApi.ts +4 -4
- package/src/stpSpei/index.ts +1 -1
- package/src/tern/api/TernApi.ts +96 -96
- package/src/tern/api/interfaces/ITernApi.ts +29 -29
- 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/tsconfig.json +21 -21
- package/bin/activity/ActivityApi.d.ts +0 -17
- package/bin/activity/ActivityApi.js +0 -72
- package/bin/activity/index.d.ts +0 -2
- package/bin/activity/index.js +0 -18
- package/bin/activity/interfaces/IActivityApi.d.ts +0 -39
- package/bin/activity/interfaces/IActivityApi.js +0 -2
package/src/container.config.ts
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import {ContainerModule, interfaces} from "inversify";
|
|
2
|
-
import {DirectoryApi, IDirectoryApi} from "./directory";
|
|
3
|
-
import {IdentityApi, IIdentityApi} from "./identity";
|
|
4
|
-
import {INotificationMessagesPublisher} from "./notificationMessages";
|
|
5
|
-
import NotificationMessagePublisher from "./notificationMessages/queue/NotificationMessagePublisher";
|
|
6
|
-
import {ITernApi} from "./tern";
|
|
7
|
-
import TernApi from "./tern/api/TernApi";
|
|
8
|
-
import {IPomeloApi} from "./pomelo";
|
|
9
|
-
import PomeloApi from "./pomelo/api/PomeloApi";
|
|
10
|
-
import {AddressApi, IAddressApi} from "./address";
|
|
11
|
-
import {IAccountFiadoIncApi} from "./account-fiadoinc";
|
|
12
|
-
import AccountFiadoIncApi from "./account-fiadoinc/AccountFiadoIncApi";
|
|
13
|
-
import {IAccountPagoConfiadoApi} from "./account-pagoconfiado";
|
|
14
|
-
import AccountPagoConfiadoApi from "./account-pagoconfiado/AccountPagoConfiadoApi";
|
|
15
|
-
import {IAccountFiadoSAApi} from "./account-fiadosa";
|
|
16
|
-
import AccountFiadoSAApi from "./account-fiadosa/AccountFiadoSAApi";
|
|
17
|
-
import {ISTPAccountApi} from "./stpAccount";
|
|
18
|
-
import STPAccountApi from "./stpAccount/api/STPAccountApi";
|
|
19
|
-
import {ISessionActivityPublisher, SessionActivityPublisher} from "./sessionActivity";
|
|
20
|
-
import {IExchangeRatesApi} from "./exchangeRates";
|
|
21
|
-
import ExchangeRatesApi from "./exchangeRates/ExchangeRatesApi";
|
|
22
|
-
import {AuthenticationApi, IAuthenticationApi} from "./authentication";
|
|
23
|
-
import {CardApi, ICardApi} from "./card";
|
|
24
|
-
import {ITransactionPublisher, TransactionPublisher} from "./transaction";
|
|
25
|
-
import {ContractGeneratorApi, IContractGeneratorApi} from "./contract-generator";
|
|
26
|
-
import {IProductCatalogApi} from "./product-catalog";
|
|
27
|
-
import ProductCatalogApi from "./product-catalog/ProductCatalogApi";
|
|
28
|
-
import {CollectorApi, ICollectorApi} from "./collector";
|
|
29
|
-
import {IP2pContactApi} from "./p2pContact";
|
|
30
|
-
import P2pContactApi from "./p2pContact/api/P2pContactApi";
|
|
31
|
-
import {IBankAccountApi} from "./bankAccount";
|
|
32
|
-
import BankAccountApi from "./bankAccount/BankAccountApi";
|
|
33
|
-
import {AccountBeneficiaryApi, IAccountBeneficiaryApi} from "./account-beneficiary";
|
|
34
|
-
import {IStpSpeiApi, StpSpeiApi} from "./stpSpei";
|
|
35
|
-
import StpServicePaymentApi from "./stpServicePayment/api/StpServicePaymentApi";
|
|
36
|
-
import {IStpServicePaymentApi} from "./stpServicePayment";
|
|
37
|
-
import {BBVARstApi, IBBVARstApi} from "./bbvaRst";
|
|
38
|
-
import FraudPreventionEngineApi from "./fraudPreventionEngine/api/FraudPreventionEngineApi";
|
|
39
|
-
import {IFraudPreventionEngineApi} from "./fraudPreventionEngine";
|
|
40
|
-
import {IGroupApi,GroupApi} from "./group";
|
|
41
|
-
|
|
42
|
-
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
43
|
-
bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
|
|
44
|
-
bind<IIdentityApi>("IIdentityApi").to(IdentityApi);
|
|
45
|
-
bind<IAddressApi>("IAddressApi").to(AddressApi);
|
|
46
|
-
bind<IExchangeRatesApi>("IExchangeRatesApi").to(ExchangeRatesApi);
|
|
47
|
-
bind<ITernApi>("ITernApi").to(TernApi);
|
|
48
|
-
bind<IPomeloApi>("IPomeloApi").to(PomeloApi);
|
|
49
|
-
bind<ISTPAccountApi>("ISTPAccountApi").to(STPAccountApi);
|
|
50
|
-
bind<IAccountFiadoIncApi>("IAccountFiadoIncApi").to(AccountFiadoIncApi);
|
|
51
|
-
bind<IAccountPagoConfiadoApi>("IAccountPagoConfiadoApi").to(AccountPagoConfiadoApi);
|
|
52
|
-
bind<IAccountFiadoSAApi>("IAccountFiadoSAApi").to(AccountFiadoSAApi);
|
|
53
|
-
bind<INotificationMessagesPublisher>("INotificationMessagesPublisher").to(NotificationMessagePublisher);
|
|
54
|
-
bind<ISessionActivityPublisher>("ISessionActivityPublisher").to(SessionActivityPublisher);
|
|
55
|
-
bind<ITransactionPublisher>("ITransactionPublisher").to(TransactionPublisher);
|
|
56
|
-
bind<IAuthenticationApi>("IAuthenticationApi").to(AuthenticationApi);
|
|
57
|
-
bind<ICardApi>("ICardApi").to(CardApi);
|
|
58
|
-
bind<IContractGeneratorApi>("IContractGeneratorApi").to(ContractGeneratorApi);
|
|
59
|
-
bind<ICollectorApi>("ICollectorApi").to(CollectorApi);
|
|
60
|
-
bind<IProductCatalogApi>("IProductCatalogApi").to(ProductCatalogApi);
|
|
61
|
-
bind<IP2pContactApi>("IP2pContactApi").to(P2pContactApi);
|
|
62
|
-
bind<IBankAccountApi>("IBankAccountApi").to(BankAccountApi);
|
|
63
|
-
bind<IAccountBeneficiaryApi>("IAccountBeneficiaryApi").to(AccountBeneficiaryApi);
|
|
64
|
-
bind<IStpSpeiApi>("IStpSpeiApi").to(StpSpeiApi);
|
|
65
|
-
bind<IStpServicePaymentApi>("IStpServicePaymentApi").to(StpServicePaymentApi);
|
|
66
|
-
bind<IBBVARstApi>("IBBVARstApi").to(BBVARstApi);
|
|
67
|
-
bind<IFraudPreventionEngineApi>("IFraudPreventionEngineApi").to(FraudPreventionEngineApi);
|
|
68
|
-
bind<IGroupApi>("IGroupApi").to(GroupApi);
|
|
69
|
-
|
|
70
|
-
});
|
|
1
|
+
import {ContainerModule, interfaces} from "inversify";
|
|
2
|
+
import {DirectoryApi, IDirectoryApi} from "./directory";
|
|
3
|
+
import {IdentityApi, IIdentityApi} from "./identity";
|
|
4
|
+
import {INotificationMessagesPublisher} from "./notificationMessages";
|
|
5
|
+
import NotificationMessagePublisher from "./notificationMessages/queue/NotificationMessagePublisher";
|
|
6
|
+
import {ITernApi} from "./tern";
|
|
7
|
+
import TernApi from "./tern/api/TernApi";
|
|
8
|
+
import {IPomeloApi} from "./pomelo";
|
|
9
|
+
import PomeloApi from "./pomelo/api/PomeloApi";
|
|
10
|
+
import {AddressApi, IAddressApi} from "./address";
|
|
11
|
+
import {IAccountFiadoIncApi} from "./account-fiadoinc";
|
|
12
|
+
import AccountFiadoIncApi from "./account-fiadoinc/AccountFiadoIncApi";
|
|
13
|
+
import {IAccountPagoConfiadoApi} from "./account-pagoconfiado";
|
|
14
|
+
import AccountPagoConfiadoApi from "./account-pagoconfiado/AccountPagoConfiadoApi";
|
|
15
|
+
import {IAccountFiadoSAApi} from "./account-fiadosa";
|
|
16
|
+
import AccountFiadoSAApi from "./account-fiadosa/AccountFiadoSAApi";
|
|
17
|
+
import {ISTPAccountApi} from "./stpAccount";
|
|
18
|
+
import STPAccountApi from "./stpAccount/api/STPAccountApi";
|
|
19
|
+
import {ISessionActivityPublisher, SessionActivityPublisher} from "./sessionActivity";
|
|
20
|
+
import {IExchangeRatesApi} from "./exchangeRates";
|
|
21
|
+
import ExchangeRatesApi from "./exchangeRates/ExchangeRatesApi";
|
|
22
|
+
import {AuthenticationApi, IAuthenticationApi} from "./authentication";
|
|
23
|
+
import {CardApi, ICardApi} from "./card";
|
|
24
|
+
import {ITransactionPublisher, TransactionPublisher} from "./transaction";
|
|
25
|
+
import {ContractGeneratorApi, IContractGeneratorApi} from "./contract-generator";
|
|
26
|
+
import {IProductCatalogApi} from "./product-catalog";
|
|
27
|
+
import ProductCatalogApi from "./product-catalog/ProductCatalogApi";
|
|
28
|
+
import {CollectorApi, ICollectorApi} from "./collector";
|
|
29
|
+
import {IP2pContactApi} from "./p2pContact";
|
|
30
|
+
import P2pContactApi from "./p2pContact/api/P2pContactApi";
|
|
31
|
+
import {IBankAccountApi} from "./bankAccount";
|
|
32
|
+
import BankAccountApi from "./bankAccount/BankAccountApi";
|
|
33
|
+
import {AccountBeneficiaryApi, IAccountBeneficiaryApi} from "./account-beneficiary";
|
|
34
|
+
import {IStpSpeiApi, StpSpeiApi} from "./stpSpei";
|
|
35
|
+
import StpServicePaymentApi from "./stpServicePayment/api/StpServicePaymentApi";
|
|
36
|
+
import {IStpServicePaymentApi} from "./stpServicePayment";
|
|
37
|
+
import {BBVARstApi, IBBVARstApi} from "./bbvaRst";
|
|
38
|
+
import FraudPreventionEngineApi from "./fraudPreventionEngine/api/FraudPreventionEngineApi";
|
|
39
|
+
import {IFraudPreventionEngineApi} from "./fraudPreventionEngine";
|
|
40
|
+
import {IGroupApi,GroupApi} from "./group";
|
|
41
|
+
|
|
42
|
+
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
43
|
+
bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
|
|
44
|
+
bind<IIdentityApi>("IIdentityApi").to(IdentityApi);
|
|
45
|
+
bind<IAddressApi>("IAddressApi").to(AddressApi);
|
|
46
|
+
bind<IExchangeRatesApi>("IExchangeRatesApi").to(ExchangeRatesApi);
|
|
47
|
+
bind<ITernApi>("ITernApi").to(TernApi);
|
|
48
|
+
bind<IPomeloApi>("IPomeloApi").to(PomeloApi);
|
|
49
|
+
bind<ISTPAccountApi>("ISTPAccountApi").to(STPAccountApi);
|
|
50
|
+
bind<IAccountFiadoIncApi>("IAccountFiadoIncApi").to(AccountFiadoIncApi);
|
|
51
|
+
bind<IAccountPagoConfiadoApi>("IAccountPagoConfiadoApi").to(AccountPagoConfiadoApi);
|
|
52
|
+
bind<IAccountFiadoSAApi>("IAccountFiadoSAApi").to(AccountFiadoSAApi);
|
|
53
|
+
bind<INotificationMessagesPublisher>("INotificationMessagesPublisher").to(NotificationMessagePublisher);
|
|
54
|
+
bind<ISessionActivityPublisher>("ISessionActivityPublisher").to(SessionActivityPublisher);
|
|
55
|
+
bind<ITransactionPublisher>("ITransactionPublisher").to(TransactionPublisher);
|
|
56
|
+
bind<IAuthenticationApi>("IAuthenticationApi").to(AuthenticationApi);
|
|
57
|
+
bind<ICardApi>("ICardApi").to(CardApi);
|
|
58
|
+
bind<IContractGeneratorApi>("IContractGeneratorApi").to(ContractGeneratorApi);
|
|
59
|
+
bind<ICollectorApi>("ICollectorApi").to(CollectorApi);
|
|
60
|
+
bind<IProductCatalogApi>("IProductCatalogApi").to(ProductCatalogApi);
|
|
61
|
+
bind<IP2pContactApi>("IP2pContactApi").to(P2pContactApi);
|
|
62
|
+
bind<IBankAccountApi>("IBankAccountApi").to(BankAccountApi);
|
|
63
|
+
bind<IAccountBeneficiaryApi>("IAccountBeneficiaryApi").to(AccountBeneficiaryApi);
|
|
64
|
+
bind<IStpSpeiApi>("IStpSpeiApi").to(StpSpeiApi);
|
|
65
|
+
bind<IStpServicePaymentApi>("IStpServicePaymentApi").to(StpServicePaymentApi);
|
|
66
|
+
bind<IBBVARstApi>("IBBVARstApi").to(BBVARstApi);
|
|
67
|
+
bind<IFraudPreventionEngineApi>("IFraudPreventionEngineApi").to(FraudPreventionEngineApi);
|
|
68
|
+
bind<IGroupApi>("IGroupApi").to(GroupApi);
|
|
69
|
+
|
|
70
|
+
});
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { inject, injectable } from "inversify";
|
|
2
|
-
import { IContractGeneratorApi } from "./interfaces/IContractGeneratorApi";
|
|
3
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
-
import dotenv from 'dotenv';
|
|
5
|
-
import { ContractCreateRequest } from "@fiado/type-kit/bin/contract";
|
|
6
|
-
dotenv.config();
|
|
7
|
-
|
|
8
|
-
@injectable()
|
|
9
|
-
export class ContractGeneratorApi implements IContractGeneratorApi {
|
|
10
|
-
|
|
11
|
-
private readonly baseUrl = process.env.CONTRACT_GENERATOR_URL || "";
|
|
12
|
-
|
|
13
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
14
|
-
|
|
15
|
-
async generate(params: ContractCreateRequest): Promise<any> {
|
|
16
|
-
const url = `${this.baseUrl}`;
|
|
17
|
-
return await this.httpRequest.post(`${url}`,params, { 'spring.cloud.function.definition': "generateReport" });
|
|
18
|
-
}
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import { IContractGeneratorApi } from "./interfaces/IContractGeneratorApi";
|
|
3
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
+
import dotenv from 'dotenv';
|
|
5
|
+
import { ContractCreateRequest } from "@fiado/type-kit/bin/contract";
|
|
6
|
+
dotenv.config();
|
|
7
|
+
|
|
8
|
+
@injectable()
|
|
9
|
+
export class ContractGeneratorApi implements IContractGeneratorApi {
|
|
10
|
+
|
|
11
|
+
private readonly baseUrl = process.env.CONTRACT_GENERATOR_URL || "";
|
|
12
|
+
|
|
13
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
14
|
+
|
|
15
|
+
async generate(params: ContractCreateRequest): Promise<any> {
|
|
16
|
+
const url = `${this.baseUrl}`;
|
|
17
|
+
return await this.httpRequest.post(`${url}`,params, { 'spring.cloud.function.definition': "generateReport" });
|
|
18
|
+
}
|
|
19
19
|
}
|
|
@@ -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,115 +1,115 @@
|
|
|
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
|
-
|
|
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
|
-
}
|
|
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
|
+
|
|
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
|
+
}
|
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,66 +1,66 @@
|
|
|
1
|
-
import { Profile } from "@fiado/type-kit/bin/directory/enums/Profile";
|
|
2
|
-
import { Provider } from "@fiado/type-kit/bin/provider";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
6
|
-
*/
|
|
7
|
-
export interface IDirectoryApi {
|
|
8
|
-
/**
|
|
9
|
-
* Obtiene una lista de directorios por sus IDs.
|
|
10
|
-
* @param ids Array de IDs de directorios (UUIDs) a buscar.
|
|
11
|
-
* @returns Una promesa que resuelve a un arreglo de objetos de directorio.
|
|
12
|
-
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
13
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
14
|
-
*/
|
|
15
|
-
getByIds(ids: string[]): Promise<any>;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Actualiza el ID de usuario externo en un directorio.
|
|
19
|
-
* @param directoryId ID del directorio (UUID) a actualizar.
|
|
20
|
-
* @param provider Proveedor de autenticación del usuario.
|
|
21
|
-
* @param externalUserId ID de usuario externo.
|
|
22
|
-
* @returns Una promesa que resuelve a un objeto vacío.
|
|
23
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
updateExternalUserId(directoryId: string, provider: Provider, externalUserId: string): Promise<void>;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Actualiza el alcance de un directorio.
|
|
30
|
-
* @param directoryId ID del directorio (UUID) a actualizar.
|
|
31
|
-
* @param scope Alcance a actualizar.
|
|
32
|
-
* @returns Una promesa que resuelve a un objeto vacío.
|
|
33
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
34
|
-
*/
|
|
35
|
-
updateScope(directoryId: string, scope: string[]): Promise<void>;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Obtiene un directorio por su ID de directorio propietario.
|
|
39
|
-
* @param ownerDirectoryId ID de directorio propietario (UUID) a buscar.
|
|
40
|
-
* @returns Una promesa que resuelve a un objeto de directorio.
|
|
41
|
-
* Puede devolver un objeto vacío si no se encuentra coincidencia.
|
|
42
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
43
|
-
*/
|
|
44
|
-
getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any>
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Obtiene un directorio por su número de teléfono.
|
|
48
|
-
* @param phoneNumber Número de teléfono a buscar.
|
|
49
|
-
* @returns Una promesa que resuelve a un objeto de directorio.
|
|
50
|
-
* Puede devolver un objeto vacío si no se encuentra coincidencia.
|
|
51
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
52
|
-
*/
|
|
53
|
-
getByPhoneNumber(phoneNumber: string): Promise<any>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
addOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
updateUserProfile(directoryId: string, profile: Profile): Promise<void>
|
|
62
|
-
|
|
63
|
-
updateOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
1
|
+
import { Profile } from "@fiado/type-kit/bin/directory/enums/Profile";
|
|
2
|
+
import { Provider } from "@fiado/type-kit/bin/provider";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
6
|
+
*/
|
|
7
|
+
export interface IDirectoryApi {
|
|
8
|
+
/**
|
|
9
|
+
* Obtiene una lista de directorios por sus IDs.
|
|
10
|
+
* @param ids Array de IDs de directorios (UUIDs) a buscar.
|
|
11
|
+
* @returns Una promesa que resuelve a un arreglo de objetos de directorio.
|
|
12
|
+
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
13
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
14
|
+
*/
|
|
15
|
+
getByIds(ids: string[]): Promise<any>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Actualiza el ID de usuario externo en un directorio.
|
|
19
|
+
* @param directoryId ID del directorio (UUID) a actualizar.
|
|
20
|
+
* @param provider Proveedor de autenticación del usuario.
|
|
21
|
+
* @param externalUserId ID de usuario externo.
|
|
22
|
+
* @returns Una promesa que resuelve a un objeto vacío.
|
|
23
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
updateExternalUserId(directoryId: string, provider: Provider, externalUserId: string): Promise<void>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Actualiza el alcance de un directorio.
|
|
30
|
+
* @param directoryId ID del directorio (UUID) a actualizar.
|
|
31
|
+
* @param scope Alcance a actualizar.
|
|
32
|
+
* @returns Una promesa que resuelve a un objeto vacío.
|
|
33
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
34
|
+
*/
|
|
35
|
+
updateScope(directoryId: string, scope: string[]): Promise<void>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Obtiene un directorio por su ID de directorio propietario.
|
|
39
|
+
* @param ownerDirectoryId ID de directorio propietario (UUID) a buscar.
|
|
40
|
+
* @returns Una promesa que resuelve a un objeto de directorio.
|
|
41
|
+
* Puede devolver un objeto vacío si no se encuentra coincidencia.
|
|
42
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
43
|
+
*/
|
|
44
|
+
getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any>
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Obtiene un directorio por su número de teléfono.
|
|
48
|
+
* @param phoneNumber Número de teléfono a buscar.
|
|
49
|
+
* @returns Una promesa que resuelve a un objeto de directorio.
|
|
50
|
+
* Puede devolver un objeto vacío si no se encuentra coincidencia.
|
|
51
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
52
|
+
*/
|
|
53
|
+
getByPhoneNumber(phoneNumber: string): Promise<any>
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
addOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any>
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
updateUserProfile(directoryId: string, profile: Profile): Promise<void>
|
|
62
|
+
|
|
63
|
+
updateOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
}
|
|
@@ -1,19 +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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
}
|
|
19
28
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './interfaces/IExchangeRatesApi';
|
|
1
|
+
export * from './interfaces/IExchangeRatesApi';
|
|
2
2
|
export * from './ExchangeRatesApi';
|