@fiado/api-invoker 1.1.79 → 1.1.80
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/bin/container.config.js +2 -0
- package/bin/disputes/DisputesApi.d.ts +12 -0
- package/bin/disputes/DisputesApi.js +44 -0
- package/bin/disputes/index.d.ts +2 -0
- package/bin/disputes/index.js +18 -0
- package/bin/disputes/interfaces/IDisputesApi.d.ts +18 -0
- package/bin/disputes/interfaces/IDisputesApi.js +2 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/package.json +1 -1
- package/src/container.config.ts +3 -0
- package/src/disputes/DisputesApi.ts +31 -0
- package/src/disputes/index.ts +3 -0
- package/src/disputes/interfaces/IDisputesApi.ts +22 -0
- package/src/index.ts +2 -1
package/bin/container.config.js
CHANGED
|
@@ -41,6 +41,7 @@ const fiadoMessages_1 = require("./fiadoMessages");
|
|
|
41
41
|
const CnbvApi_1 = __importDefault(require("./cnbv-business/CnbvApi"));
|
|
42
42
|
const TransactionApi_1 = __importDefault(require("./transaction/api/TransactionApi"));
|
|
43
43
|
const pomeloProcessor_1 = require("./pomeloProcessor");
|
|
44
|
+
const disputes_1 = require("./disputes");
|
|
44
45
|
exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
45
46
|
bind("IDirectoryApi").to(directory_1.DirectoryApi);
|
|
46
47
|
bind("IIdentityApi").to(identity_1.IdentityApi);
|
|
@@ -78,4 +79,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
|
78
79
|
bind("IFiadoMessagesApi").to(fiadoMessages_1.FiadoMessagesApi);
|
|
79
80
|
bind("ICnbvApi").to(CnbvApi_1.default);
|
|
80
81
|
bind("IPomeloProcessorApi").to(pomeloProcessor_1.PomeloProcessorApi);
|
|
82
|
+
bind("IDisputesApi").to(disputes_1.DisputesApi);
|
|
81
83
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { IDisputesApi } from "./interfaces/IDisputesApi";
|
|
3
|
+
export declare class DisputesApi implements IDisputesApi {
|
|
4
|
+
private httpRequest;
|
|
5
|
+
private readonly baseUrl;
|
|
6
|
+
constructor(httpRequest: IHttpRequest);
|
|
7
|
+
getByDirectoryId(params: {
|
|
8
|
+
directoryId: string;
|
|
9
|
+
pageSize?: number;
|
|
10
|
+
index?: string;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.DisputesApi = void 0;
|
|
19
|
+
const inversify_1 = require("inversify");
|
|
20
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
21
|
+
dotenv_1.default.config();
|
|
22
|
+
let DisputesApi = class DisputesApi {
|
|
23
|
+
constructor(httpRequest) {
|
|
24
|
+
this.httpRequest = httpRequest;
|
|
25
|
+
this.baseUrl = process.env.DISPUTES_LAMBDA_URL || "";
|
|
26
|
+
}
|
|
27
|
+
async getByDirectoryId(params) {
|
|
28
|
+
let queryParams = [];
|
|
29
|
+
if (!params.index) {
|
|
30
|
+
queryParams.push(`index=${params.index}`);
|
|
31
|
+
}
|
|
32
|
+
if (!params.pageSize) {
|
|
33
|
+
queryParams.push(`pageSize=${params.pageSize}`);
|
|
34
|
+
}
|
|
35
|
+
const url = `${this.baseUrl}disputes/${params.directoryId}?${queryParams.join('&')}`;
|
|
36
|
+
return await this.httpRequest.get(url);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.DisputesApi = DisputesApi;
|
|
40
|
+
exports.DisputesApi = DisputesApi = __decorate([
|
|
41
|
+
(0, inversify_1.injectable)(),
|
|
42
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
43
|
+
__metadata("design:paramtypes", [Object])
|
|
44
|
+
], DisputesApi);
|
|
@@ -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/IDisputesApi"), exports);
|
|
18
|
+
__exportStar(require("./DisputesApi"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interfaz que define las operaciones que se pueden realizar en el servicio de disputas.
|
|
3
|
+
*/
|
|
4
|
+
export interface IDisputesApi {
|
|
5
|
+
/**
|
|
6
|
+
* Obtener disputas por directoryId.
|
|
7
|
+
* @param directoryId DirectoryId del usuario a consultar.
|
|
8
|
+
* @param pageSize Tamaño de la página.
|
|
9
|
+
* @param index Índice de la página.
|
|
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
|
+
getByDirectoryId(params: {
|
|
14
|
+
directoryId: string;
|
|
15
|
+
pageSize?: number;
|
|
16
|
+
index?: string;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
}
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.80",
|
|
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",
|
package/src/container.config.ts
CHANGED
|
@@ -51,6 +51,7 @@ import CnbvApi from "./cnbv-business/CnbvApi";
|
|
|
51
51
|
import { ICnbvApi } from "./cnbv-business";
|
|
52
52
|
import TransactionApi from "./transaction/api/TransactionApi";
|
|
53
53
|
import { IPomeloProcessorApi, PomeloProcessorApi } from "./pomeloProcessor";
|
|
54
|
+
import { DisputesApi, IDisputesApi } from "./disputes";
|
|
54
55
|
|
|
55
56
|
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
56
57
|
bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
|
|
@@ -89,4 +90,6 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
|
|
|
89
90
|
bind<IFiadoMessagesApi>("IFiadoMessagesApi").to(FiadoMessagesApi);
|
|
90
91
|
bind<ICnbvApi>("ICnbvApi").to(CnbvApi);
|
|
91
92
|
bind<IPomeloProcessorApi>("IPomeloProcessorApi").to(PomeloProcessorApi);
|
|
93
|
+
bind<IDisputesApi>("IDisputesApi").to(DisputesApi);
|
|
94
|
+
|
|
92
95
|
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import dotenv from 'dotenv';
|
|
4
|
+
import { PeopleUpdateRequest } from "@fiado/type-kit/bin/identity";
|
|
5
|
+
import { IDisputesApi } from "./interfaces/IDisputesApi";
|
|
6
|
+
dotenv.config();
|
|
7
|
+
|
|
8
|
+
@injectable()
|
|
9
|
+
export class DisputesApi implements IDisputesApi {
|
|
10
|
+
|
|
11
|
+
private readonly baseUrl = process.env.DISPUTES_LAMBDA_URL || "";
|
|
12
|
+
|
|
13
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
async getByDirectoryId(params: { directoryId: string; pageSize?: number; index?: string; }): Promise<void> {
|
|
17
|
+
|
|
18
|
+
let queryParams = [];
|
|
19
|
+
if (!params.index) {
|
|
20
|
+
queryParams.push(`index=${params.index}`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (!params.pageSize) {
|
|
24
|
+
queryParams.push(`pageSize=${params.pageSize}`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const url = `${this.baseUrl}disputes/${params.directoryId}?${queryParams.join('&')}`;
|
|
28
|
+
return await this.httpRequest.get(url);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Interfaz que define las operaciones que se pueden realizar en el servicio de disputas.
|
|
4
|
+
*/
|
|
5
|
+
export interface IDisputesApi {
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Obtener disputas por directoryId.
|
|
9
|
+
* @param directoryId DirectoryId del usuario a consultar.
|
|
10
|
+
* @param pageSize Tamaño de la página.
|
|
11
|
+
* @param index Índice de la página.
|
|
12
|
+
* @returns Una promesa que resuelve a void.
|
|
13
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
14
|
+
*/
|
|
15
|
+
getByDirectoryId(params:{
|
|
16
|
+
directoryId:string,
|
|
17
|
+
pageSize?:number,
|
|
18
|
+
index?:string
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
}
|
package/src/index.ts
CHANGED