@fiado/api-invoker 4.32.0 → 4.34.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/directory/DirectoryApi.d.ts +5 -0
- package/bin/directory/DirectoryApi.js +13 -0
- package/bin/directory/interfaces/IDirectoryApi.d.ts +10 -0
- package/bin/uniteller-connector/api/UnitellerConnectorApi.d.ts +1 -0
- package/bin/uniteller-connector/api/UnitellerConnectorApi.js +4 -0
- package/bin/uniteller-connector/api/interfaces/IUnitellerConnectorApi.d.ts +5 -0
- package/package.json +2 -2
- package/src/directory/DirectoryApi.ts +14 -0
- package/src/directory/interfaces/IDirectoryApi.ts +7 -0
- package/src/uniteller-connector/api/UnitellerConnectorApi.ts +8 -0
- package/src/uniteller-connector/api/interfaces/IUnitellerConnectorApi.ts +9 -0
|
@@ -20,5 +20,10 @@ export declare class DirectoryApi implements IDirectoryApi {
|
|
|
20
20
|
updateUserProfile(directoryId: string, profile: Profile): Promise<void>;
|
|
21
21
|
updateStatus(directoryId: string, status: Status): Promise<void>;
|
|
22
22
|
getByPeopleId(peopleId: string): Promise<any>;
|
|
23
|
+
getDirectoryList(params: {
|
|
24
|
+
index?: string;
|
|
25
|
+
pageSize?: number;
|
|
26
|
+
sort?: "ascending" | "descending";
|
|
27
|
+
}): Promise<any>;
|
|
23
28
|
private normalizeE164Light;
|
|
24
29
|
}
|
|
@@ -132,6 +132,19 @@ let DirectoryApi = class DirectoryApi {
|
|
|
132
132
|
const operationName = "getUserInfoByParams";
|
|
133
133
|
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
134
134
|
}
|
|
135
|
+
async getDirectoryList(params) {
|
|
136
|
+
const queryParams = [];
|
|
137
|
+
if (params.index)
|
|
138
|
+
queryParams.push(`index=${encodeURIComponent(params.index)}`);
|
|
139
|
+
if (params.pageSize)
|
|
140
|
+
queryParams.push(`pageSize=${params.pageSize}`);
|
|
141
|
+
if (params.sort)
|
|
142
|
+
queryParams.push(`sort=${params.sort}`);
|
|
143
|
+
const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
|
|
144
|
+
const url = `${this.baseUrl}${queryString}`;
|
|
145
|
+
const operationName = "getAllDirectories";
|
|
146
|
+
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
147
|
+
}
|
|
135
148
|
// --- Helper ligero para E.164 limpia espacios y garantiza '+'
|
|
136
149
|
normalizeE164Light(input) {
|
|
137
150
|
if (!input)
|
|
@@ -54,4 +54,14 @@ export interface IDirectoryApi {
|
|
|
54
54
|
validateSecretNumber(directoryId: string, secretNumber: string): Promise<void>;
|
|
55
55
|
deleteDirectory(directoryId: string): Promise<void>;
|
|
56
56
|
getDirectoriesByPeopleId(peopleIds: string[]): Promise<any>;
|
|
57
|
+
/**
|
|
58
|
+
* Lista todos los directorios de usuario paginados por createDate (desc por defecto).
|
|
59
|
+
* @param params index (cursor de paginación), pageSize, sort opcional.
|
|
60
|
+
* @returns { data: { items: Directory[], index: string | null } }
|
|
61
|
+
*/
|
|
62
|
+
getDirectoryList(params: {
|
|
63
|
+
index?: string;
|
|
64
|
+
pageSize?: number;
|
|
65
|
+
sort?: "ascending" | "descending";
|
|
66
|
+
}): Promise<any>;
|
|
57
67
|
}
|
|
@@ -37,6 +37,7 @@ export default class UnitellerConnectorApi implements IUnitellerConnectorApi {
|
|
|
37
37
|
sendPreview(directoryId: string, request: RemittanceSendPreviewRequest): Promise<ApiGatewayResponse<RemittanceSendPreviewResponse>>;
|
|
38
38
|
pay(directoryId: string, request: RemittancePayRequest): Promise<ApiGatewayResponse<RemittancePayResponse>>;
|
|
39
39
|
getTransactionByMarketplaceRef(ref: string): Promise<ApiGatewayResponse<RemittancePayResponse>>;
|
|
40
|
+
getTransactionDetailByMarketplaceRef(directoryId: string, ref: string): Promise<ApiGatewayResponse<RemittanceTransactionDetail>>;
|
|
40
41
|
listTransactions(directoryId: string, filters?: RemittanceTransactionsListRequest): Promise<ApiGatewayResponse<RemittanceTransactionsListResponse>>;
|
|
41
42
|
getTransaction(directoryId: string, txNumber: string): Promise<ApiGatewayResponse<RemittanceTransactionDetail>>;
|
|
42
43
|
getTransactionReceipt(directoryId: string, txNumber: string): Promise<ApiGatewayResponse<RemittanceTransactionReceipt>>;
|
|
@@ -93,6 +93,10 @@ let UnitellerConnectorApi = class UnitellerConnectorApi {
|
|
|
93
93
|
const url = `${this.baseUrl}/transactions/by-marketplace-ref/${encodeURIComponent(ref)}`;
|
|
94
94
|
return await this.httpRequest.get(url);
|
|
95
95
|
}
|
|
96
|
+
async getTransactionDetailByMarketplaceRef(directoryId, ref) {
|
|
97
|
+
const url = `${this.baseUrl}/transactions/by-marketplace-ref/${encodeURIComponent(ref)}/detail`;
|
|
98
|
+
return await this.httpRequest.post(url, { directoryId });
|
|
99
|
+
}
|
|
96
100
|
async listTransactions(directoryId, filters) {
|
|
97
101
|
const url = `${this.baseUrl}/transactions/list`;
|
|
98
102
|
return await this.httpRequest.post(url, { directoryId, ...(filters ?? {}) });
|
|
@@ -62,6 +62,11 @@ export interface IUnitellerConnectorApi {
|
|
|
62
62
|
* Lo consume el consult() de benefits-marketplace para el cron de timeout.
|
|
63
63
|
*/
|
|
64
64
|
getTransactionByMarketplaceRef(ref: string): Promise<ApiGatewayResponse<RemittancePayResponse>>;
|
|
65
|
+
/**
|
|
66
|
+
* Detalle completo de una tx por el transactionNumber del procesador.
|
|
67
|
+
* Requiere directoryId para validar ownership y reconciliar status contra UNIR.
|
|
68
|
+
*/
|
|
69
|
+
getTransactionDetailByMarketplaceRef(directoryId: string, ref: string): Promise<ApiGatewayResponse<RemittanceTransactionDetail>>;
|
|
65
70
|
/**
|
|
66
71
|
* Historial paginado del usuario (lee RemittanceTransactions_GT, D-F7.1).
|
|
67
72
|
* Cursor estándar Fiado: `filters.index` opaco; el siguiente viene en
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.34.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.115.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -181,6 +181,20 @@ export class DirectoryApi implements IDirectoryApi {
|
|
|
181
181
|
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
+
public async getDirectoryList(params: { index?: string; pageSize?: number; sort?: "ascending" | "descending" }): Promise<any> {
|
|
185
|
+
|
|
186
|
+
const queryParams: string[] = [];
|
|
187
|
+
if (params.index) queryParams.push(`index=${encodeURIComponent(params.index)}`);
|
|
188
|
+
if (params.pageSize) queryParams.push(`pageSize=${params.pageSize}`);
|
|
189
|
+
if (params.sort) queryParams.push(`sort=${params.sort}`);
|
|
190
|
+
const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
|
|
191
|
+
|
|
192
|
+
const url = `${this.baseUrl}${queryString}`;
|
|
193
|
+
const operationName = "getAllDirectories";
|
|
194
|
+
|
|
195
|
+
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
196
|
+
}
|
|
197
|
+
|
|
184
198
|
// --- Helper ligero para E.164 limpia espacios y garantiza '+'
|
|
185
199
|
private normalizeE164Light(input?: string): string {
|
|
186
200
|
if (!input) return input as any;
|
|
@@ -69,5 +69,12 @@ export interface IDirectoryApi {
|
|
|
69
69
|
|
|
70
70
|
getDirectoriesByPeopleId(peopleIds: string[]): Promise<any>;
|
|
71
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Lista todos los directorios de usuario paginados por createDate (desc por defecto).
|
|
74
|
+
* @param params index (cursor de paginación), pageSize, sort opcional.
|
|
75
|
+
* @returns { data: { items: Directory[], index: string | null } }
|
|
76
|
+
*/
|
|
77
|
+
getDirectoryList(params: { index?: string; pageSize?: number; sort?: "ascending" | "descending" }): Promise<any>;
|
|
78
|
+
|
|
72
79
|
|
|
73
80
|
}
|
|
@@ -137,6 +137,14 @@ export default class UnitellerConnectorApi implements IUnitellerConnectorApi {
|
|
|
137
137
|
return await this.httpRequest.get(url);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
async getTransactionDetailByMarketplaceRef(
|
|
141
|
+
directoryId: string,
|
|
142
|
+
ref: string,
|
|
143
|
+
): Promise<ApiGatewayResponse<RemittanceTransactionDetail>> {
|
|
144
|
+
const url = `${this.baseUrl}/transactions/by-marketplace-ref/${encodeURIComponent(ref)}/detail`;
|
|
145
|
+
return await this.httpRequest.post(url, { directoryId });
|
|
146
|
+
}
|
|
147
|
+
|
|
140
148
|
async listTransactions(directoryId: string, filters?: RemittanceTransactionsListRequest): Promise<ApiGatewayResponse<RemittanceTransactionsListResponse>> {
|
|
141
149
|
const url = `${this.baseUrl}/transactions/list`;
|
|
142
150
|
return await this.httpRequest.post(url, { directoryId, ...(filters ?? {}) });
|
|
@@ -114,6 +114,15 @@ export interface IUnitellerConnectorApi {
|
|
|
114
114
|
*/
|
|
115
115
|
getTransactionByMarketplaceRef(ref: string): Promise<ApiGatewayResponse<RemittancePayResponse>>;
|
|
116
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Detalle completo de una tx por el transactionNumber del procesador.
|
|
119
|
+
* Requiere directoryId para validar ownership y reconciliar status contra UNIR.
|
|
120
|
+
*/
|
|
121
|
+
getTransactionDetailByMarketplaceRef(
|
|
122
|
+
directoryId: string,
|
|
123
|
+
ref: string,
|
|
124
|
+
): Promise<ApiGatewayResponse<RemittanceTransactionDetail>>;
|
|
125
|
+
|
|
117
126
|
// ─── Historial + Cancel + Recibo + SMS (F7) ─────────────────────────────────
|
|
118
127
|
|
|
119
128
|
/**
|