@fiado/api-invoker 1.1.4 → 1.1.6

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.
@@ -0,0 +1,17 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { IActivityApi } from './interfaces/IActivityApi';
3
+ import { TypeOfDirectoryId } from '@fiado/type-kit/bin/directory';
4
+ export declare class ActivityApi implements IActivityApi {
5
+ private httpRequest;
6
+ private readonly baseUrl;
7
+ constructor(httpRequest: IHttpRequest);
8
+ getActivities(typeOfActivities: string[]): Promise<any>;
9
+ getActivitiesByDirectoryIdAndTypeOfActivity(directoryId: string, typeOfActivities: string[]): Promise<any>;
10
+ postActivity(params: {
11
+ directoryId: string;
12
+ typeOfDirectoryId: TypeOfDirectoryId;
13
+ typeOfActivity: string;
14
+ amount: string;
15
+ date: string;
16
+ }): Promise<any>;
17
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ActivityApi = void 0;
19
+ const dotenv_1 = __importDefault(require("dotenv"));
20
+ const inversify_1 = require("inversify");
21
+ dotenv_1.default.config();
22
+ let ActivityApi = class ActivityApi {
23
+ constructor(httpRequest) {
24
+ this.httpRequest = httpRequest;
25
+ this.baseUrl = process.env.ACTIVITY_LAMBDA_URL || "";
26
+ }
27
+ async getActivities(typeOfActivities) {
28
+ let url = `${this.baseUrl}activities`;
29
+ if (typeOfActivities.length > 0) {
30
+ url = `${this.baseUrl}activities?${typeOfActivities.map(id => `typeOfActivities=${encodeURIComponent(id)}`).join('&')}`;
31
+ }
32
+ const operationName = "getActivities";
33
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
34
+ }
35
+ async getActivitiesByDirectoryIdAndTypeOfActivity(directoryId, typeOfActivities) {
36
+ if (directoryId == null || directoryId == undefined || directoryId == "") {
37
+ throw new Error("At least directory ID is required.");
38
+ }
39
+ let url = `${this.baseUrl}activities/directory/${directoryId}`;
40
+ if (typeOfActivities.length > 0) {
41
+ url = `${this.baseUrl}activities/directory/${directoryId}?${typeOfActivities.map(id => `typeOfActivities=${encodeURIComponent(id)}`).join('&')}`;
42
+ }
43
+ const operationName = "getActivitiesByDirectoryIdAndTypeOfActivity";
44
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
45
+ }
46
+ async postActivity(params) {
47
+ if (params.directoryId == null || params.directoryId == undefined || params.directoryId == "") {
48
+ throw new Error("At least directory ID is required.");
49
+ }
50
+ if (params.typeOfDirectoryId == null || params.typeOfDirectoryId == undefined) {
51
+ throw new Error("At least typeOfDirectoryId is required.");
52
+ }
53
+ if (params.typeOfActivity == null || params.typeOfActivity == undefined || params.typeOfActivity == "") {
54
+ throw new Error("At least typeOfActivity is required.");
55
+ }
56
+ if (params.amount == null || params.amount == undefined || params.amount == "") {
57
+ throw new Error("At least amount is required.");
58
+ }
59
+ if (params.date == null || params.date == undefined || params.date == "") {
60
+ throw new Error("At least date is required.");
61
+ }
62
+ const url = `${this.baseUrl}/activities/create`;
63
+ const operationName = "postActivity";
64
+ return await this.httpRequest.post(`${url}`, params, { 'operationName': operationName });
65
+ }
66
+ };
67
+ exports.ActivityApi = ActivityApi;
68
+ exports.ActivityApi = ActivityApi = __decorate([
69
+ (0, inversify_1.injectable)(),
70
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
71
+ __metadata("design:paramtypes", [Object])
72
+ ], ActivityApi);
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IActivityApi';
2
+ export * from './ActivityApi';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./interfaces/IActivityApi"), exports);
18
+ __exportStar(require("./ActivityApi"), exports);
@@ -0,0 +1,39 @@
1
+ import { TypeOfDirectoryId } from "@fiado/type-kit/bin/directory";
2
+ /**
3
+ * Interfaz para el servicio Directory que permite operaciones sobre directorios.
4
+ */
5
+ export interface IActivityApi {
6
+ /**
7
+ * Obtiene una lista de entidades de la tabla ActivityDirectory.
8
+ * @param directoryId Directorio que se va a consultar.
9
+ * @param typeOfActivities Array de tipos de actividades (Opcional).
10
+ * @returns Retorna un arreglo de objetos de ActivityDirectory.
11
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
12
+ */
13
+ getActivitiesByDirectoryIdAndTypeOfActivity(directoryId: string, typeOfActivities: string[]): Promise<any>;
14
+ /**
15
+ * Obtener actividades globales.
16
+ * @param typeOfActivity Tipo de actividad
17
+ * Puede devolver un arreglo vacío si no se encuentran coincidencias.
18
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
19
+ */
20
+ getActivities(typeOfActivities: string[]): Promise<any>;
21
+ /**
22
+ * Proceso para agregar a las actividades.
23
+ * @param directoryId Directorio
24
+ * @param typeOfDirectoryId Tipo de directorio
25
+ * @param typeOfActivity Tipo de actividad
26
+ * @param amount Monto de la actividad
27
+ * @param date Fecha de la actividad
28
+ * @returns Retorna un objeto de ActivityDirectory.
29
+ * Puede devolver un arreglo vacío si no se encuentran coincidencias.
30
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
31
+ */
32
+ postActivity(params: {
33
+ directoryId: string;
34
+ typeOfDirectoryId: TypeOfDirectoryId;
35
+ typeOfActivity: string;
36
+ amount: string;
37
+ date: string;
38
+ }): Promise<any>;
39
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -29,6 +29,8 @@ const account_beneficiary_1 = require("./account-beneficiary");
29
29
  const stpSpei_1 = require("./stpSpei");
30
30
  const StpServicePaymentApi_1 = __importDefault(require("./stpServicePayment/api/StpServicePaymentApi"));
31
31
  const bbvaRst_1 = require("./bbvaRst");
32
+ const FraudPreventionEngineApi_1 = __importDefault(require("./fraudPreventionEngine/api/FraudPreventionEngineApi"));
33
+ const group_1 = require("./group");
32
34
  exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
33
35
  bind("IDirectoryApi").to(directory_1.DirectoryApi);
34
36
  bind("IIdentityApi").to(identity_1.IdentityApi);
@@ -54,4 +56,6 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
54
56
  bind("IStpSpeiApi").to(stpSpei_1.StpSpeiApi);
55
57
  bind("IStpServicePaymentApi").to(StpServicePaymentApi_1.default);
56
58
  bind("IBBVARstApi").to(bbvaRst_1.BBVARstApi);
59
+ bind("IFraudPreventionEngineApi").to(FraudPreventionEngineApi_1.default);
60
+ bind("IGroupApi").to(group_1.GroupApi);
57
61
  });
@@ -0,0 +1,11 @@
1
+ import { IFraudPreventionEngineApi } from "./interfaces/IFraudPreventionEngineApi";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ import GetAccountLevelParams from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/GetAccountLevelParams";
4
+ import CreateAccountLevelRequest from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/CreateAccountLevelRequest";
5
+ export default class FraudPreventionEngineApi implements IFraudPreventionEngineApi {
6
+ private httpRequest;
7
+ private readonly baseUrl;
8
+ constructor(httpRequest: IHttpRequest);
9
+ getAccountLevel(params: GetAccountLevelParams): Promise<any>;
10
+ createAccountLevel(request: CreateAccountLevelRequest): Promise<any>;
11
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const inversify_1 = require("inversify");
16
+ let FraudPreventionEngineApi = class FraudPreventionEngineApi {
17
+ constructor(httpRequest) {
18
+ this.httpRequest = httpRequest;
19
+ this.baseUrl = process.env.FRAUD_PREVENTION_ENGINE_LAMBDA_URL || "";
20
+ }
21
+ async getAccountLevel(params) {
22
+ const url = `${this.baseUrl}/account/levels?${Object.entries(params).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join('&')}`;
23
+ return await this.httpRequest.get(url);
24
+ }
25
+ async createAccountLevel(request) {
26
+ const url = `${this.baseUrl}/account/levels`;
27
+ return await this.httpRequest.post(url, request);
28
+ }
29
+ };
30
+ FraudPreventionEngineApi = __decorate([
31
+ (0, inversify_1.injectable)(),
32
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
33
+ __metadata("design:paramtypes", [Object])
34
+ ], FraudPreventionEngineApi);
35
+ exports.default = FraudPreventionEngineApi;
@@ -0,0 +1,6 @@
1
+ import GetAccountLevelParams from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/GetAccountLevelParams";
2
+ import CreateAccountLevelRequest from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/CreateAccountLevelRequest";
3
+ export interface IFraudPreventionEngineApi {
4
+ getAccountLevel(params: GetAccountLevelParams): Promise<any>;
5
+ createAccountLevel(request: CreateAccountLevelRequest): Promise<any>;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './api/interfaces/IFraudPreventionEngineApi';
2
+ export * from './api/FraudPreventionEngineApi';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./api/interfaces/IFraudPreventionEngineApi"), exports);
18
+ __exportStar(require("./api/FraudPreventionEngineApi"), exports);
@@ -0,0 +1,9 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { GroupAddDirectoryRequest } from "@fiado/type-kit/bin/group";
3
+ import { IGroupApi } from "./interfaces/IGroupApi";
4
+ export declare class GroupApi implements IGroupApi {
5
+ private httpRequest;
6
+ private readonly baseUrl;
7
+ constructor(httpRequest: IHttpRequest);
8
+ members(params: GroupAddDirectoryRequest): Promise<any>;
9
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.GroupApi = void 0;
19
+ const inversify_1 = require("inversify");
20
+ const dotenv_1 = __importDefault(require("dotenv"));
21
+ dotenv_1.default.config();
22
+ let GroupApi = class GroupApi {
23
+ constructor(httpRequest) {
24
+ this.httpRequest = httpRequest;
25
+ this.baseUrl = process.env.FIADO_GROUP_LAMBDA_URL || "";
26
+ }
27
+ async members(params) {
28
+ const url = `${this.baseUrl}members`;
29
+ return await this.httpRequest.post(`${url}`, params);
30
+ }
31
+ };
32
+ exports.GroupApi = GroupApi;
33
+ exports.GroupApi = GroupApi = __decorate([
34
+ (0, inversify_1.injectable)(),
35
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
36
+ __metadata("design:paramtypes", [Object])
37
+ ], GroupApi);
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IGroupApi';
2
+ export * from './GroupApi';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./interfaces/IGroupApi"), exports);
18
+ __exportStar(require("./GroupApi"), exports);
@@ -0,0 +1,12 @@
1
+ import { GroupAddDirectoryRequest } from "@fiado/type-kit/bin/group";
2
+ /**
3
+ * Interfaz para el servicio Directory que permite operaciones sobre directorios.
4
+ */
5
+ export interface IGroupApi {
6
+ /**
7
+ * Agrega o elimina miembros a un grupo.
8
+ * @param GroupAddDirectoryRequest
9
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
10
+ */
11
+ members(params: GroupAddDirectoryRequest): Promise<any>;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/bin/index.d.ts CHANGED
@@ -22,3 +22,5 @@ export * from "./bankAccount";
22
22
  export * from "./stpSpei";
23
23
  export * from "./stpServicePayment";
24
24
  export * from "./bbvaRst";
25
+ export * from "./fraudPreventionEngine";
26
+ export * from "./group";
package/bin/index.js CHANGED
@@ -38,3 +38,5 @@ __exportStar(require("./bankAccount"), exports);
38
38
  __exportStar(require("./stpSpei"), exports);
39
39
  __exportStar(require("./stpServicePayment"), exports);
40
40
  __exportStar(require("./bbvaRst"), exports);
41
+ __exportStar(require("./fraudPreventionEngine"), exports);
42
+ __exportStar(require("./group"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a traves de invocaciones http",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -16,7 +16,7 @@
16
16
  "@fiado/gateway-adapter": "^1.1.31",
17
17
  "@fiado/http-client": "^1.0.2",
18
18
  "@fiado/logger": "^1.0.2",
19
- "@fiado/type-kit": "^1.2.9",
19
+ "@fiado/type-kit": "^1.2.15",
20
20
  "dotenv": "^16.4.5",
21
21
  "inversify": "^6.0.2",
22
22
  "reflect-metadata": "^0.2.1",
@@ -35,6 +35,9 @@ import {IStpSpeiApi, StpSpeiApi} from "./stpSpei";
35
35
  import StpServicePaymentApi from "./stpServicePayment/api/StpServicePaymentApi";
36
36
  import {IStpServicePaymentApi} from "./stpServicePayment";
37
37
  import {BBVARstApi, IBBVARstApi} from "./bbvaRst";
38
+ import FraudPreventionEngineApi from "./fraudPreventionEngine/api/FraudPreventionEngineApi";
39
+ import {IFraudPreventionEngineApi} from "./fraudPreventionEngine";
40
+ import {IGroupApi,GroupApi} from "./group";
38
41
 
39
42
  export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
40
43
  bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
@@ -61,4 +64,7 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
61
64
  bind<IStpSpeiApi>("IStpSpeiApi").to(StpSpeiApi);
62
65
  bind<IStpServicePaymentApi>("IStpServicePaymentApi").to(StpServicePaymentApi);
63
66
  bind<IBBVARstApi>("IBBVARstApi").to(BBVARstApi);
67
+ bind<IFraudPreventionEngineApi>("IFraudPreventionEngineApi").to(FraudPreventionEngineApi);
68
+ bind<IGroupApi>("IGroupApi").to(GroupApi);
69
+
64
70
  });
@@ -0,0 +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
+ }
23
+ }
@@ -0,0 +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>;
8
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api/interfaces/IFraudPreventionEngineApi';
2
+ export * from './api/FraudPreventionEngineApi';
@@ -0,0 +1,19 @@
1
+ import { inject, injectable } from "inversify";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ import dotenv from 'dotenv';
4
+ import { GroupAddDirectoryRequest } from "@fiado/type-kit/bin/group";
5
+ import { IGroupApi } from "./interfaces/IGroupApi";
6
+
7
+ dotenv.config();
8
+
9
+ @injectable()
10
+ export class GroupApi implements IGroupApi {
11
+
12
+ private readonly baseUrl = process.env.FIADO_GROUP_LAMBDA_URL || "";
13
+
14
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
15
+ async members(params: GroupAddDirectoryRequest): Promise<any> {
16
+ const url = `${this.baseUrl}members`;
17
+ return await this.httpRequest.post(`${url}`,params);
18
+ }
19
+ }
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IGroupApi';
2
+ export * from './GroupApi';
@@ -0,0 +1,15 @@
1
+ import { GroupAddDirectoryRequest } from "@fiado/type-kit/bin/group";
2
+
3
+ /**
4
+ * Interfaz para el servicio Directory que permite operaciones sobre directorios.
5
+ */
6
+ export interface IGroupApi {
7
+
8
+ /**
9
+ * Agrega o elimina miembros a un grupo.
10
+ * @param GroupAddDirectoryRequest
11
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
12
+ */
13
+ members(params: GroupAddDirectoryRequest): Promise<any>;
14
+
15
+ }
package/src/index.ts CHANGED
@@ -21,4 +21,6 @@ export * from "./p2pContact";
21
21
  export * from "./bankAccount";
22
22
  export * from "./stpSpei";
23
23
  export * from "./stpServicePayment";
24
- export * from "./bbvaRst";
24
+ export * from "./bbvaRst";
25
+ export * from "./fraudPreventionEngine";
26
+ export * from "./group";