@fiado/api-invoker 3.5.0 → 3.6.1

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.
Files changed (30) hide show
  1. package/bin/container.config.js +2 -0
  2. package/bin/index.d.ts +1 -0
  3. package/bin/index.js +1 -0
  4. package/bin/milestone-business/api/MilestoneBusinessApi.d.ts +9 -0
  5. package/bin/milestone-business/api/MilestoneBusinessApi.js +41 -0
  6. package/bin/milestone-business/api/interfaces/IMilestoneBusinessApi.d.ts +8 -0
  7. package/bin/milestone-business/index.d.ts +2 -0
  8. package/bin/milestone-business/index.js +18 -0
  9. package/bin/multicommServicePayment/api/MulticommServicePaymentApi.d.ts +1 -0
  10. package/bin/multicommServicePayment/api/MulticommServicePaymentApi.js +4 -0
  11. package/bin/multicommServicePayment/api/interfaces/IMulticommServicePaymentApi.d.ts +1 -0
  12. package/bin/stpServicePayment/api/StpServicePaymentApi.d.ts +1 -0
  13. package/bin/stpServicePayment/api/StpServicePaymentApi.js +4 -0
  14. package/bin/stpServicePayment/api/interfaces/IStpServicePaymentApi.d.ts +1 -0
  15. package/package.json +2 -2
  16. package/src/container.config.ts +3 -0
  17. package/src/index.ts +1 -0
  18. package/src/milestone-business/api/MilestoneBusinessApi.ts +26 -0
  19. package/src/milestone-business/api/interfaces/IMilestoneBusinessApi.ts +9 -0
  20. package/src/milestone-business/index.ts +2 -0
  21. package/src/multicommServicePayment/api/MulticommServicePaymentApi.ts +5 -0
  22. package/src/multicommServicePayment/api/interfaces/IMulticommServicePaymentApi.ts +6 -0
  23. package/src/stpServicePayment/api/StpServicePaymentApi.ts +5 -0
  24. package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +6 -0
  25. package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +0 -46
  26. package/bin/estafeta/EstafetaApi.d.ts +0 -0
  27. package/bin/estafeta/EstafetaApi.js +0 -0
  28. package/bin/report-processor-business/api/IReportProcessorBusiness.d.ts +0 -3
  29. package/bin/report-processor-business/api/IReportProcessorBusiness.js +0 -2
  30. /package/bin/{cognitoConnector/interfaces/ICognitoConnectorApiV2.js → milestone-business/api/interfaces/IMilestoneBusinessApi.js} +0 -0
@@ -23,6 +23,7 @@ const card_1 = require("./card");
23
23
  const transaction_1 = require("./transaction");
24
24
  const contract_generator_1 = require("./contract-generator");
25
25
  const ContractBusinessApi_1 = __importDefault(require("./contract-business/api/ContractBusinessApi"));
26
+ const MilestoneBusinessApi_1 = __importDefault(require("./milestone-business/api/MilestoneBusinessApi"));
26
27
  const CreditStatementsApi_1 = __importDefault(require("./credit-statements/api/CreditStatementsApi"));
27
28
  const ProductCatalogApi_1 = __importDefault(require("./product-catalog/ProductCatalogApi"));
28
29
  const collector_1 = require("./collector");
@@ -122,6 +123,7 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
122
123
  bind("ICardApi").to(card_1.CardApi);
123
124
  bind("IContractGeneratorApi").to(contract_generator_1.ContractGeneratorApi);
124
125
  bind("IContractBusinessApi").to(ContractBusinessApi_1.default);
126
+ bind("IMilestoneBusinessApi").to(MilestoneBusinessApi_1.default);
125
127
  bind("ICreditStatementsApi").to(CreditStatementsApi_1.default);
126
128
  bind("ICollectorApi").to(collector_1.CollectorApi);
127
129
  bind("IProductCatalogApi").to(ProductCatalogApi_1.default);
package/bin/index.d.ts CHANGED
@@ -72,3 +72,4 @@ export * from "./teams-connector";
72
72
  export * from "./countries-business";
73
73
  export * from "./ai-engine-connector";
74
74
  export * from "./benefits-marketplace";
75
+ export * from "./milestone-business";
package/bin/index.js CHANGED
@@ -88,3 +88,4 @@ __exportStar(require("./teams-connector"), exports);
88
88
  __exportStar(require("./countries-business"), exports);
89
89
  __exportStar(require("./ai-engine-connector"), exports);
90
90
  __exportStar(require("./benefits-marketplace"), exports);
91
+ __exportStar(require("./milestone-business"), exports);
@@ -0,0 +1,9 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { MilestonesByEventKeyDateRangeParams } from "@fiado/type-kit/bin/milestone-business";
3
+ import { IMilestoneBusinessApi } from "./interfaces/IMilestoneBusinessApi";
4
+ export default class MilestoneBusinessApi implements IMilestoneBusinessApi {
5
+ private httpRequest;
6
+ private readonly baseUrl;
7
+ constructor(httpRequest: IHttpRequest);
8
+ listByEventKeyAndDateRange(eventKey: string, params: MilestonesByEventKeyDateRangeParams): Promise<any>;
9
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const inversify_1 = require("inversify");
16
+ let MilestoneBusinessApi = class MilestoneBusinessApi {
17
+ constructor(httpRequest) {
18
+ this.httpRequest = httpRequest;
19
+ this.baseUrl = process.env.MILESTONE_BUSINESS_LAMBDA_URL || "";
20
+ }
21
+ async listByEventKeyAndDateRange(eventKey, params) {
22
+ const queryParams = new URLSearchParams();
23
+ queryParams.append('eventKey', eventKey);
24
+ queryParams.append('startDate', String(params.startDate));
25
+ queryParams.append('endDate', String(params.endDate));
26
+ if (params.pageSize !== undefined && params.pageSize !== null)
27
+ queryParams.append('pageSize', String(params.pageSize));
28
+ if (params.index)
29
+ queryParams.append('index', params.index);
30
+ if (params.sort)
31
+ queryParams.append('sort', params.sort);
32
+ const url = `${this.baseUrl}private/milestones/by-event-key?${queryParams.toString()}`;
33
+ return await this.httpRequest.get(url);
34
+ }
35
+ };
36
+ MilestoneBusinessApi = __decorate([
37
+ (0, inversify_1.injectable)(),
38
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
39
+ __metadata("design:paramtypes", [Object])
40
+ ], MilestoneBusinessApi);
41
+ exports.default = MilestoneBusinessApi;
@@ -0,0 +1,8 @@
1
+ import { MilestonesByEventKeyDateRangeParams } from "@fiado/type-kit/bin/milestone-business";
2
+ export interface IMilestoneBusinessApi {
3
+ /**
4
+ * Lista milestones por eventKey filtrados por rango de eventDate.
5
+ * Usado por el flujo de cálculo de comisiones (eventKey=HomeAzul para USA, HomeRosa para MEX).
6
+ */
7
+ listByEventKeyAndDateRange(eventKey: string, params: MilestonesByEventKeyDateRangeParams): Promise<any>;
8
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api/MilestoneBusinessApi';
2
+ export * from './api/interfaces/IMilestoneBusinessApi';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./api/MilestoneBusinessApi"), exports);
18
+ __exportStar(require("./api/interfaces/IMilestoneBusinessApi"), exports);
@@ -30,4 +30,5 @@ export default class MulticommServicePaymentApi implements IMulticommServicePaym
30
30
  includeDisabled?: boolean;
31
31
  }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
32
32
  payStandard(request: BenefitPaymentRequest): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
33
+ consultStandard(transactionNumber: string): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
33
34
  }
@@ -76,6 +76,10 @@ let MulticommServicePaymentApi = class MulticommServicePaymentApi {
76
76
  const url = `${this.baseUrl}/pay/standard`;
77
77
  return await this.httpRequest.post(url, request);
78
78
  }
79
+ async consultStandard(transactionNumber) {
80
+ const url = `${this.baseUrl}/pay/standard/transactions/${encodeURIComponent(transactionNumber)}`;
81
+ return await this.httpRequest.get(url);
82
+ }
79
83
  };
80
84
  MulticommServicePaymentApi = __decorate([
81
85
  (0, inversify_1.injectable)(),
@@ -25,4 +25,5 @@ export interface IMulticommServicePaymentApi {
25
25
  includeDisabled?: boolean;
26
26
  }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
27
27
  payStandard(request: BenefitPaymentRequest): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
28
+ consultStandard(transactionNumber: string): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
28
29
  }
@@ -26,4 +26,5 @@ export default class StpServicePaymentApi implements IStpServicePaymentApi {
26
26
  includeDisabled?: boolean;
27
27
  }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
28
28
  payStandard(request: BenefitPaymentRequest): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
29
+ consultStandard(transactionNumber: string): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
29
30
  }
@@ -76,6 +76,10 @@ let StpServicePaymentApi = class StpServicePaymentApi {
76
76
  const url = `${this.baseUrl}/pay/standard`;
77
77
  return await this.httpRequest.post(url, request);
78
78
  }
79
+ async consultStandard(transactionNumber) {
80
+ const url = `${this.baseUrl}/pay/standard/transactions/${encodeURIComponent(transactionNumber)}`;
81
+ return await this.httpRequest.get(url);
82
+ }
79
83
  };
80
84
  StpServicePaymentApi = __decorate([
81
85
  (0, inversify_1.injectable)(),
@@ -21,4 +21,5 @@ export interface IStpServicePaymentApi {
21
21
  includeDisabled?: boolean;
22
22
  }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
23
23
  payStandard(request: BenefitPaymentRequest): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
24
+ consultStandard(transactionNumber: string): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
24
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "3.5.0",
3
+ "version": "3.6.1",
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
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -16,7 +16,7 @@
16
16
  "@fiado/gateway-adapter": "^1.1.50",
17
17
  "@fiado/http-client": "^1.0.7",
18
18
  "@fiado/logger": "^1.0.3",
19
- "@fiado/type-kit": "^3.9.0",
19
+ "@fiado/type-kit": "^3.13.0",
20
20
  "dotenv": "^16.4.7",
21
21
  "i": "^0.3.7",
22
22
  "inversify": "^6.2.2",
@@ -25,6 +25,8 @@ import { ITransactionApi, ITransactionPublisher, TransactionPublisher } from "./
25
25
  import { ContractGeneratorApi, IContractGeneratorApi } from "./contract-generator";
26
26
  import { IContractBusinessApi } from "./contract-business";
27
27
  import ContractBusinessApi from "./contract-business/api/ContractBusinessApi";
28
+ import { IMilestoneBusinessApi } from "./milestone-business";
29
+ import MilestoneBusinessApi from "./milestone-business/api/MilestoneBusinessApi";
28
30
  import { ICreditStatementsApi } from "./credit-statements";
29
31
  import CreditStatementsApi from "./credit-statements/api/CreditStatementsApi";
30
32
  import { IProductCatalogApi } from "./product-catalog";
@@ -172,6 +174,7 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
172
174
  bind<ICardApi>("ICardApi").to(CardApi);
173
175
  bind<IContractGeneratorApi>("IContractGeneratorApi").to(ContractGeneratorApi);
174
176
  bind<IContractBusinessApi>("IContractBusinessApi").to(ContractBusinessApi);
177
+ bind<IMilestoneBusinessApi>("IMilestoneBusinessApi").to(MilestoneBusinessApi);
175
178
  bind<ICreditStatementsApi>("ICreditStatementsApi").to(CreditStatementsApi);
176
179
  bind<ICollectorApi>("ICollectorApi").to(CollectorApi);
177
180
  bind<IProductCatalogApi>("IProductCatalogApi").to(ProductCatalogApi);
package/src/index.ts CHANGED
@@ -72,3 +72,4 @@ export * from "./teams-connector";
72
72
  export * from "./countries-business";
73
73
  export * from "./ai-engine-connector";
74
74
  export * from "./benefits-marketplace";
75
+ export * from "./milestone-business";
@@ -0,0 +1,26 @@
1
+ import { inject, injectable } from "inversify";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ import { MilestonesByEventKeyDateRangeParams } from "@fiado/type-kit/bin/milestone-business";
4
+ import { IMilestoneBusinessApi } from "./interfaces/IMilestoneBusinessApi";
5
+
6
+ @injectable()
7
+ export default class MilestoneBusinessApi implements IMilestoneBusinessApi {
8
+
9
+ private readonly baseUrl = process.env.MILESTONE_BUSINESS_LAMBDA_URL || "";
10
+
11
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
12
+ }
13
+
14
+ async listByEventKeyAndDateRange(eventKey: string, params: MilestonesByEventKeyDateRangeParams): Promise<any> {
15
+ const queryParams = new URLSearchParams();
16
+ queryParams.append('eventKey', eventKey);
17
+ queryParams.append('startDate', String(params.startDate));
18
+ queryParams.append('endDate', String(params.endDate));
19
+ if (params.pageSize !== undefined && params.pageSize !== null) queryParams.append('pageSize', String(params.pageSize));
20
+ if (params.index) queryParams.append('index', params.index);
21
+ if (params.sort) queryParams.append('sort', params.sort);
22
+
23
+ const url = `${this.baseUrl}private/milestones/by-event-key?${queryParams.toString()}`;
24
+ return await this.httpRequest.get(url);
25
+ }
26
+ }
@@ -0,0 +1,9 @@
1
+ import { MilestonesByEventKeyDateRangeParams } from "@fiado/type-kit/bin/milestone-business";
2
+
3
+ export interface IMilestoneBusinessApi {
4
+ /**
5
+ * Lista milestones por eventKey filtrados por rango de eventDate.
6
+ * Usado por el flujo de cálculo de comisiones (eventKey=HomeAzul para USA, HomeRosa para MEX).
7
+ */
8
+ listByEventKeyAndDateRange(eventKey: string, params: MilestonesByEventKeyDateRangeParams): Promise<any>;
9
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api/MilestoneBusinessApi';
2
+ export * from './api/interfaces/IMilestoneBusinessApi';
@@ -77,4 +77,9 @@ export default class MulticommServicePaymentApi implements IMulticommServicePaym
77
77
  const url = `${this.baseUrl}/pay/standard`;
78
78
  return await this.httpRequest.post(url, request);
79
79
  }
80
+
81
+ async consultStandard(transactionNumber: string): Promise<ApiGatewayResponse<BenefitPaymentResponse>> {
82
+ const url = `${this.baseUrl}/pay/standard/transactions/${encodeURIComponent(transactionNumber)}`;
83
+ return await this.httpRequest.get(url);
84
+ }
80
85
  }
@@ -27,4 +27,10 @@ export interface IMulticommServicePaymentApi {
27
27
  // Agregado en v3.5.0 (Fase 2) — consume POST /pay/standard del conector con DTO estandarizado.
28
28
  // Lo invoca el PaymentRouter de benefits-marketplace-business.
29
29
  payStandard(request: BenefitPaymentRequest): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
30
+
31
+ // Agregado en v3.6.0 (Fase 2.5) — consume GET /pay/standard/transactions/{transactionNumber}
32
+ // del conector. Devuelve el estado actual mapeado a BenefitPaymentResponse (el conector
33
+ // hace el mapping legacy → estándar internamente). Usado por el cron de timeout
34
+ // reconciliation del marketplace para consultar transacciones async sin ver shapes legacy.
35
+ consultStandard(transactionNumber: string): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
30
36
  }
@@ -77,4 +77,9 @@ export default class StpServicePaymentApi implements IStpServicePaymentApi {
77
77
  const url = `${this.baseUrl}/pay/standard`;
78
78
  return await this.httpRequest.post(url, request);
79
79
  }
80
+
81
+ async consultStandard(transactionNumber: string): Promise<ApiGatewayResponse<BenefitPaymentResponse>> {
82
+ const url = `${this.baseUrl}/pay/standard/transactions/${encodeURIComponent(transactionNumber)}`;
83
+ return await this.httpRequest.get(url);
84
+ }
80
85
  }
@@ -27,4 +27,10 @@ export interface IStpServicePaymentApi {
27
27
  // Agregado en v3.5.0 (Fase 2) — consume POST /pay/standard del conector con DTO estandarizado.
28
28
  // Lo invoca el PaymentRouter de benefits-marketplace-business.
29
29
  payStandard(request: BenefitPaymentRequest): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
30
+
31
+ // Agregado en v3.6.0 (Fase 2.5) — consume GET /pay/standard/transactions/{transactionNumber}
32
+ // del conector. Devuelve el estado actual mapeado a BenefitPaymentResponse (el conector
33
+ // hace el mapping legacy → estándar internamente). Usado por el cron de timeout
34
+ // reconciliation del marketplace para consultar transacciones async sin ver shapes legacy.
35
+ consultStandard(transactionNumber: string): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
30
36
  }
@@ -1,46 +0,0 @@
1
- import { ChangePasswordRequest, GetUserRequest, GetUserResponse, RefreshTokenRequest, RefreshTokenResponse, RespondToAuthChallengeRequest, SetPasswordRequest, SignInRequest, SignInResponse, SignUpConfirmRequest, SignUpRequest, SignUpResponse } from "@fiado/type-kit/bin/cognitoConnector";
2
- export interface ICognitoApi {
3
- /**
4
- * Healthcheck for the cognito-connector
5
- */
6
- healthcheck(): Promise<HealthcheckResponse>;
7
- /**
8
- * Create a new user in Cognito
9
- */
10
- signUp(request: SignUpRequest): Promise<SignUpResponse>;
11
- /**
12
- * Confirm sign-up for a user in Cognito
13
- */
14
- signUpConfirm(request: SignUpConfirmRequest): Promise<void>;
15
- /**
16
- * Sign in a user
17
- */
18
- signIn(request: SignInRequest): Promise<SignInResponse>;
19
- /**
20
- * Sign out a user
21
- */
22
- signOut(): Promise<void>;
23
- /**
24
- * Change a user's password
25
- */
26
- changePassword(request: ChangePasswordRequest): Promise<void>;
27
- /**
28
- * Retrieve user details
29
- */
30
- getUser(request: GetUserRequest): Promise<GetUserResponse>;
31
- /**
32
- * Refresh a user's tokens
33
- */
34
- refreshToken(request: RefreshTokenRequest): Promise<RefreshTokenResponse>;
35
- /**
36
- * Respond to an auth challenge
37
- */
38
- respondToAuthChallenge(request: RespondToAuthChallengeRequest): Promise<any>;
39
- /**
40
- * Reset a user's password
41
- */
42
- resetPassword(request: SetPasswordRequest): Promise<void>;
43
- }
44
- export interface HealthcheckResponse {
45
- status: string;
46
- }
File without changes
File without changes
@@ -1,3 +0,0 @@
1
- export interface IReportProcessorBusiness {
2
- processReports(key: string): Promise<void>;
3
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });