@fiado/api-invoker 4.20.1 → 4.20.2
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/complaint/ComplaintApi.d.ts +11 -0
- package/bin/complaint/ComplaintApi.js +34 -0
- package/bin/complaint/index.d.ts +2 -0
- package/bin/complaint/index.js +2 -0
- package/bin/complaint/interfaces/IComplaintApi.d.ts +12 -0
- package/bin/complaint/interfaces/IComplaintApi.js +1 -0
- package/bin/container.config.js +2 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/package.json +2 -2
- package/src/complaint/ComplaintApi.ts +27 -0
- package/src/complaint/index.ts +2 -0
- package/src/complaint/interfaces/IComplaintApi.ts +18 -0
- package/src/container.config.ts +2 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { ResponseOptions } from "@fiado/gateway-adapter";
|
|
3
|
+
import { CreateComplaintRequest, CreateComplaintResponse, ComplaintResponse } from "@fiado/type-kit/bin/complaint/index.js";
|
|
4
|
+
import { IComplaintApi } from "./interfaces/IComplaintApi.js";
|
|
5
|
+
export declare class ComplaintApi implements IComplaintApi {
|
|
6
|
+
private httpRequest;
|
|
7
|
+
private readonly baseUrl;
|
|
8
|
+
constructor(httpRequest: IHttpRequest);
|
|
9
|
+
createComplaint(request: CreateComplaintRequest): Promise<ResponseOptions<CreateComplaintResponse>>;
|
|
10
|
+
getComplaint(complaintId: string): Promise<ResponseOptions<ComplaintResponse>>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { inject, injectable } from "inversify";
|
|
14
|
+
let ComplaintApi = class ComplaintApi {
|
|
15
|
+
httpRequest;
|
|
16
|
+
baseUrl = process.env.COMPLAINT_MAILBOX_LAMBDA_URL || "";
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
}
|
|
20
|
+
async createComplaint(request) {
|
|
21
|
+
const url = `${this.baseUrl}backoffice/create`;
|
|
22
|
+
return await this.httpRequest.post(url, request);
|
|
23
|
+
}
|
|
24
|
+
async getComplaint(complaintId) {
|
|
25
|
+
const url = `${this.baseUrl}complaints/${complaintId}`;
|
|
26
|
+
return await this.httpRequest.get(url);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
ComplaintApi = __decorate([
|
|
30
|
+
injectable(),
|
|
31
|
+
__param(0, inject("IHttpRequest")),
|
|
32
|
+
__metadata("design:paramtypes", [Object])
|
|
33
|
+
], ComplaintApi);
|
|
34
|
+
export { ComplaintApi };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ResponseOptions } from "@fiado/gateway-adapter";
|
|
2
|
+
import { CreateComplaintRequest, CreateComplaintResponse, ComplaintResponse } from "@fiado/type-kit/bin/complaint/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Cliente del buzón anónimo de denuncias (`complaint-mailbox-business`, BO-19).
|
|
5
|
+
* URL base en `COMPLAINT_MAILBOX_LAMBDA_URL` (API Gateway privado VPC-only).
|
|
6
|
+
*/
|
|
7
|
+
export interface IComplaintApi {
|
|
8
|
+
/** Crea una denuncia. `POST /backoffice/create` */
|
|
9
|
+
createComplaint(request: CreateComplaintRequest): Promise<ResponseOptions<CreateComplaintResponse>>;
|
|
10
|
+
/** Lee una denuncia (sin exponer la identidad del denunciante). `GET /complaints/{complaintId}` */
|
|
11
|
+
getComplaint(complaintId: string): Promise<ResponseOptions<ComplaintResponse>>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/bin/container.config.js
CHANGED
|
@@ -41,6 +41,7 @@ import CnbvApi from "./cnbv-business/CnbvApi.js";
|
|
|
41
41
|
import TransactionApi from "./transaction/api/TransactionApi.js";
|
|
42
42
|
import { PomeloProcessorApi } from "./pomeloProcessor/index.js";
|
|
43
43
|
import { DisputesApi } from "./disputes/index.js";
|
|
44
|
+
import { ComplaintApi } from "./complaint/index.js";
|
|
44
45
|
import TransactionAlertApi from "./riskProfile/api/TransactionAlertApi.js";
|
|
45
46
|
import { DirectoriesApi } from "./directories/index.js";
|
|
46
47
|
import CognitoConnectorApi from "./cognitoConnector/CognitoConnectorApi.js";
|
|
@@ -152,6 +153,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
152
153
|
bind("ICnbvApi").to(CnbvApi);
|
|
153
154
|
bind("IPomeloProcessorApi").to(PomeloProcessorApi);
|
|
154
155
|
bind("IDisputesApi").to(DisputesApi);
|
|
156
|
+
bind("IComplaintApi").to(ComplaintApi);
|
|
155
157
|
bind("ITransactionAlertApi").to(TransactionAlertApi);
|
|
156
158
|
bind("IDirectoriesApi").to(DirectoriesApi);
|
|
157
159
|
bind("ICognitoConnectorApi").to(CognitoConnectorApi);
|
package/bin/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export * from "./fiadoMessages/index.js";
|
|
|
34
34
|
export * from "./cnbv-business/index.js";
|
|
35
35
|
export * from "./pomeloProcessor/index.js";
|
|
36
36
|
export * from "./disputes/index.js";
|
|
37
|
+
export * from "./complaint/index.js";
|
|
37
38
|
export * from "./directories/index.js";
|
|
38
39
|
export * from "./cognitoConnector/index.js";
|
|
39
40
|
export * from "./centralPayments/index.js";
|
package/bin/index.js
CHANGED
|
@@ -34,6 +34,7 @@ export * from "./fiadoMessages/index.js";
|
|
|
34
34
|
export * from "./cnbv-business/index.js";
|
|
35
35
|
export * from "./pomeloProcessor/index.js";
|
|
36
36
|
export * from "./disputes/index.js";
|
|
37
|
+
export * from "./complaint/index.js";
|
|
37
38
|
export * from "./directories/index.js";
|
|
38
39
|
export * from "./cognitoConnector/index.js";
|
|
39
40
|
export * from "./centralPayments/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "4.20.
|
|
3
|
+
"version": "4.20.2",
|
|
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
|
"type": "module",
|
|
6
6
|
"main": "bin/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@fiado/gateway-adapter": "^2.0.2",
|
|
35
35
|
"@fiado/http-client": "^2.0.1",
|
|
36
36
|
"@fiado/logger": "^1.1.3",
|
|
37
|
-
"@fiado/type-kit": "^3.
|
|
37
|
+
"@fiado/type-kit": "^3.77.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { ResponseOptions } from "@fiado/gateway-adapter";
|
|
4
|
+
import {
|
|
5
|
+
CreateComplaintRequest,
|
|
6
|
+
CreateComplaintResponse,
|
|
7
|
+
ComplaintResponse,
|
|
8
|
+
} from "@fiado/type-kit/bin/complaint/index.js";
|
|
9
|
+
import { IComplaintApi } from "./interfaces/IComplaintApi.js";
|
|
10
|
+
|
|
11
|
+
@injectable()
|
|
12
|
+
export class ComplaintApi implements IComplaintApi {
|
|
13
|
+
|
|
14
|
+
private readonly baseUrl = process.env.COMPLAINT_MAILBOX_LAMBDA_URL || "";
|
|
15
|
+
|
|
16
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
17
|
+
|
|
18
|
+
async createComplaint(request: CreateComplaintRequest): Promise<ResponseOptions<CreateComplaintResponse>> {
|
|
19
|
+
const url = `${this.baseUrl}backoffice/create`;
|
|
20
|
+
return await this.httpRequest.post(url, request);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async getComplaint(complaintId: string): Promise<ResponseOptions<ComplaintResponse>> {
|
|
24
|
+
const url = `${this.baseUrl}complaints/${complaintId}`;
|
|
25
|
+
return await this.httpRequest.get(url);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ResponseOptions } from "@fiado/gateway-adapter";
|
|
2
|
+
import {
|
|
3
|
+
CreateComplaintRequest,
|
|
4
|
+
CreateComplaintResponse,
|
|
5
|
+
ComplaintResponse,
|
|
6
|
+
} from "@fiado/type-kit/bin/complaint/index.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Cliente del buzón anónimo de denuncias (`complaint-mailbox-business`, BO-19).
|
|
10
|
+
* URL base en `COMPLAINT_MAILBOX_LAMBDA_URL` (API Gateway privado VPC-only).
|
|
11
|
+
*/
|
|
12
|
+
export interface IComplaintApi {
|
|
13
|
+
/** Crea una denuncia. `POST /backoffice/create` */
|
|
14
|
+
createComplaint(request: CreateComplaintRequest): Promise<ResponseOptions<CreateComplaintResponse>>;
|
|
15
|
+
|
|
16
|
+
/** Lee una denuncia (sin exponer la identidad del denunciante). `GET /complaints/{complaintId}` */
|
|
17
|
+
getComplaint(complaintId: string): Promise<ResponseOptions<ComplaintResponse>>;
|
|
18
|
+
}
|
package/src/container.config.ts
CHANGED
|
@@ -65,6 +65,7 @@ import { ICnbvApi } from "./cnbv-business/index.js";
|
|
|
65
65
|
import TransactionApi from "./transaction/api/TransactionApi.js";
|
|
66
66
|
import { IPomeloProcessorApi, PomeloProcessorApi } from "./pomeloProcessor/index.js";
|
|
67
67
|
import { DisputesApi, IDisputesApi } from "./disputes/index.js";
|
|
68
|
+
import { ComplaintApi, IComplaintApi } from "./complaint/index.js";
|
|
68
69
|
import TransactionAlertApi from "./riskProfile/api/TransactionAlertApi.js";
|
|
69
70
|
import { DirectoriesApi, IDirectoriesApi } from "./directories/index.js";
|
|
70
71
|
import { ICognitoConnectorApi, ICognitoV2Api } from "./cognitoConnector/index.js";
|
|
@@ -213,6 +214,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
213
214
|
bind<ICnbvApi>("ICnbvApi").to(CnbvApi);
|
|
214
215
|
bind<IPomeloProcessorApi>("IPomeloProcessorApi").to(PomeloProcessorApi);
|
|
215
216
|
bind<IDisputesApi>("IDisputesApi").to(DisputesApi);
|
|
217
|
+
bind<IComplaintApi>("IComplaintApi").to(ComplaintApi);
|
|
216
218
|
bind<ITransactionAlertApi>("ITransactionAlertApi").to(TransactionAlertApi);
|
|
217
219
|
bind<IDirectoriesApi>("IDirectoriesApi").to(DirectoriesApi);
|
|
218
220
|
bind<ICognitoConnectorApi>("ICognitoConnectorApi").to(CognitoConnectorApi);
|
package/src/index.ts
CHANGED
|
@@ -34,6 +34,7 @@ export * from "./fiadoMessages/index.js";
|
|
|
34
34
|
export * from "./cnbv-business/index.js";
|
|
35
35
|
export * from "./pomeloProcessor/index.js";
|
|
36
36
|
export * from "./disputes/index.js";
|
|
37
|
+
export * from "./complaint/index.js";
|
|
37
38
|
export * from "./directories/index.js";
|
|
38
39
|
export * from "./cognitoConnector/index.js";
|
|
39
40
|
export * from "./centralPayments/index.js";
|