@fiado/api-invoker 5.57.0 → 5.59.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/loanOfferings/api/LoanOfferingsBusinessApi.d.ts +2 -1
- package/bin/loanOfferings/api/LoanOfferingsBusinessApi.js +8 -0
- package/bin/loanOfferings/api/interfaces/ILoanOfferingsBusinessApi.d.ts +11 -1
- package/bin/transactionProcessor/api/TransactionProcessorApi.d.ts +2 -1
- package/bin/transactionProcessor/api/TransactionProcessorApi.js +4 -0
- package/bin/transactionProcessor/api/interfaces/ITransactionProcessorApi.d.ts +11 -1
- package/package.json +2 -2
- package/src/loanOfferings/api/LoanOfferingsBusinessApi.ts +14 -0
- package/src/loanOfferings/api/interfaces/ILoanOfferingsBusinessApi.ts +18 -0
- package/src/transactionProcessor/api/TransactionProcessorApi.ts +9 -0
- package/src/transactionProcessor/api/interfaces/ITransactionProcessorApi.ts +15 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
3
|
-
import { ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanResponse, FinancierResponse, ReservePromotionBonusRequest, ReservePromotionBonusResponse, ResolveCustomerSegmentsRequest, ResolveCustomerSegmentsResponse, SkuPromotionsResponse, SettlePromotionBonusRequest, PromotionBonusResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
3
|
+
import { ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanLevelEnum, CreditPlanResponse, FinancierResponse, ReservePromotionBonusRequest, ReservePromotionBonusResponse, ResolveCustomerSegmentsRequest, ResolveCustomerSegmentsResponse, ScopeWidePromotionsResponse, SkuPromotionsResponse, SettlePromotionBonusRequest, PromotionBonusResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
4
4
|
import { ILoanOfferingsBusinessApi } from "./interfaces/ILoanOfferingsBusinessApi.js";
|
|
5
5
|
/**
|
|
6
6
|
* Publisher HTTP del lambda `loan-offerings-business` (componente 07 SureKeep Fase 1) para sus
|
|
@@ -28,4 +28,5 @@ export default class LoanOfferingsBusinessApi implements ILoanOfferingsBusinessA
|
|
|
28
28
|
reservePromotionBonus(promotionId: string, input: ReservePromotionBonusRequest, tenantId: string): Promise<StandardResponse<ReservePromotionBonusResponse>>;
|
|
29
29
|
settlePromotionBonus(promotionId: string, input: SettlePromotionBonusRequest, tenantId: string): Promise<StandardResponse<PromotionBonusResponse>>;
|
|
30
30
|
listSkuPromotions(storeId: string, tenantId: string): Promise<StandardResponse<SkuPromotionsResponse>>;
|
|
31
|
+
listScopeWidePromotions(storeId: string, tenantId: string, level?: CreditPlanLevelEnum, segmentId?: string): Promise<StandardResponse<ScopeWidePromotionsResponse>>;
|
|
31
32
|
}
|
|
@@ -70,6 +70,14 @@ let LoanOfferingsBusinessApi = class LoanOfferingsBusinessApi {
|
|
|
70
70
|
const url = `${this.baseUrl}/private/promotions/by-sku?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
|
|
71
71
|
return await this.httpRequest.get(url);
|
|
72
72
|
}
|
|
73
|
+
async listScopeWidePromotions(storeId, tenantId, level, segmentId) {
|
|
74
|
+
let url = `${this.baseUrl}/private/promotions/scope-wide?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
|
|
75
|
+
if (level)
|
|
76
|
+
url += `&level=${encodeURIComponent(level)}`;
|
|
77
|
+
if (segmentId)
|
|
78
|
+
url += `&segmentId=${encodeURIComponent(segmentId)}`;
|
|
79
|
+
return await this.httpRequest.get(url);
|
|
80
|
+
}
|
|
73
81
|
};
|
|
74
82
|
LoanOfferingsBusinessApi = __decorate([
|
|
75
83
|
injectable(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
|
-
import { ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanResponse, FinancierResponse, ReservePromotionBonusRequest, ReservePromotionBonusResponse, ResolveCustomerSegmentsRequest, ResolveCustomerSegmentsResponse, SkuPromotionsResponse, SettlePromotionBonusRequest, PromotionBonusResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
2
|
+
import { ConsumePromotionRequest, PromotedSkusResponse, ConsumePromotionResponse, CreditPlanLevelEnum, CreditPlanResponse, FinancierResponse, ReservePromotionBonusRequest, ReservePromotionBonusResponse, ResolveCustomerSegmentsRequest, ResolveCustomerSegmentsResponse, ScopeWidePromotionsResponse, SkuPromotionsResponse, SettlePromotionBonusRequest, PromotionBonusResponse, SimulateCreditPlanRequest, SimulationResultResponse } from "@fiado/type-kit/bin/loanOfferings/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Contrato del publisher HTTP del lambda `loan-offerings-business` (componente 07 SureKeep Fase 1)
|
|
5
5
|
* para sus endpoints privados service-to-service (VPC-only): LECTURAS del catálogo SOFOM y
|
|
@@ -117,4 +117,14 @@ export interface ILoanOfferingsBusinessApi {
|
|
|
117
117
|
* Es el detalle del panel del paso 03; el badge lo resuelve {@link listPromotedSkus}.
|
|
118
118
|
*/
|
|
119
119
|
listSkuPromotions(storeId: string, tenantId: string): Promise<StandardResponse<SkuPromotionsResponse>>;
|
|
120
|
+
/**
|
|
121
|
+
* `GET /private/promotions/scope-wide` — promociones que NO acotan por SKU (tienda, nivel,
|
|
122
|
+
* segmento o universales), para el banner de pantalla completa del paso 03 del wizard.
|
|
123
|
+
*
|
|
124
|
+
* `level`/`segmentId` son opcionales: si el score todavía no corrió o el segmento no se
|
|
125
|
+
* resolvió, se omiten y el lambda destino descarta las promociones que acotan por esa
|
|
126
|
+
* dimensión (mismo criterio que `listSkuPromotions`/`by-sku`). Devuelve `{ items: [] }` si no
|
|
127
|
+
* hay ninguna vigente; nunca 404.
|
|
128
|
+
*/
|
|
129
|
+
listScopeWidePromotions(storeId: string, tenantId: string, level?: CreditPlanLevelEnum, segmentId?: string): Promise<StandardResponse<ScopeWidePromotionsResponse>>;
|
|
120
130
|
}
|
|
@@ -4,7 +4,7 @@ import { AuthorizeCollectorOrderRequest, AuthorizeCollectorOrderResponse, Author
|
|
|
4
4
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
5
5
|
import { ValidateWalletFundingRequest, ValidateWalletFundingResponse, CreditWalletFundingRequest, CreditWalletFundingResponse, ReverseWalletFundingRequest, ReverseWalletFundingResponse, GetWalletFundingLimitRequest, GetWalletFundingLimitResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
6
6
|
import { RemittanceCreditBackRequest, RemittanceCreditBackResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
7
|
-
import { AuthorizeCollectionMovementRequest, AuthorizeCollectionMovementResponse } from "@fiado/type-kit/bin/collection/index.js";
|
|
7
|
+
import { AuthorizeCollectionMovementRequest, AuthorizeCollectionMovementResponse, CaptureCollectionHoldRequest, CaptureCollectionHoldResponse } from "@fiado/type-kit/bin/collection/index.js";
|
|
8
8
|
type ProcessUpdateLevelRequest = import("@fiado/type-kit/bin/transactionProcessor/dtos/ProcessUpdateLevelRequest.js").default;
|
|
9
9
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
10
10
|
export default class TransactionProcessorApi implements ITransactionProcessorApi {
|
|
@@ -24,6 +24,7 @@ export default class TransactionProcessorApi implements ITransactionProcessorApi
|
|
|
24
24
|
walletFundingGetLimit(request: GetWalletFundingLimitRequest): Promise<ApiGatewayResponse<GetWalletFundingLimitResponse>>;
|
|
25
25
|
creditBack(request: RemittanceCreditBackRequest): Promise<FiadoApiResponse<RemittanceCreditBackResponse>>;
|
|
26
26
|
authorizeCollectionMovement(request: AuthorizeCollectionMovementRequest): Promise<FiadoApiResponse<AuthorizeCollectionMovementResponse>>;
|
|
27
|
+
captureCollectionHold(request: CaptureCollectionHoldRequest): Promise<FiadoApiResponse<CaptureCollectionHoldResponse>>;
|
|
27
28
|
authorizeWelcomeBonus(request: AuthorizeBonusRequest): Promise<FiadoApiResponse<TransactionProcessorResponse>>;
|
|
28
29
|
}
|
|
29
30
|
export {};
|
|
@@ -69,6 +69,10 @@ let TransactionProcessorApi = class TransactionProcessorApi {
|
|
|
69
69
|
const url = `${this.baseUrl}collection/authorize`;
|
|
70
70
|
return await this.httpRequest.post(url, request);
|
|
71
71
|
}
|
|
72
|
+
async captureCollectionHold(request) {
|
|
73
|
+
const url = `${this.baseUrl}collection/capture`;
|
|
74
|
+
return await this.httpRequest.post(url, request);
|
|
75
|
+
}
|
|
72
76
|
async authorizeWelcomeBonus(request) {
|
|
73
77
|
const url = `${this.baseUrl}bonus/authorize`;
|
|
74
78
|
return await this.httpRequest.post(url, request);
|
|
@@ -3,7 +3,7 @@ import { AuthorizeCollectorOrderRequest, AuthorizeCollectorOrderResponse, Author
|
|
|
3
3
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
4
4
|
import { ValidateWalletFundingRequest, ValidateWalletFundingResponse, CreditWalletFundingRequest, CreditWalletFundingResponse, ReverseWalletFundingRequest, ReverseWalletFundingResponse, GetWalletFundingLimitRequest, GetWalletFundingLimitResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
|
|
5
5
|
import { RemittanceCreditBackRequest, RemittanceCreditBackResponse } from "@fiado/type-kit/bin/remittance/index.js";
|
|
6
|
-
import { AuthorizeCollectionMovementRequest, AuthorizeCollectionMovementResponse } from "@fiado/type-kit/bin/collection/index.js";
|
|
6
|
+
import { AuthorizeCollectionMovementRequest, AuthorizeCollectionMovementResponse, CaptureCollectionHoldRequest, CaptureCollectionHoldResponse } from "@fiado/type-kit/bin/collection/index.js";
|
|
7
7
|
type ProcessUpdateLevelRequest = import("@fiado/type-kit/bin/transactionProcessor/dtos/ProcessUpdateLevelRequest.js").default;
|
|
8
8
|
export interface ITransactionProcessorApi {
|
|
9
9
|
authorizeTransaction(request: AuthorizeCreditCardPurchaseRequest): Promise<any>;
|
|
@@ -54,6 +54,16 @@ export interface ITransactionProcessorApi {
|
|
|
54
54
|
* Idempotente por `executionId` (@IdempotencyController).
|
|
55
55
|
*/
|
|
56
56
|
authorizeCollectionMovement(request: AuthorizeCollectionMovementRequest): Promise<FiadoApiResponse<AuthorizeCollectionMovementResponse>>;
|
|
57
|
+
/**
|
|
58
|
+
* Cierra una retención colocada por un mecanismo que reserva en vez de cobrar. Hasta que se
|
|
59
|
+
* captura, el importe sigue siendo del titular —sólo que inmovilizado— y el cobro no ha dejado
|
|
60
|
+
* asiento: es esta llamada la que saca el dinero de la cuenta y lo asienta.
|
|
61
|
+
*
|
|
62
|
+
* Una retención que el proveedor no confirma responde `NONE`: sigue en pie, no es un error.
|
|
63
|
+
* Backend: POST /transaction-processor/collection/capture (privado VPC).
|
|
64
|
+
* Idempotente por `executionId`.
|
|
65
|
+
*/
|
|
66
|
+
captureCollectionHold(request: CaptureCollectionHoldRequest): Promise<FiadoApiResponse<CaptureCollectionHoldResponse>>;
|
|
57
67
|
/**
|
|
58
68
|
* Acredita el bono de bienvenida de SureKeep en la wallet PagoConfiado del comprador.
|
|
59
69
|
* Backend: POST /transaction-processor/bonus/authorize (privado VPC).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.59.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": "^3.9.0",
|
|
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.390.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -5,12 +5,14 @@ import {
|
|
|
5
5
|
ConsumePromotionRequest,
|
|
6
6
|
PromotedSkusResponse,
|
|
7
7
|
ConsumePromotionResponse,
|
|
8
|
+
CreditPlanLevelEnum,
|
|
8
9
|
CreditPlanResponse,
|
|
9
10
|
FinancierResponse,
|
|
10
11
|
ReservePromotionBonusRequest,
|
|
11
12
|
ReservePromotionBonusResponse,
|
|
12
13
|
ResolveCustomerSegmentsRequest,
|
|
13
14
|
ResolveCustomerSegmentsResponse,
|
|
15
|
+
ScopeWidePromotionsResponse,
|
|
14
16
|
SkuPromotionsResponse,
|
|
15
17
|
SettlePromotionBonusRequest,
|
|
16
18
|
PromotionBonusResponse,
|
|
@@ -120,4 +122,16 @@ export default class LoanOfferingsBusinessApi implements ILoanOfferingsBusinessA
|
|
|
120
122
|
const url = `${this.baseUrl}/private/promotions/by-sku?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
|
|
121
123
|
return await this.httpRequest.get(url);
|
|
122
124
|
}
|
|
125
|
+
|
|
126
|
+
async listScopeWidePromotions(
|
|
127
|
+
storeId: string,
|
|
128
|
+
tenantId: string,
|
|
129
|
+
level?: CreditPlanLevelEnum,
|
|
130
|
+
segmentId?: string,
|
|
131
|
+
): Promise<StandardResponse<ScopeWidePromotionsResponse>> {
|
|
132
|
+
let url = `${this.baseUrl}/private/promotions/scope-wide?storeId=${encodeURIComponent(storeId)}&tenantId=${encodeURIComponent(tenantId)}`;
|
|
133
|
+
if (level) url += `&level=${encodeURIComponent(level)}`;
|
|
134
|
+
if (segmentId) url += `&segmentId=${encodeURIComponent(segmentId)}`;
|
|
135
|
+
return await this.httpRequest.get(url);
|
|
136
|
+
}
|
|
123
137
|
}
|
|
@@ -3,12 +3,14 @@ import {
|
|
|
3
3
|
ConsumePromotionRequest,
|
|
4
4
|
PromotedSkusResponse,
|
|
5
5
|
ConsumePromotionResponse,
|
|
6
|
+
CreditPlanLevelEnum,
|
|
6
7
|
CreditPlanResponse,
|
|
7
8
|
FinancierResponse,
|
|
8
9
|
ReservePromotionBonusRequest,
|
|
9
10
|
ReservePromotionBonusResponse,
|
|
10
11
|
ResolveCustomerSegmentsRequest,
|
|
11
12
|
ResolveCustomerSegmentsResponse,
|
|
13
|
+
ScopeWidePromotionsResponse,
|
|
12
14
|
SkuPromotionsResponse,
|
|
13
15
|
SettlePromotionBonusRequest,
|
|
14
16
|
PromotionBonusResponse,
|
|
@@ -175,4 +177,20 @@ export interface ILoanOfferingsBusinessApi {
|
|
|
175
177
|
storeId: string,
|
|
176
178
|
tenantId: string,
|
|
177
179
|
): Promise<StandardResponse<SkuPromotionsResponse>>;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* `GET /private/promotions/scope-wide` — promociones que NO acotan por SKU (tienda, nivel,
|
|
183
|
+
* segmento o universales), para el banner de pantalla completa del paso 03 del wizard.
|
|
184
|
+
*
|
|
185
|
+
* `level`/`segmentId` son opcionales: si el score todavía no corrió o el segmento no se
|
|
186
|
+
* resolvió, se omiten y el lambda destino descarta las promociones que acotan por esa
|
|
187
|
+
* dimensión (mismo criterio que `listSkuPromotions`/`by-sku`). Devuelve `{ items: [] }` si no
|
|
188
|
+
* hay ninguna vigente; nunca 404.
|
|
189
|
+
*/
|
|
190
|
+
listScopeWidePromotions(
|
|
191
|
+
storeId: string,
|
|
192
|
+
tenantId: string,
|
|
193
|
+
level?: CreditPlanLevelEnum,
|
|
194
|
+
segmentId?: string,
|
|
195
|
+
): Promise<StandardResponse<ScopeWidePromotionsResponse>>;
|
|
178
196
|
}
|
|
@@ -27,6 +27,8 @@ import { RemittanceCreditBackRequest, RemittanceCreditBackResponse } from "@fiad
|
|
|
27
27
|
import {
|
|
28
28
|
AuthorizeCollectionMovementRequest,
|
|
29
29
|
AuthorizeCollectionMovementResponse,
|
|
30
|
+
CaptureCollectionHoldRequest,
|
|
31
|
+
CaptureCollectionHoldResponse,
|
|
30
32
|
} from "@fiado/type-kit/bin/collection/index.js";
|
|
31
33
|
type ProcessUpdateLevelRequest = import("@fiado/type-kit/bin/transactionProcessor/dtos/ProcessUpdateLevelRequest.js").default;
|
|
32
34
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
@@ -116,6 +118,13 @@ export default class TransactionProcessorApi implements ITransactionProcessorApi
|
|
|
116
118
|
return await this.httpRequest.post(url, request);
|
|
117
119
|
}
|
|
118
120
|
|
|
121
|
+
async captureCollectionHold(
|
|
122
|
+
request: CaptureCollectionHoldRequest,
|
|
123
|
+
): Promise<FiadoApiResponse<CaptureCollectionHoldResponse>> {
|
|
124
|
+
const url = `${this.baseUrl}collection/capture`;
|
|
125
|
+
return await this.httpRequest.post(url, request);
|
|
126
|
+
}
|
|
127
|
+
|
|
119
128
|
async authorizeWelcomeBonus(
|
|
120
129
|
request: AuthorizeBonusRequest,
|
|
121
130
|
): Promise<FiadoApiResponse<TransactionProcessorResponse>> {
|
|
@@ -26,6 +26,8 @@ import { RemittanceCreditBackRequest, RemittanceCreditBackResponse } from "@fiad
|
|
|
26
26
|
import {
|
|
27
27
|
AuthorizeCollectionMovementRequest,
|
|
28
28
|
AuthorizeCollectionMovementResponse,
|
|
29
|
+
CaptureCollectionHoldRequest,
|
|
30
|
+
CaptureCollectionHoldResponse,
|
|
29
31
|
} from "@fiado/type-kit/bin/collection/index.js";
|
|
30
32
|
type ProcessUpdateLevelRequest = import("@fiado/type-kit/bin/transactionProcessor/dtos/ProcessUpdateLevelRequest.js").default;
|
|
31
33
|
|
|
@@ -104,6 +106,19 @@ export interface ITransactionProcessorApi {
|
|
|
104
106
|
request: AuthorizeCollectionMovementRequest,
|
|
105
107
|
): Promise<FiadoApiResponse<AuthorizeCollectionMovementResponse>>;
|
|
106
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Cierra una retención colocada por un mecanismo que reserva en vez de cobrar. Hasta que se
|
|
111
|
+
* captura, el importe sigue siendo del titular —sólo que inmovilizado— y el cobro no ha dejado
|
|
112
|
+
* asiento: es esta llamada la que saca el dinero de la cuenta y lo asienta.
|
|
113
|
+
*
|
|
114
|
+
* Una retención que el proveedor no confirma responde `NONE`: sigue en pie, no es un error.
|
|
115
|
+
* Backend: POST /transaction-processor/collection/capture (privado VPC).
|
|
116
|
+
* Idempotente por `executionId`.
|
|
117
|
+
*/
|
|
118
|
+
captureCollectionHold(
|
|
119
|
+
request: CaptureCollectionHoldRequest,
|
|
120
|
+
): Promise<FiadoApiResponse<CaptureCollectionHoldResponse>>;
|
|
121
|
+
|
|
107
122
|
/**
|
|
108
123
|
* Acredita el bono de bienvenida de SureKeep en la wallet PagoConfiado del comprador.
|
|
109
124
|
* Backend: POST /transaction-processor/bonus/authorize (privado VPC).
|