@fiado/api-invoker 4.27.0 → 4.29.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/equality-connector/api/EqualityConnectorApi.d.ts +5 -0
- package/bin/equality-connector/api/EqualityConnectorApi.js +7 -0
- package/bin/equality-connector/api/interfaces/IEqualityConnectorApi.d.ts +15 -4
- package/bin/transactionProcessor/api/TransactionProcessorApi.js +3 -3
- package/package.json +2 -2
- package/src/equality-connector/api/EqualityConnectorApi.ts +10 -0
- package/src/equality-connector/api/interfaces/IEqualityConnectorApi.ts +15 -4
- package/src/transactionProcessor/api/TransactionProcessorApi.ts +3 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
|
|
3
4
|
import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, CancelFundingReferenceRequest, CancelFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
4
5
|
import { IEqualityConnectorApi } from "./interfaces/IEqualityConnectorApi.js";
|
|
5
6
|
export default class EqualityConnectorApi implements IEqualityConnectorApi {
|
|
@@ -9,4 +10,8 @@ export default class EqualityConnectorApi implements IEqualityConnectorApi {
|
|
|
9
10
|
createFundingReference(request: CreateFundingReferenceRequest): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
|
|
10
11
|
cancelFundingReference(fundingId: string, request: CancelFundingReferenceRequest): Promise<ApiGatewayResponse<CancelFundingReferenceResponse>>;
|
|
11
12
|
listFundingReferences(directoryId: string, status?: string): Promise<ApiGatewayResponse<ListFundingReferencesResponse>>;
|
|
13
|
+
getStandardCatalog(query: {
|
|
14
|
+
benefitId: string;
|
|
15
|
+
includeDisabled?: boolean;
|
|
16
|
+
}): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
|
|
12
17
|
}
|
|
@@ -32,6 +32,13 @@ let EqualityConnectorApi = class EqualityConnectorApi {
|
|
|
32
32
|
const url = `${this.baseUrl}/funding/references?${params.toString()}`;
|
|
33
33
|
return await this.httpRequest.get(url);
|
|
34
34
|
}
|
|
35
|
+
async getStandardCatalog(query) {
|
|
36
|
+
const params = new URLSearchParams({ benefitId: query.benefitId });
|
|
37
|
+
if (query.includeDisabled)
|
|
38
|
+
params.set("includeDisabled", "true");
|
|
39
|
+
const url = `${this.baseUrl}/catalog/standard?${params.toString()}`;
|
|
40
|
+
return await this.httpRequest.get(url);
|
|
41
|
+
}
|
|
35
42
|
};
|
|
36
43
|
EqualityConnectorApi = __decorate([
|
|
37
44
|
injectable(),
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
|
|
2
3
|
import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, CancelFundingReferenceRequest, CancelFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
3
4
|
/**
|
|
4
5
|
* Cliente del marketplace hacia equality-connector (privado, dentro de la VPC).
|
|
5
6
|
*
|
|
6
|
-
* Lo consume exclusivamente `EqualityFundingPublisher`
|
|
7
|
-
* Ningún otro lambda conoce este cliente.
|
|
7
|
+
* Lo consume exclusivamente `EqualityFundingPublisher` + `EqualityCatalogPublisher`
|
|
8
|
+
* del benefits-marketplace-business. Ningún otro lambda conoce este cliente.
|
|
8
9
|
*
|
|
9
10
|
* Endpoints backend en equality-connector:
|
|
10
|
-
* - POST /funding
|
|
11
|
-
* - POST /funding/{fundingId}/cancel
|
|
11
|
+
* - POST /funding (privado VPC)
|
|
12
|
+
* - POST /funding/{fundingId}/cancel (privado VPC)
|
|
12
13
|
* - GET /funding/references?directoryId=&status= (privado VPC)
|
|
14
|
+
* - GET /catalog/standard?benefitId=&includeDisabled= (privado VPC) — patron canonico Centro de Beneficios
|
|
13
15
|
*/
|
|
14
16
|
export interface IEqualityConnectorApi {
|
|
15
17
|
/** Genera una referencia de fondeo en Passport via el connector. */
|
|
@@ -21,4 +23,13 @@ export interface IEqualityConnectorApi {
|
|
|
21
23
|
* Status default (cuando no se pasa) lo decide el connector — hoy: ACTIVE.
|
|
22
24
|
*/
|
|
23
25
|
listFundingReferences(directoryId: string, status?: string): Promise<ApiGatewayResponse<ListFundingReferencesResponse>>;
|
|
26
|
+
/**
|
|
27
|
+
* Devuelve el catalogo standard de productos de wallet-funding del connector.
|
|
28
|
+
* Patron canonico del Centro de Beneficios — el marketplace lo consume via
|
|
29
|
+
* `IConnectorCatalogPublisher.getStandardCatalog` (mismo flow que STP/Multicomm).
|
|
30
|
+
*/
|
|
31
|
+
getStandardCatalog(query: {
|
|
32
|
+
benefitId: string;
|
|
33
|
+
includeDisabled?: boolean;
|
|
34
|
+
}): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
|
|
24
35
|
}
|
|
@@ -46,15 +46,15 @@ let TransactionProcessorApi = class TransactionProcessorApi {
|
|
|
46
46
|
return await this.httpRequest.post(url, request);
|
|
47
47
|
}
|
|
48
48
|
async walletFundingValidate(request) {
|
|
49
|
-
const url = `${this.baseUrl}
|
|
49
|
+
const url = `${this.baseUrl}wallet-funding/validate`;
|
|
50
50
|
return await this.httpRequest.post(url, request);
|
|
51
51
|
}
|
|
52
52
|
async walletFundingCredit(request) {
|
|
53
|
-
const url = `${this.baseUrl}
|
|
53
|
+
const url = `${this.baseUrl}wallet-funding/credit`;
|
|
54
54
|
return await this.httpRequest.post(url, request);
|
|
55
55
|
}
|
|
56
56
|
async walletFundingReverse(request) {
|
|
57
|
-
const url = `${this.baseUrl}
|
|
57
|
+
const url = `${this.baseUrl}wallet-funding/reverse`;
|
|
58
58
|
return await this.httpRequest.post(url, request);
|
|
59
59
|
}
|
|
60
60
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.29.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.94.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { inject, injectable } from "inversify";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
3
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
4
|
+
import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
|
|
4
5
|
import {
|
|
5
6
|
CreateFundingReferenceRequest,
|
|
6
7
|
CreateFundingReferenceResponse,
|
|
@@ -40,4 +41,13 @@ export default class EqualityConnectorApi implements IEqualityConnectorApi {
|
|
|
40
41
|
const url = `${this.baseUrl}/funding/references?${params.toString()}`;
|
|
41
42
|
return await this.httpRequest.get(url);
|
|
42
43
|
}
|
|
44
|
+
|
|
45
|
+
async getStandardCatalog(
|
|
46
|
+
query: { benefitId: string; includeDisabled?: boolean },
|
|
47
|
+
): Promise<ApiGatewayResponse<ConnectorCatalogResponse>> {
|
|
48
|
+
const params = new URLSearchParams({ benefitId: query.benefitId });
|
|
49
|
+
if (query.includeDisabled) params.set("includeDisabled", "true");
|
|
50
|
+
const url = `${this.baseUrl}/catalog/standard?${params.toString()}`;
|
|
51
|
+
return await this.httpRequest.get(url);
|
|
52
|
+
}
|
|
43
53
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
|
|
2
3
|
import {
|
|
3
4
|
CreateFundingReferenceRequest,
|
|
4
5
|
CreateFundingReferenceResponse,
|
|
@@ -10,13 +11,14 @@ import {
|
|
|
10
11
|
/**
|
|
11
12
|
* Cliente del marketplace hacia equality-connector (privado, dentro de la VPC).
|
|
12
13
|
*
|
|
13
|
-
* Lo consume exclusivamente `EqualityFundingPublisher`
|
|
14
|
-
* Ningún otro lambda conoce este cliente.
|
|
14
|
+
* Lo consume exclusivamente `EqualityFundingPublisher` + `EqualityCatalogPublisher`
|
|
15
|
+
* del benefits-marketplace-business. Ningún otro lambda conoce este cliente.
|
|
15
16
|
*
|
|
16
17
|
* Endpoints backend en equality-connector:
|
|
17
|
-
* - POST /funding
|
|
18
|
-
* - POST /funding/{fundingId}/cancel
|
|
18
|
+
* - POST /funding (privado VPC)
|
|
19
|
+
* - POST /funding/{fundingId}/cancel (privado VPC)
|
|
19
20
|
* - GET /funding/references?directoryId=&status= (privado VPC)
|
|
21
|
+
* - GET /catalog/standard?benefitId=&includeDisabled= (privado VPC) — patron canonico Centro de Beneficios
|
|
20
22
|
*/
|
|
21
23
|
export interface IEqualityConnectorApi {
|
|
22
24
|
/** Genera una referencia de fondeo en Passport via el connector. */
|
|
@@ -38,4 +40,13 @@ export interface IEqualityConnectorApi {
|
|
|
38
40
|
directoryId: string,
|
|
39
41
|
status?: string,
|
|
40
42
|
): Promise<ApiGatewayResponse<ListFundingReferencesResponse>>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Devuelve el catalogo standard de productos de wallet-funding del connector.
|
|
46
|
+
* Patron canonico del Centro de Beneficios — el marketplace lo consume via
|
|
47
|
+
* `IConnectorCatalogPublisher.getStandardCatalog` (mismo flow que STP/Multicomm).
|
|
48
|
+
*/
|
|
49
|
+
getStandardCatalog(
|
|
50
|
+
query: { benefitId: string; includeDisabled?: boolean },
|
|
51
|
+
): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
|
|
41
52
|
}
|
|
@@ -68,21 +68,21 @@ export default class TransactionProcessorApi implements ITransactionProcessorApi
|
|
|
68
68
|
async walletFundingValidate(
|
|
69
69
|
request: ValidateWalletFundingRequest,
|
|
70
70
|
): Promise<ApiGatewayResponse<ValidateWalletFundingResponse>> {
|
|
71
|
-
const url = `${this.baseUrl}
|
|
71
|
+
const url = `${this.baseUrl}wallet-funding/validate`;
|
|
72
72
|
return await this.httpRequest.post(url, request);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
async walletFundingCredit(
|
|
76
76
|
request: CreditWalletFundingRequest,
|
|
77
77
|
): Promise<ApiGatewayResponse<CreditWalletFundingResponse>> {
|
|
78
|
-
const url = `${this.baseUrl}
|
|
78
|
+
const url = `${this.baseUrl}wallet-funding/credit`;
|
|
79
79
|
return await this.httpRequest.post(url, request);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
async walletFundingReverse(
|
|
83
83
|
request: ReverseWalletFundingRequest,
|
|
84
84
|
): Promise<ApiGatewayResponse<ReverseWalletFundingResponse>> {
|
|
85
|
-
const url = `${this.baseUrl}
|
|
85
|
+
const url = `${this.baseUrl}wallet-funding/reverse`;
|
|
86
86
|
return await this.httpRequest.post(url, request);
|
|
87
87
|
}
|
|
88
88
|
}
|