@fiado/api-invoker 1.0.29 → 1.0.31
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/account-fiadoinc/AccountFiadoIncApi.d.ts +10 -0
- package/bin/account-fiadoinc/AccountFiadoIncApi.js +31 -0
- package/bin/account-fiadoinc/index.d.ts +1 -0
- package/bin/account-fiadoinc/index.js +1 -0
- package/bin/account-fiadoinc/interfaces/IAccountFiadoIncApi.d.ts +2 -1
- package/bin/account-fiadosa/AccountFiadoSAApi.d.ts +10 -0
- package/bin/account-fiadosa/AccountFiadoSAApi.js +31 -0
- package/bin/account-fiadosa/index.d.ts +1 -0
- package/bin/account-fiadosa/index.js +1 -0
- package/bin/account-fiadosa/interfaces/IAccountFiadoSAApi.d.ts +2 -1
- package/bin/account-pagoconfiado/AccountPagoConfiadoApi.d.ts +10 -0
- package/bin/account-pagoconfiado/AccountPagoConfiadoApi.js +31 -0
- package/bin/account-pagoconfiado/index.d.ts +1 -0
- package/bin/account-pagoconfiado/index.js +1 -0
- package/bin/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.d.ts +2 -1
- package/bin/container.config.js +8 -0
- package/package.json +28 -28
- package/src/account-fiadoinc/AccountFiadoIncApi.ts +18 -0
- package/src/account-fiadoinc/index.ts +2 -3
- package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +6 -7
- package/src/account-fiadosa/AccountFiadoSAApi.ts +18 -0
- package/src/account-fiadosa/index.ts +2 -2
- package/src/account-fiadosa/interfaces/IAccountFiadoSAApi.ts +6 -8
- package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +18 -0
- package/src/account-pagoconfiado/index.ts +2 -2
- package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +6 -7
- package/src/address/AddressApi.ts +46 -47
- package/src/address/index.ts +3 -3
- package/src/address/interfaces/IAddressApi.ts +30 -30
- package/src/container.config.ts +28 -17
- package/src/directory/DirectoryApi.ts +27 -27
- package/src/directory/index.ts +3 -3
- package/src/directory/interfaces/IDirectoryApi.ts +14 -14
- 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 +14 -14
- 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/pomelo/api/PomeloApi.ts +95 -95
- package/src/pomelo/api/interfaces/IPomeloApi.ts +7 -7
- package/src/pomelo/index.ts +1 -1
- 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/tern/api/TernApi.ts +47 -47
- package/src/tern/api/interfaces/ITernApi.ts +12 -12
- package/src/tern/index.ts +1 -1
- package/tsconfig.json +21 -21
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { AddressCreateRequest, AddressResponse, AddressShippingCardRequest, AddressShippingCardResponse } from "@fiado/type-kit/bin/address";
|
|
2
|
-
|
|
3
|
-
export interface IAddressApi {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Obtiene una lista de direcciones por su ID de directorio.
|
|
7
|
-
* @param directoryId ID de directorio (UUID) a buscar.
|
|
8
|
-
* @returns Una promesa que resuelve a un arreglo de objetos de dirección.
|
|
9
|
-
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
10
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
11
|
-
*/
|
|
12
|
-
getByDirectoryId(directoryId: string): Promise<AddressResponse[]>;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Crea una nueva dirección para un directorio.
|
|
16
|
-
* @param directoryId ID de directorio (UUID) a buscar.
|
|
17
|
-
* @param address Objeto de dirección a crear.
|
|
18
|
-
* @returns Una promesa que resuelve a void.
|
|
19
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
20
|
-
*/
|
|
21
|
-
create(directoryId: string, address: AddressCreateRequest): Promise<void>;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Obtiene la dirección de envío de una tarjeta.
|
|
25
|
-
* @param input Objeto de solicitud de dirección de envío.
|
|
26
|
-
* @returns Una promesa que resuelve a un objeto de respuesta de dirección de envío.
|
|
27
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
28
|
-
*/
|
|
29
|
-
getAddressLocationShipping(input: AddressShippingCardRequest): Promise<AddressShippingCardResponse>;
|
|
30
|
-
|
|
1
|
+
import { AddressCreateRequest, AddressResponse, AddressShippingCardRequest, AddressShippingCardResponse } from "@fiado/type-kit/bin/address";
|
|
2
|
+
|
|
3
|
+
export interface IAddressApi {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Obtiene una lista de direcciones por su ID de directorio.
|
|
7
|
+
* @param directoryId ID de directorio (UUID) a buscar.
|
|
8
|
+
* @returns Una promesa que resuelve a un arreglo de objetos de dirección.
|
|
9
|
+
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
10
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
11
|
+
*/
|
|
12
|
+
getByDirectoryId(directoryId: string): Promise<AddressResponse[]>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Crea una nueva dirección para un directorio.
|
|
16
|
+
* @param directoryId ID de directorio (UUID) a buscar.
|
|
17
|
+
* @param address Objeto de dirección a crear.
|
|
18
|
+
* @returns Una promesa que resuelve a void.
|
|
19
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
20
|
+
*/
|
|
21
|
+
create(directoryId: string, address: AddressCreateRequest): Promise<void>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Obtiene la dirección de envío de una tarjeta.
|
|
25
|
+
* @param input Objeto de solicitud de dirección de envío.
|
|
26
|
+
* @returns Una promesa que resuelve a un objeto de respuesta de dirección de envío.
|
|
27
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
28
|
+
*/
|
|
29
|
+
getAddressLocationShipping(input: AddressShippingCardRequest): Promise<AddressShippingCardResponse>;
|
|
30
|
+
|
|
31
31
|
}
|
package/src/container.config.ts
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
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 {
|
|
9
|
-
import PomeloApi from "./pomelo/api/PomeloApi";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
+
|
|
18
|
+
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
19
|
+
bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
|
|
20
|
+
bind<IIdentityApi>("IIdentityApi").to(IdentityApi);
|
|
21
|
+
bind<IAddressApi>("IAddressApi").to(AddressApi);
|
|
22
|
+
bind<ITernApi>("ITernApi").to(TernApi);
|
|
23
|
+
bind<IPomeloApi>("IPomeloApi").to(PomeloApi);
|
|
24
|
+
bind<IAccountFiadoIncApi>("IAccountFiadoIncApi").to(AccountFiadoIncApi);
|
|
25
|
+
bind<IAccountPagoConfiadoApi>("IAccountPagoConfiadoApi").to(AccountPagoConfiadoApi);
|
|
26
|
+
bind<IAccountFiadoSAApi>("IAccountFiadoSAApi").to(AccountFiadoSAApi);
|
|
27
|
+
bind<INotificationMessagesPublisher>("INotificationMessagesPublisher").to(NotificationMessagePublisher);
|
|
28
|
+
});
|
|
@@ -1,27 +1,27 @@
|
|
|
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
|
-
|
|
6
|
-
dotenv.config();
|
|
7
|
-
|
|
8
|
-
@injectable()
|
|
9
|
-
export class DirectoryApi implements IDirectoryApi {
|
|
10
|
-
|
|
11
|
-
private readonly baseUrl = process.env.DIRECTORY_LAMBDA_URL || "";
|
|
12
|
-
|
|
13
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public async getByIds(ids: string[]): Promise<any> {
|
|
17
|
-
|
|
18
|
-
if (ids.length === 0) {
|
|
19
|
-
throw new Error("At least one directory ID is required.")
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const url = `${this.baseUrl}?${ids.map(id => `directoryId=${encodeURIComponent(id)}`).join('&')}`;
|
|
23
|
-
const operationName = "getUserInfoByIds";
|
|
24
|
-
|
|
25
|
-
return await this.httpRequest.post(`${url}`, null, {'operationName': operationName});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
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
|
+
|
|
6
|
+
dotenv.config();
|
|
7
|
+
|
|
8
|
+
@injectable()
|
|
9
|
+
export class DirectoryApi implements IDirectoryApi {
|
|
10
|
+
|
|
11
|
+
private readonly baseUrl = process.env.DIRECTORY_LAMBDA_URL || "";
|
|
12
|
+
|
|
13
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public async getByIds(ids: string[]): Promise<any> {
|
|
17
|
+
|
|
18
|
+
if (ids.length === 0) {
|
|
19
|
+
throw new Error("At least one directory ID is required.")
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const url = `${this.baseUrl}?${ids.map(id => `directoryId=${encodeURIComponent(id)}`).join('&')}`;
|
|
23
|
+
const operationName = "getUserInfoByIds";
|
|
24
|
+
|
|
25
|
+
return await this.httpRequest.post(`${url}`, null, {'operationName': operationName});
|
|
26
|
+
}
|
|
27
|
+
}
|
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,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
4
|
-
*/
|
|
5
|
-
export interface IDirectoryApi {
|
|
6
|
-
/**
|
|
7
|
-
* Obtiene una lista de directorios por sus IDs.
|
|
8
|
-
* @param ids Array de IDs de directorios (UUIDs) a buscar.
|
|
9
|
-
* @returns Una promesa que resuelve a un arreglo de objetos de directorio.
|
|
10
|
-
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
11
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
12
|
-
*/
|
|
13
|
-
getByIds(ids: string[]): Promise<any>;
|
|
14
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
4
|
+
*/
|
|
5
|
+
export interface IDirectoryApi {
|
|
6
|
+
/**
|
|
7
|
+
* Obtiene una lista de directorios por sus IDs.
|
|
8
|
+
* @param ids Array de IDs de directorios (UUIDs) a buscar.
|
|
9
|
+
* @returns Una promesa que resuelve a un arreglo de objetos de directorio.
|
|
10
|
+
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
11
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
12
|
+
*/
|
|
13
|
+
getByIds(ids: string[]): Promise<any>;
|
|
14
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
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 } from "@fiado/type-kit/bin/identity";
|
|
6
|
-
dotenv.config();
|
|
7
|
-
|
|
8
|
-
@injectable()
|
|
9
|
-
export class IdentityApi implements IIdentityApi {
|
|
10
|
-
|
|
11
|
-
private readonly baseUrl = process.env.IDENTITY_LAMBDA_URL || "";
|
|
12
|
-
|
|
13
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
14
|
-
|
|
15
|
-
async getPeopleByIds(ids: string[]): Promise<any> {
|
|
16
|
-
|
|
17
|
-
if (ids.length === 0) {
|
|
18
|
-
throw new Error("At least one people ID is required.")
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const url = `${this.baseUrl}identities/people?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
|
|
22
|
-
return await this.httpRequest.get(`${url}`);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async updatePeopleById(id: string, data: PeopleUpdateRequest): Promise<void> {
|
|
26
|
-
|
|
27
|
-
if (!id) {
|
|
28
|
-
throw new Error("People ID is required.")
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const url = `${this.baseUrl}identities/people/${id}`;
|
|
32
|
-
await this.httpRequest.put<void>(url, data);
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
async getProfilePicture(directoryId: string): Promise<any> {
|
|
37
|
-
|
|
38
|
-
if (!directoryId) {
|
|
39
|
-
throw new Error("Directory ID is required.")
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const url = `${this.baseUrl}identities/profile?directoryId=${directoryId}&typeOfDirectoryId=USER`;
|
|
43
|
-
const operationName = "getUserInfoByIds";
|
|
44
|
-
|
|
45
|
-
return await this.httpRequest.get<any>(url, { 'operationName': operationName });
|
|
46
|
-
|
|
47
|
-
}
|
|
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 } from "@fiado/type-kit/bin/identity";
|
|
6
|
+
dotenv.config();
|
|
7
|
+
|
|
8
|
+
@injectable()
|
|
9
|
+
export class IdentityApi implements IIdentityApi {
|
|
10
|
+
|
|
11
|
+
private readonly baseUrl = process.env.IDENTITY_LAMBDA_URL || "";
|
|
12
|
+
|
|
13
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
14
|
+
|
|
15
|
+
async getPeopleByIds(ids: string[]): Promise<any> {
|
|
16
|
+
|
|
17
|
+
if (ids.length === 0) {
|
|
18
|
+
throw new Error("At least one people ID is required.")
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const url = `${this.baseUrl}identities/people?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
|
|
22
|
+
return await this.httpRequest.get(`${url}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async updatePeopleById(id: string, data: PeopleUpdateRequest): Promise<void> {
|
|
26
|
+
|
|
27
|
+
if (!id) {
|
|
28
|
+
throw new Error("People ID is required.")
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const url = `${this.baseUrl}identities/people/${id}`;
|
|
32
|
+
await this.httpRequest.put<void>(url, data);
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async getProfilePicture(directoryId: string): Promise<any> {
|
|
37
|
+
|
|
38
|
+
if (!directoryId) {
|
|
39
|
+
throw new Error("Directory ID is required.")
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const url = `${this.baseUrl}identities/profile?directoryId=${directoryId}&typeOfDirectoryId=USER`;
|
|
43
|
+
const operationName = "getUserInfoByIds";
|
|
44
|
+
|
|
45
|
+
return await this.httpRequest.get<any>(url, { 'operationName': operationName });
|
|
46
|
+
|
|
47
|
+
}
|
|
48
48
|
}
|
package/src/identity/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from './interfaces/IIdentityApi';
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export * from './interfaces/IIdentityApi';
|
|
4
4
|
export * from './IdentityApi';
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { PeopleUpdateRequest } from "@fiado/type-kit/bin/identity";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
5
|
-
*/
|
|
6
|
-
export interface IIdentityApi {
|
|
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
|
-
getPeopleByIds(ids: string[]): Promise<any>;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Actualiza la información de un people.
|
|
18
|
-
* @param id ID de people a actualizar.
|
|
19
|
-
* @param data Datos de people a actualizar.
|
|
20
|
-
* @returns Una promesa que resuelve a void.
|
|
21
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
22
|
-
*/
|
|
23
|
-
updatePeopleById(id: string, data: PeopleUpdateRequest): Promise<void>;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Obtiene la URL de la imagen de perfil de un usuario.
|
|
27
|
-
* @param directoryId ID de directorio del usuario.
|
|
28
|
-
* @returns Una promesa que resuelve a un objeto con la URL de la imagen de perfil.
|
|
29
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
30
|
-
*/
|
|
31
|
-
getProfilePicture(directoryId: string): Promise<any>;
|
|
32
|
-
|
|
33
|
-
}
|
|
1
|
+
import { PeopleUpdateRequest } from "@fiado/type-kit/bin/identity";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
5
|
+
*/
|
|
6
|
+
export interface IIdentityApi {
|
|
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
|
+
getPeopleByIds(ids: string[]): Promise<any>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Actualiza la información de un people.
|
|
18
|
+
* @param id ID de people a actualizar.
|
|
19
|
+
* @param data Datos de people a actualizar.
|
|
20
|
+
* @returns Una promesa que resuelve a void.
|
|
21
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
22
|
+
*/
|
|
23
|
+
updatePeopleById(id: string, data: PeopleUpdateRequest): Promise<void>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Obtiene la URL de la imagen de perfil de un usuario.
|
|
27
|
+
* @param directoryId ID de directorio del usuario.
|
|
28
|
+
* @returns Una promesa que resuelve a un objeto con la URL de la imagen de perfil.
|
|
29
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
30
|
+
*/
|
|
31
|
+
getProfilePicture(directoryId: string): Promise<any>;
|
|
32
|
+
|
|
33
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export * from './directory';
|
|
2
|
-
export * from './identity';
|
|
3
|
-
export * from './notificationMessages';
|
|
4
|
-
export * from './sessionActivity';
|
|
5
|
-
export * from './tern';
|
|
6
|
-
export * from './pomelo';
|
|
7
|
-
export * from './address';
|
|
8
|
-
export * from "./container.config";
|
|
9
|
-
export * from "./account-fiadoinc";
|
|
10
|
-
export * from "./account-fiadosa";
|
|
11
|
-
export * from "./account-pagoconfiado";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
export * from './directory';
|
|
2
|
+
export * from './identity';
|
|
3
|
+
export * from './notificationMessages';
|
|
4
|
+
export * from './sessionActivity';
|
|
5
|
+
export * from './tern';
|
|
6
|
+
export * from './pomelo';
|
|
7
|
+
export * from './address';
|
|
8
|
+
export * from "./container.config";
|
|
9
|
+
export * from "./account-fiadoinc";
|
|
10
|
+
export * from "./account-fiadosa";
|
|
11
|
+
export * from "./account-pagoconfiado";
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './queue/NotificationMessagePublisher';
|
|
1
|
+
export * from './queue/NotificationMessagePublisher';
|
|
2
2
|
export * from './queue/interfaces/INotificationMessagesPublisher';
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {INotificationMessagesPublisher} from "./interfaces/INotificationMessagesPublisher";
|
|
2
|
-
import {NotificationQueueMessageRequest} from "@fiado/type-kit/bin/notificationMessages";
|
|
3
|
-
import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
|
|
4
|
-
import {injectable} from "inversify";
|
|
5
|
-
|
|
6
|
-
@injectable()
|
|
7
|
-
export default class NotificationMessagePublisher implements INotificationMessagesPublisher {
|
|
8
|
-
private readonly NOTIFICATION_MESSAGES_QUEUE = process.env.NOTIFICATION_MESSAGES_QUEUE
|
|
9
|
-
|
|
10
|
-
async publish(message: NotificationQueueMessageRequest): Promise<void> {
|
|
11
|
-
try {
|
|
12
|
-
const client: SQSClient = new SQSClient();
|
|
13
|
-
const sendMessageRequest: SendMessageRequest = {
|
|
14
|
-
QueueUrl: this.NOTIFICATION_MESSAGES_QUEUE,
|
|
15
|
-
MessageBody: JSON.stringify(message)
|
|
16
|
-
};
|
|
17
|
-
const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
|
|
18
|
-
await client.send(command);
|
|
19
|
-
} catch (error) {
|
|
20
|
-
throw new Error(`Error publishing message to queue ${': ' + error.message ?? ''}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
import {INotificationMessagesPublisher} from "./interfaces/INotificationMessagesPublisher";
|
|
2
|
+
import {NotificationQueueMessageRequest} from "@fiado/type-kit/bin/notificationMessages";
|
|
3
|
+
import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
|
|
4
|
+
import {injectable} from "inversify";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export default class NotificationMessagePublisher implements INotificationMessagesPublisher {
|
|
8
|
+
private readonly NOTIFICATION_MESSAGES_QUEUE = process.env.NOTIFICATION_MESSAGES_QUEUE
|
|
9
|
+
|
|
10
|
+
async publish(message: NotificationQueueMessageRequest): Promise<void> {
|
|
11
|
+
try {
|
|
12
|
+
const client: SQSClient = new SQSClient();
|
|
13
|
+
const sendMessageRequest: SendMessageRequest = {
|
|
14
|
+
QueueUrl: this.NOTIFICATION_MESSAGES_QUEUE,
|
|
15
|
+
MessageBody: JSON.stringify(message)
|
|
16
|
+
};
|
|
17
|
+
const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
|
|
18
|
+
await client.send(command);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
throw new Error(`Error publishing message to queue ${': ' + error.message ?? ''}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
23
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {NotificationQueueMessageRequest} from "@fiado/type-kit/bin/notificationMessages";
|
|
2
|
-
|
|
3
|
-
export interface INotificationMessagesPublisher {
|
|
4
|
-
publish(message: NotificationQueueMessageRequest): Promise<void>;
|
|
1
|
+
import {NotificationQueueMessageRequest} from "@fiado/type-kit/bin/notificationMessages";
|
|
2
|
+
|
|
3
|
+
export interface INotificationMessagesPublisher {
|
|
4
|
+
publish(message: NotificationQueueMessageRequest): Promise<void>;
|
|
5
5
|
}
|