@fiado/api-invoker 1.2.43 → 1.2.44

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 });
@@ -52,6 +52,7 @@ const observations_1 = require("./observations");
52
52
  const CognitoConnectorV2_1 = __importDefault(require("./cognitoConnector/CognitoConnectorV2"));
53
53
  const centralPayments_1 = require("./centralPayments");
54
54
  const InvokerUtils_1 = require("./utils/InvokerUtils");
55
+ const service_business_1 = require("./service-business");
55
56
  exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
56
57
  // UTILS bindings
57
58
  bind("InvokerUtils").to(InvokerUtils_1.InvokerUtils);
@@ -102,4 +103,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
102
103
  bind("IDeviceApi").to(device_1.DeviceApi);
103
104
  bind("IObservationsApi").to(observations_1.ObservationsApi);
104
105
  bind("ICentralPaymentsConnectorApi").to(centralPayments_1.CentralPaymentsConnectorApi);
106
+ bind("IServiceApi").to(service_business_1.ServiceApi);
105
107
  });
package/bin/index.d.ts CHANGED
@@ -39,3 +39,4 @@ export * from "./blacklist";
39
39
  export * from "./legalDocument";
40
40
  export * from "./device";
41
41
  export * from "./observations";
42
+ export * from "./service-business";
package/bin/index.js CHANGED
@@ -55,3 +55,4 @@ __exportStar(require("./blacklist"), exports);
55
55
  __exportStar(require("./legalDocument"), exports);
56
56
  __exportStar(require("./device"), exports);
57
57
  __exportStar(require("./observations"), exports);
58
+ __exportStar(require("./service-business"), exports);
@@ -0,0 +1,27 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { IServiceApi } from "./interfaces/IServiceApi";
3
+ import { ServiceFlowEnum, ServiceMembershipStatusEnum, UpdateServiceMembershipRequest } from "@fiado/type-kit/bin/services";
4
+ import { ServiceCompanyEnum } from "@fiado/type-kit/bin/services/enums/ServiceCompanyEnum";
5
+ export declare class ServiceApi implements IServiceApi {
6
+ private httpRequest;
7
+ private readonly baseUrl;
8
+ constructor(httpRequest: IHttpRequest);
9
+ getServices(params: {
10
+ pageSize?: number;
11
+ index?: string;
12
+ company?: ServiceCompanyEnum;
13
+ flow?: ServiceFlowEnum;
14
+ }): Promise<void>;
15
+ getServiceMembershipsByDirectoryId(params: {
16
+ directoryId: string;
17
+ pageSize?: number;
18
+ index?: string;
19
+ }): Promise<void>;
20
+ getServiceMembershipsByDirectoryIdAndStatus(params: {
21
+ pageSize?: number;
22
+ index?: string;
23
+ directoryId: string;
24
+ status: ServiceMembershipStatusEnum;
25
+ }): Promise<void>;
26
+ updateServiceMembership(serviceMembershipId: string, params: UpdateServiceMembershipRequest): Promise<void>;
27
+ }
@@ -0,0 +1,77 @@
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.ServiceApi = void 0;
19
+ const inversify_1 = require("inversify");
20
+ const dotenv_1 = __importDefault(require("dotenv"));
21
+ dotenv_1.default.config();
22
+ let ServiceApi = class ServiceApi {
23
+ constructor(httpRequest) {
24
+ this.httpRequest = httpRequest;
25
+ this.baseUrl = process.env.SERVICE_BUSINESS_URL || "";
26
+ }
27
+ async getServices(params) {
28
+ const url = `${this.baseUrl}services`;
29
+ const queryParameters = [];
30
+ if (params.pageSize)
31
+ queryParameters.push(`pageSize=${params.pageSize}`);
32
+ if (params.index)
33
+ queryParameters.push(`index=${params.index}`);
34
+ if (params.company)
35
+ queryParameters.push(`status=${params.company}`);
36
+ if (params.flow)
37
+ queryParameters.push(`flow=${params.flow}`);
38
+ if (queryParameters.length > 0) {
39
+ url.concat(`?${queryParameters.join('&')}`);
40
+ }
41
+ return await this.httpRequest.get(url);
42
+ }
43
+ async getServiceMembershipsByDirectoryId(params) {
44
+ const url = `${this.baseUrl}services?directoryId=${params.directoryId}`;
45
+ const queryParameters = [];
46
+ if (params.pageSize)
47
+ queryParameters.push(`pageSize=${params.pageSize}`);
48
+ if (params.index)
49
+ queryParameters.push(`index=${params.index}`);
50
+ if (queryParameters.length > 0) {
51
+ url.concat(`${queryParameters.join('&')}`);
52
+ }
53
+ return await this.httpRequest.get(url);
54
+ }
55
+ async getServiceMembershipsByDirectoryIdAndStatus(params) {
56
+ const url = `${this.baseUrl}services/memberships/status/${params.status}?directoryId=${params.directoryId}`;
57
+ const queryParameters = [];
58
+ if (params.pageSize)
59
+ queryParameters.push(`pageSize=${params.pageSize}`);
60
+ if (params.index)
61
+ queryParameters.push(`index=${params.index}`);
62
+ if (queryParameters.length > 0) {
63
+ url.concat(`${queryParameters.join('&')}`);
64
+ }
65
+ return await this.httpRequest.get(url);
66
+ }
67
+ async updateServiceMembership(serviceMembershipId, params) {
68
+ const url = `${this.baseUrl}services/memberships/${serviceMembershipId}`;
69
+ return await this.httpRequest.put(url, params);
70
+ }
71
+ };
72
+ exports.ServiceApi = ServiceApi;
73
+ exports.ServiceApi = ServiceApi = __decorate([
74
+ (0, inversify_1.injectable)(),
75
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
76
+ __metadata("design:paramtypes", [Object])
77
+ ], ServiceApi);
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IServiceApi';
2
+ export * from './ServiceApi';
@@ -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/IServiceApi"), exports);
18
+ __exportStar(require("./ServiceApi"), exports);
@@ -0,0 +1,49 @@
1
+ import { ServiceFlowEnum, ServiceMembershipStatusEnum, UpdateServiceMembershipRequest } from "@fiado/type-kit/bin/services";
2
+ import { ServiceCompanyEnum } from "@fiado/type-kit/bin/services/enums/ServiceCompanyEnum";
3
+ /**
4
+ * Interfaz que define las operaciones que se pueden realizar en el servicio de black list.
5
+ */
6
+ export interface IServiceApi {
7
+ /**
8
+ * Consulta de membresias
9
+ * @param value valor del parametro.
10
+ * @returns Una promesa que resuelve a void.
11
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
12
+ */
13
+ getServices(params: {
14
+ pageSize?: number;
15
+ index?: string;
16
+ company?: ServiceCompanyEnum;
17
+ flow?: ServiceFlowEnum;
18
+ }): Promise<void>;
19
+ /**
20
+ * Consulta de membresias de un directorio dado un directoryId
21
+ * @param value valor del parametro.
22
+ * @returns Una promesa que resuelve a void.
23
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
24
+ */
25
+ getServiceMembershipsByDirectoryId(params: {
26
+ directoryId: string;
27
+ pageSize?: number;
28
+ index?: string;
29
+ }): Promise<void>;
30
+ /**
31
+ * Consulta de membresias de un directorio dado un directoryId y un status
32
+ * @param value valor del parametro.
33
+ * @returns Una promesa que resuelve a void.
34
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
35
+ */
36
+ getServiceMembershipsByDirectoryIdAndStatus(params: {
37
+ pageSize?: number;
38
+ index?: string;
39
+ directoryId: string;
40
+ status: ServiceMembershipStatusEnum;
41
+ }): Promise<void>;
42
+ /**
43
+ * Actualizar una membresia de un servicio
44
+ * @param value valor del parametro.
45
+ * @returns Una promesa que resuelve a void.
46
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
47
+ */
48
+ updateServiceMembership(serviceMembershipId: string, params: UpdateServiceMembershipRequest): Promise<void>;
49
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.2.43",
3
+ "version": "1.2.44",
4
4
  "description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través 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.40",
17
17
  "@fiado/http-client": "^1.0.2",
18
18
  "@fiado/logger": "^1.0.3",
19
- "@fiado/type-kit": "^1.8.6",
19
+ "@fiado/type-kit": "^1.8.15",
20
20
  "dotenv": "^16.4.5",
21
21
  "inversify": "^6.0.2",
22
22
  "reflect-metadata": "^0.2.1",
@@ -68,6 +68,7 @@ import {IObservationsApi, ObservationsApi} from "./observations";
68
68
  import CognitoApi from "./cognitoConnector/CognitoConnectorV2";
69
69
  import {CentralPaymentsConnectorApi, ICentralPaymentsConnectorApi} from "./centralPayments";
70
70
  import {InvokerUtils} from "./utils/InvokerUtils";
71
+ import { IServiceApi, ServiceApi } from "./service-business";
71
72
 
72
73
  export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
73
74
  // UTILS bindings
@@ -120,4 +121,6 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
120
121
  bind<IDeviceApi>("IDeviceApi").to(DeviceApi);
121
122
  bind<IObservationsApi>("IObservationsApi").to(ObservationsApi);
122
123
  bind<ICentralPaymentsConnectorApi>("ICentralPaymentsConnectorApi").to(CentralPaymentsConnectorApi);
124
+ bind<IServiceApi>("IServiceApi").to(ServiceApi);
125
+
123
126
  });
package/src/index.ts CHANGED
@@ -38,4 +38,5 @@ export * from "./zendesk";
38
38
  export * from "./blacklist";
39
39
  export * from "./legalDocument";
40
40
  export * from "./device";
41
- export * from "./observations";
41
+ export * from "./observations";
42
+ export * from "./service-business";
@@ -0,0 +1,61 @@
1
+ import { inject, injectable } from "inversify";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ import dotenv from 'dotenv';
4
+ import { IServiceApi } from "./interfaces/IServiceApi";
5
+ import { ServiceFlowEnum, ServiceMembershipStatusEnum, UpdateServiceMembershipRequest } from "@fiado/type-kit/bin/services";
6
+ import { ServiceCompanyEnum } from "@fiado/type-kit/bin/services/enums/ServiceCompanyEnum";
7
+ dotenv.config();
8
+
9
+ @injectable()
10
+ export class ServiceApi implements IServiceApi {
11
+ private readonly baseUrl = process.env.SERVICE_BUSINESS_URL || "";
12
+
13
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
14
+
15
+ async getServices(params: { pageSize?: number; index?: string; company?: ServiceCompanyEnum; flow?: ServiceFlowEnum; }): Promise<void> {
16
+ const url = `${this.baseUrl}services`;
17
+ const queryParameters = [];
18
+ if (params.pageSize) queryParameters.push(`pageSize=${params.pageSize}`);
19
+ if (params.index) queryParameters.push(`index=${params.index}`);
20
+ if (params.company) queryParameters.push(`status=${params.company}`);
21
+ if (params.flow) queryParameters.push(`flow=${params.flow}`);
22
+
23
+ if (queryParameters.length > 0) {
24
+ url.concat(`?${queryParameters.join('&')}`);
25
+ }
26
+
27
+ return await this.httpRequest.get(url);
28
+ }
29
+
30
+ async getServiceMembershipsByDirectoryId(params: { directoryId: string; pageSize?: number; index?: string; }): Promise<void> {
31
+ const url = `${this.baseUrl}services?directoryId=${params.directoryId}`;
32
+ const queryParameters = [];
33
+ if (params.pageSize) queryParameters.push(`pageSize=${params.pageSize}`);
34
+ if (params.index) queryParameters.push(`index=${params.index}`);
35
+
36
+ if (queryParameters.length > 0) {
37
+ url.concat(`${queryParameters.join('&')}`);
38
+ }
39
+
40
+ return await this.httpRequest.get(url);
41
+ }
42
+
43
+ async getServiceMembershipsByDirectoryIdAndStatus(params: { pageSize?: number; index?: string; directoryId: string; status: ServiceMembershipStatusEnum; }): Promise<void> {
44
+ const url = `${this.baseUrl}services/memberships/status/${params.status}?directoryId=${params.directoryId}`;
45
+
46
+ const queryParameters = [];
47
+ if (params.pageSize) queryParameters.push(`pageSize=${params.pageSize}`);
48
+ if (params.index) queryParameters.push(`index=${params.index}`);
49
+
50
+ if (queryParameters.length > 0) {
51
+ url.concat(`${queryParameters.join('&')}`);
52
+ }
53
+
54
+ return await this.httpRequest.get(url);
55
+ }
56
+ async updateServiceMembership(serviceMembershipId: string, params: UpdateServiceMembershipRequest): Promise<void> {
57
+ const url = `${this.baseUrl}services/memberships/${serviceMembershipId}`;
58
+ return await this.httpRequest.put(url, params);
59
+ }
60
+
61
+ }
@@ -0,0 +1,3 @@
1
+
2
+ export * from './interfaces/IServiceApi';
3
+ export * from './ServiceApi';
@@ -0,0 +1,44 @@
1
+ import { RegisterDeviceRequest } from "@fiado/type-kit/bin/device";
2
+ import { ServiceFlowEnum, ServiceMembershipStatusEnum, UpdateServiceMembershipRequest } from "@fiado/type-kit/bin/services";
3
+ import { ServiceCompanyEnum } from "@fiado/type-kit/bin/services/enums/ServiceCompanyEnum";
4
+
5
+ /**
6
+ * Interfaz que define las operaciones que se pueden realizar en el servicio de black list.
7
+ */
8
+ export interface IServiceApi {
9
+
10
+ /**
11
+ * Consulta de membresias
12
+ * @param value valor del parametro.
13
+ * @returns Una promesa que resuelve a void.
14
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
15
+ */
16
+ getServices(params: { pageSize?: number; index?: string; company?:ServiceCompanyEnum, flow?:ServiceFlowEnum }): Promise<void>;
17
+
18
+ /**
19
+ * Consulta de membresias de un directorio dado un directoryId
20
+ * @param value valor del parametro.
21
+ * @returns Una promesa que resuelve a void.
22
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
23
+ */
24
+ getServiceMembershipsByDirectoryId(params: { directoryId: string; pageSize?: number; index?: string; }): Promise<void>;
25
+
26
+
27
+ /**
28
+ * Consulta de membresias de un directorio dado un directoryId y un status
29
+ * @param value valor del parametro.
30
+ * @returns Una promesa que resuelve a void.
31
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
32
+ */
33
+ getServiceMembershipsByDirectoryIdAndStatus(params: { pageSize?: number; index?: string; directoryId:string,status:ServiceMembershipStatusEnum }): Promise<void>;
34
+
35
+
36
+ /**
37
+ * Actualizar una membresia de un servicio
38
+ * @param value valor del parametro.
39
+ * @returns Una promesa que resuelve a void.
40
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
41
+ */
42
+ updateServiceMembership(serviceMembershipId:string,params: UpdateServiceMembershipRequest): Promise<void>;
43
+
44
+ }