@fiado/api-invoker 4.22.0 → 4.23.0
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/disputes/DisputesApi.d.ts +5 -0
- package/bin/disputes/DisputesApi.js +4 -0
- package/bin/disputes/interfaces/IDisputesApi.d.ts +12 -0
- package/bin/transaction/api/TransactionApi.d.ts +8 -1
- package/bin/transaction/api/TransactionApi.js +15 -0
- package/bin/transaction/api/interfaces/ITransactionApi.d.ts +14 -1
- package/package.json +2 -2
- package/src/disputes/DisputesApi.ts +7 -1
- package/src/disputes/interfaces/IDisputesApi.ts +13 -0
- package/src/transaction/api/TransactionApi.ts +21 -1
- package/src/transaction/api/interfaces/ITransactionApi.ts +15 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { UpdateR27StatusRequest, UpdateR27StatusResponse } from "@fiado/type-kit/bin/transaction/index.js";
|
|
2
3
|
import { IDisputesApi } from "./interfaces/IDisputesApi.js";
|
|
3
4
|
export declare class DisputesApi implements IDisputesApi {
|
|
4
5
|
private httpRequest;
|
|
@@ -21,4 +22,8 @@ export declare class DisputesApi implements IDisputesApi {
|
|
|
21
22
|
pageSize?: number;
|
|
22
23
|
index?: string;
|
|
23
24
|
}): Promise<void>;
|
|
25
|
+
updateR27Status(params: {
|
|
26
|
+
disputeId: string;
|
|
27
|
+
request: UpdateR27StatusRequest;
|
|
28
|
+
}): Promise<UpdateR27StatusResponse>;
|
|
24
29
|
}
|
|
@@ -47,6 +47,10 @@ let DisputesApi = class DisputesApi {
|
|
|
47
47
|
const url = `${this.baseUrl}disputes/${params.directoryId}?${queryParams.join('&')}`;
|
|
48
48
|
return await this.httpRequest.get(url);
|
|
49
49
|
}
|
|
50
|
+
async updateR27Status(params) {
|
|
51
|
+
const url = `${this.baseUrl}disputes/${params.disputeId}/r27-status`;
|
|
52
|
+
return await this.httpRequest.post(url, params.request);
|
|
53
|
+
}
|
|
50
54
|
};
|
|
51
55
|
DisputesApi = __decorate([
|
|
52
56
|
injectable(),
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
import { UpdateR27StatusRequest, UpdateR27StatusResponse } from "@fiado/type-kit/bin/transaction/index.js";
|
|
1
2
|
/**
|
|
2
3
|
* Interfaz que define las operaciones que se pueden realizar en el servicio de disputas.
|
|
3
4
|
*/
|
|
4
5
|
export interface IDisputesApi {
|
|
6
|
+
/**
|
|
7
|
+
* Cierra un folio R27 cuando el Titular UNE firma el dictamen (BO-R27).
|
|
8
|
+
* POST disputes/{id}/r27-status (privado, VPC/VPN). Transiciona 101->102 / 103->104
|
|
9
|
+
* y persiste la metadata del dictamen.
|
|
10
|
+
* @param disputeId Id de la disputa/folio.
|
|
11
|
+
* @param request Datos del dictamen (newR27Status, resolutionCause, firma, etc.).
|
|
12
|
+
*/
|
|
13
|
+
updateR27Status(params: {
|
|
14
|
+
disputeId: string;
|
|
15
|
+
request: UpdateR27StatusRequest;
|
|
16
|
+
}): Promise<UpdateR27StatusResponse>;
|
|
5
17
|
/**
|
|
6
18
|
* Obtener disputas por directoryId.
|
|
7
19
|
* @param directoryId DirectoryId del usuario a consultar.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { ITransactionApi } from "./interfaces/ITransactionApi.js";
|
|
3
|
-
import { TransactionGetResponse, TransactionSourceEnum } from "@fiado/type-kit/bin/transaction/index.js";
|
|
3
|
+
import { TransactionGetResponse, TransactionSourceEnum, CounterQueryResponse } from "@fiado/type-kit/bin/transaction/index.js";
|
|
4
4
|
import { Provider } from "@fiado/type-kit/bin/provider/index.js";
|
|
5
5
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
6
6
|
export default class TransactionApi implements ITransactionApi {
|
|
@@ -52,6 +52,13 @@ export default class TransactionApi implements ITransactionApi {
|
|
|
52
52
|
startDate?: string;
|
|
53
53
|
endDate?: string;
|
|
54
54
|
}): Promise<FiadoApiResponse<TransactionGetResponse>>;
|
|
55
|
+
getCountersByDirectory(params: {
|
|
56
|
+
directoryId: string;
|
|
57
|
+
counterIds: string[];
|
|
58
|
+
windows?: string[];
|
|
59
|
+
from?: string;
|
|
60
|
+
to?: string;
|
|
61
|
+
}): Promise<FiadoApiResponse<CounterQueryResponse>>;
|
|
55
62
|
getTransactionByProviderIdAndDirectoryId(params: {
|
|
56
63
|
providerId: Provider;
|
|
57
64
|
directoryId: string;
|
|
@@ -89,6 +89,21 @@ let TransactionApi = class TransactionApi {
|
|
|
89
89
|
const url = `${this.baseUrl}private/transaction/${params.source}/renewals?${queryParams.join('&')}`;
|
|
90
90
|
return await this.httpRequest.get(url);
|
|
91
91
|
}
|
|
92
|
+
async getCountersByDirectory(params) {
|
|
93
|
+
const queryParams = [];
|
|
94
|
+
for (const id of params.counterIds)
|
|
95
|
+
queryParams.push(`counterIds=${encodeURIComponent(id)}`);
|
|
96
|
+
if (params.windows)
|
|
97
|
+
for (const w of params.windows)
|
|
98
|
+
queryParams.push(`windows=${encodeURIComponent(w)}`);
|
|
99
|
+
if (params.from)
|
|
100
|
+
queryParams.push(`from=${encodeURIComponent(params.from)}`);
|
|
101
|
+
if (params.to)
|
|
102
|
+
queryParams.push(`to=${encodeURIComponent(params.to)}`);
|
|
103
|
+
const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
|
|
104
|
+
const url = `${this.baseUrl}private/counters/directory/${params.directoryId}${queryString}`;
|
|
105
|
+
return await this.httpRequest.get(url);
|
|
106
|
+
}
|
|
92
107
|
async getTransactionByProviderIdAndDirectoryId(params) {
|
|
93
108
|
let queryParams = [];
|
|
94
109
|
if (params.page)
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
2
|
import { Provider } from "@fiado/type-kit/bin/provider/index.js";
|
|
3
|
-
import { TransactionGetResponse, TransactionSourceEnum } from "@fiado/type-kit/bin/transaction/index.js";
|
|
3
|
+
import { TransactionGetResponse, TransactionSourceEnum, CounterQueryResponse } from "@fiado/type-kit/bin/transaction/index.js";
|
|
4
4
|
export interface ITransactionApi {
|
|
5
|
+
/**
|
|
6
|
+
* Contadores agregados de un cliente desde transaction-business
|
|
7
|
+
* (GET /private/counters/directory/{directoryId}). Reemplaza a los
|
|
8
|
+
* contadores de activity-business (en deprecación). Acepta ventana de
|
|
9
|
+
* rango opcional [from,to] (fechas MX YYYY-MM-DD).
|
|
10
|
+
*/
|
|
11
|
+
getCountersByDirectory(params: {
|
|
12
|
+
directoryId: string;
|
|
13
|
+
counterIds: string[];
|
|
14
|
+
windows?: string[];
|
|
15
|
+
from?: string;
|
|
16
|
+
to?: string;
|
|
17
|
+
}): Promise<FiadoApiResponse<CounterQueryResponse>>;
|
|
5
18
|
getTransactionsByDirectoryIdAndSource(params: {
|
|
6
19
|
directoryId: string;
|
|
7
20
|
source: TransactionSourceEnum;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.23.0",
|
|
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.83.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -2,6 +2,7 @@ import { inject, injectable } from "inversify";
|
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
3
|
import dotenv from 'dotenv';
|
|
4
4
|
import { PeopleUpdateRequest } from "@fiado/type-kit/bin/identity/index.js";
|
|
5
|
+
import { UpdateR27StatusRequest, UpdateR27StatusResponse } from "@fiado/type-kit/bin/transaction/index.js";
|
|
5
6
|
import { IDisputesApi } from "./interfaces/IDisputesApi.js";
|
|
6
7
|
dotenv.config();
|
|
7
8
|
|
|
@@ -47,5 +48,10 @@ export class DisputesApi implements IDisputesApi {
|
|
|
47
48
|
const url = `${this.baseUrl}disputes/${params.directoryId}?${queryParams.join('&')}`;
|
|
48
49
|
return await this.httpRequest.get(url);
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
+
|
|
52
|
+
async updateR27Status(params: { disputeId: string; request: UpdateR27StatusRequest }): Promise<UpdateR27StatusResponse> {
|
|
53
|
+
const url = `${this.baseUrl}disputes/${params.disputeId}/r27-status`;
|
|
54
|
+
return await this.httpRequest.post(url, params.request);
|
|
55
|
+
}
|
|
56
|
+
|
|
51
57
|
}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
+
import { UpdateR27StatusRequest, UpdateR27StatusResponse } from "@fiado/type-kit/bin/transaction/index.js";
|
|
1
2
|
|
|
2
3
|
/**
|
|
3
4
|
* Interfaz que define las operaciones que se pueden realizar en el servicio de disputas.
|
|
4
5
|
*/
|
|
5
6
|
export interface IDisputesApi {
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Cierra un folio R27 cuando el Titular UNE firma el dictamen (BO-R27).
|
|
10
|
+
* POST disputes/{id}/r27-status (privado, VPC/VPN). Transiciona 101->102 / 103->104
|
|
11
|
+
* y persiste la metadata del dictamen.
|
|
12
|
+
* @param disputeId Id de la disputa/folio.
|
|
13
|
+
* @param request Datos del dictamen (newR27Status, resolutionCause, firma, etc.).
|
|
14
|
+
*/
|
|
15
|
+
updateR27Status(params: {
|
|
16
|
+
disputeId: string,
|
|
17
|
+
request: UpdateR27StatusRequest
|
|
18
|
+
}): Promise<UpdateR27StatusResponse>;
|
|
19
|
+
|
|
7
20
|
/**
|
|
8
21
|
* Obtener disputas por directoryId.
|
|
9
22
|
* @param directoryId DirectoryId del usuario a consultar.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { inject, injectable } from "inversify";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
3
|
import { ITransactionApi } from "./interfaces/ITransactionApi.js";
|
|
4
|
-
import { TransactionGetResponse, TransactionSourceEnum } from "@fiado/type-kit/bin/transaction/index.js";
|
|
4
|
+
import { TransactionGetResponse, TransactionSourceEnum, CounterQueryResponse } from "@fiado/type-kit/bin/transaction/index.js";
|
|
5
5
|
import { Provider } from "@fiado/type-kit/bin/provider/index.js";
|
|
6
6
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
7
7
|
|
|
@@ -128,6 +128,26 @@ export default class TransactionApi implements ITransactionApi {
|
|
|
128
128
|
return await this.httpRequest.get(url);
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
async getCountersByDirectory(params: {
|
|
132
|
+
directoryId: string;
|
|
133
|
+
counterIds: string[];
|
|
134
|
+
windows?: string[];
|
|
135
|
+
from?: string;
|
|
136
|
+
to?: string;
|
|
137
|
+
}): Promise<FiadoApiResponse<CounterQueryResponse>> {
|
|
138
|
+
|
|
139
|
+
const queryParams: string[] = [];
|
|
140
|
+
for (const id of params.counterIds) queryParams.push(`counterIds=${encodeURIComponent(id)}`);
|
|
141
|
+
if (params.windows) for (const w of params.windows) queryParams.push(`windows=${encodeURIComponent(w)}`);
|
|
142
|
+
if (params.from) queryParams.push(`from=${encodeURIComponent(params.from)}`);
|
|
143
|
+
if (params.to) queryParams.push(`to=${encodeURIComponent(params.to)}`);
|
|
144
|
+
|
|
145
|
+
const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
|
|
146
|
+
const url: string = `${this.baseUrl}private/counters/directory/${params.directoryId}${queryString}`;
|
|
147
|
+
|
|
148
|
+
return await this.httpRequest.get(url);
|
|
149
|
+
}
|
|
150
|
+
|
|
131
151
|
async getTransactionByProviderIdAndDirectoryId(params: {
|
|
132
152
|
providerId: Provider;
|
|
133
153
|
directoryId: string;
|
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
2
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
3
3
|
import { Provider } from "@fiado/type-kit/bin/provider/index.js";
|
|
4
|
-
import { TransactionGetResponse, TransactionSourceEnum } from "@fiado/type-kit/bin/transaction/index.js";
|
|
4
|
+
import { TransactionGetResponse, TransactionSourceEnum, CounterQueryResponse } from "@fiado/type-kit/bin/transaction/index.js";
|
|
5
5
|
|
|
6
6
|
export interface ITransactionApi {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Contadores agregados de un cliente desde transaction-business
|
|
10
|
+
* (GET /private/counters/directory/{directoryId}). Reemplaza a los
|
|
11
|
+
* contadores de activity-business (en deprecación). Acepta ventana de
|
|
12
|
+
* rango opcional [from,to] (fechas MX YYYY-MM-DD).
|
|
13
|
+
*/
|
|
14
|
+
getCountersByDirectory(params: {
|
|
15
|
+
directoryId: string;
|
|
16
|
+
counterIds: string[];
|
|
17
|
+
windows?: string[];
|
|
18
|
+
from?: string;
|
|
19
|
+
to?: string;
|
|
20
|
+
}): Promise<FiadoApiResponse<CounterQueryResponse>>;
|
|
7
21
|
|
|
8
22
|
getTransactionsByDirectoryIdAndSource(params: {
|
|
9
23
|
directoryId: string;
|