@fiado/api-invoker 5.151.0 → 5.152.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.
@@ -1,6 +1,6 @@
1
1
  import type { IHttpRequest } from "@fiado/http-client";
2
2
  import { StandardResponse } from "@fiado/gateway-adapter";
3
- import { ActivationCheckRequest, ActivationCheckResponse, CancelLoanCreditRequest, CreditPaymentAppliedRequest, CreditPaymentAppliedResponse, CreditSettledRequest, CreditSettledResponse, LoanBorrowerResponse, ListMessagingCandidatesRequest, ListMessagingCandidatesResponse, LoanCreditResponse, OriginateLoanCreditRequest, OriginateLoanCreditResponse, QuoteLoanCreditRequest, QuoteLoanCreditResponse, SignLoanCreditRequest, SignLoanCreditResponse, PreviewLoanContractRequest, LoanContractPreview, UpdateLoanBorrowerSciRequest, UpsertLoanBorrowerRequest, LoanBorrowerCreditItem, LoanContractDownloadUrl, LoanContractResponse, LoanCreditDetail, LoanInstallmentResponse, LoanPaymentListResponse, CreateCustomerPaymentRequest, LoanCustomerPaymentOptions, LoanCustomerPaymentResult } from "@fiado/type-kit/bin/loanCredit/index.js";
3
+ import { ActivationCheckRequest, ActivationCheckResponse, CancelLoanCreditRequest, CreditPaymentAppliedRequest, CreditPaymentAppliedResponse, CreditSettledRequest, CreditSettledResponse, LoanBorrowerResponse, ListMessagingCandidatesRequest, ListMessagingCandidatesResponse, LoanCreditResponse, OriginateLoanCreditRequest, OriginateLoanCreditResponse, QuoteLoanCreditRequest, QuoteLoanCreditResponse, SignLoanCreditRequest, SignLoanCreditResponse, PreviewLoanContractRequest, LoanContractPreview, UpdateLoanBorrowerSciRequest, UpsertLoanBorrowerRequest, LoanBorrowerCreditItem, LoanContractDownloadUrl, LoanContractResponse, ContractTypeEnum, LoanCustomerCreditDocument, LoanCustomerCreditDocumentUrl, LoanCreditDetail, LoanInstallmentResponse, LoanPaymentListResponse, CreateCustomerPaymentRequest, LoanCustomerPaymentOptions, LoanCustomerPaymentResult } from "@fiado/type-kit/bin/loanCredit/index.js";
4
4
  import { CreditSummariesBatchRequest, CreditSummariesBatchResponse } from "./dtos/CreditSummariesBatch.js";
5
5
  import { LoanCreditAnalyticsBatchRequest, LoanCreditAnalyticsBatchResponse } from "./dtos/LoanCreditAnalyticsBatch.js";
6
6
  import type { GetCreditOptions } from "./dtos/GetCreditOptions.js";
@@ -51,6 +51,8 @@ export default class LoanCreditBusinessApi implements ILoanCreditBusinessApi {
51
51
  }): Promise<StandardResponse<LoanPaymentListResponse>>;
52
52
  listCustomerCreditContracts(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanContractResponse[]>>;
53
53
  getCustomerCreditContractUrl(directoryId: string, creditId: string, contractId: string, tenantId: string): Promise<StandardResponse<LoanContractDownloadUrl>>;
54
+ listCustomerCreditDocuments(directoryId: string, creditId: string, type: ContractTypeEnum, tenantId: string): Promise<StandardResponse<LoanCustomerCreditDocument[]>>;
55
+ getCustomerCreditDocumentUrl(directoryId: string, creditId: string, documentType: ContractTypeEnum, documentKey: string, tenantId: string): Promise<StandardResponse<LoanCustomerCreditDocumentUrl>>;
54
56
  getCustomerPaymentOptions(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanCustomerPaymentOptions>>;
55
57
  createCustomerPayment(directoryId: string, creditId: string, tenantId: string, body: CreateCustomerPaymentRequest): Promise<StandardResponse<LoanCustomerPaymentResult>>;
56
58
  }
@@ -136,6 +136,13 @@ let LoanCreditBusinessApi = class LoanCreditBusinessApi {
136
136
  async getCustomerCreditContractUrl(directoryId, creditId, contractId, tenantId) {
137
137
  return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}/contracts/${encodeURIComponent(contractId)}/url?tenantId=${encodeURIComponent(tenantId)}`);
138
138
  }
139
+ async listCustomerCreditDocuments(directoryId, creditId, type, tenantId) {
140
+ const query = new URLSearchParams({ tenantId, type });
141
+ return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}/documents?${query.toString()}`);
142
+ }
143
+ async getCustomerCreditDocumentUrl(directoryId, creditId, documentType, documentKey, tenantId) {
144
+ return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}/documents/${encodeURIComponent(documentType)}/${encodeURIComponent(documentKey)}/url?tenantId=${encodeURIComponent(tenantId)}`);
145
+ }
139
146
  // ─── Pagos de cliente (retail-loan-business) ────────────────────────────────
140
147
  async getCustomerPaymentOptions(directoryId, creditId, tenantId) {
141
148
  return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}/payment-options?tenantId=${encodeURIComponent(tenantId)}`);
@@ -1,5 +1,5 @@
1
1
  import { StandardResponse } from "@fiado/gateway-adapter";
2
- import { ActivationCheckRequest, CreditPaymentAppliedRequest, CreditPaymentAppliedResponse, CreditSettledRequest, CreditSettledResponse, ActivationCheckResponse, CancelLoanCreditRequest, LoanBorrowerResponse, ListMessagingCandidatesRequest, ListMessagingCandidatesResponse, LoanCreditResponse, OriginateLoanCreditRequest, OriginateLoanCreditResponse, QuoteLoanCreditRequest, QuoteLoanCreditResponse, SignLoanCreditRequest, PreviewLoanContractRequest, LoanContractPreview, SignLoanCreditResponse, UpdateLoanBorrowerSciRequest, UpsertLoanBorrowerRequest, LoanBorrowerCreditItem, LoanContractDownloadUrl, LoanContractResponse, LoanCreditDetail, LoanInstallmentResponse, LoanPaymentListResponse, CreateCustomerPaymentRequest, LoanCustomerPaymentOptions, LoanCustomerPaymentResult } from "@fiado/type-kit/bin/loanCredit/index.js";
2
+ import { ActivationCheckRequest, CreditPaymentAppliedRequest, CreditPaymentAppliedResponse, CreditSettledRequest, CreditSettledResponse, ActivationCheckResponse, CancelLoanCreditRequest, LoanBorrowerResponse, ListMessagingCandidatesRequest, ListMessagingCandidatesResponse, LoanCreditResponse, OriginateLoanCreditRequest, OriginateLoanCreditResponse, QuoteLoanCreditRequest, QuoteLoanCreditResponse, SignLoanCreditRequest, PreviewLoanContractRequest, LoanContractPreview, SignLoanCreditResponse, UpdateLoanBorrowerSciRequest, UpsertLoanBorrowerRequest, LoanBorrowerCreditItem, LoanContractDownloadUrl, LoanContractResponse, ContractTypeEnum, LoanCustomerCreditDocument, LoanCustomerCreditDocumentUrl, LoanCreditDetail, LoanInstallmentResponse, LoanPaymentListResponse, CreateCustomerPaymentRequest, LoanCustomerPaymentOptions, LoanCustomerPaymentResult } from "@fiado/type-kit/bin/loanCredit/index.js";
3
3
  import { CreditSummariesBatchRequest, CreditSummariesBatchResponse } from "../dtos/CreditSummariesBatch.js";
4
4
  import { LoanCreditAnalyticsBatchRequest, LoanCreditAnalyticsBatchResponse } from "../dtos/LoanCreditAnalyticsBatch.js";
5
5
  import type { GetCreditOptions } from "../dtos/GetCreditOptions.js";
@@ -156,6 +156,10 @@ export interface ILoanCreditBusinessApi {
156
156
  listCustomerCreditContracts(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanContractResponse[]>>;
157
157
  /** URL prefirmada del PDF de un contrato. 404 CONTRACT_NOT_FOUND · 409 CONTRACT_PDF_NOT_READY. */
158
158
  getCustomerCreditContractUrl(directoryId: string, creditId: string, contractId: string, tenantId: string): Promise<StandardResponse<LoanContractDownloadUrl>>;
159
+ /** Documentos de un tipo del ciclo de vida del crédito (comprobantes, estados de cuenta), el más reciente primero. */
160
+ listCustomerCreditDocuments(directoryId: string, creditId: string, type: ContractTypeEnum, tenantId: string): Promise<StandardResponse<LoanCustomerCreditDocument[]>>;
161
+ /** URL prefirmada del PDF de un documento del ciclo de vida. 404 CREDIT_DOCUMENT_NOT_FOUND si no existe o no tiene PDF. */
162
+ getCustomerCreditDocumentUrl(directoryId: string, creditId: string, documentType: ContractTypeEnum, documentKey: string, tenantId: string): Promise<StandardResponse<LoanCustomerCreditDocumentUrl>>;
159
163
  /** Opciones de pago de un crédito del cliente, con montos ya calculados. */
160
164
  getCustomerPaymentOptions(directoryId: string, creditId: string, tenantId: string): Promise<StandardResponse<LoanCustomerPaymentOptions>>;
161
165
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "5.151.0",
3
+ "version": "5.152.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.14.0",
35
35
  "@fiado/http-client": "^2.0.1",
36
36
  "@fiado/logger": "^1.1.3",
37
- "@fiado/type-kit": "^3.594.0",
37
+ "@fiado/type-kit": "^3.611.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -26,6 +26,9 @@ import {
26
26
  LoanBorrowerCreditItem,
27
27
  LoanContractDownloadUrl,
28
28
  LoanContractResponse,
29
+ ContractTypeEnum,
30
+ LoanCustomerCreditDocument,
31
+ LoanCustomerCreditDocumentUrl,
29
32
  LoanCreditDetail,
30
33
  LoanInstallmentResponse,
31
34
  LoanPaymentListResponse,
@@ -294,6 +297,28 @@ export default class LoanCreditBusinessApi implements ILoanCreditBusinessApi {
294
297
  );
295
298
  }
296
299
 
300
+ async listCustomerCreditDocuments(
301
+ directoryId: string,
302
+ creditId: string,
303
+ type: ContractTypeEnum,
304
+ tenantId: string,
305
+ ): Promise<StandardResponse<LoanCustomerCreditDocument[]>> {
306
+ const query = new URLSearchParams({ tenantId, type });
307
+ return await this.httpRequest.get(`${this.customerCreditsUrl(directoryId, creditId)}/documents?${query.toString()}`);
308
+ }
309
+
310
+ async getCustomerCreditDocumentUrl(
311
+ directoryId: string,
312
+ creditId: string,
313
+ documentType: ContractTypeEnum,
314
+ documentKey: string,
315
+ tenantId: string,
316
+ ): Promise<StandardResponse<LoanCustomerCreditDocumentUrl>> {
317
+ return await this.httpRequest.get(
318
+ `${this.customerCreditsUrl(directoryId, creditId)}/documents/${encodeURIComponent(documentType)}/${encodeURIComponent(documentKey)}/url?tenantId=${encodeURIComponent(tenantId)}`,
319
+ );
320
+ }
321
+
297
322
  // ─── Pagos de cliente (retail-loan-business) ────────────────────────────────
298
323
 
299
324
  async getCustomerPaymentOptions(
@@ -24,6 +24,9 @@ import {
24
24
  LoanBorrowerCreditItem,
25
25
  LoanContractDownloadUrl,
26
26
  LoanContractResponse,
27
+ ContractTypeEnum,
28
+ LoanCustomerCreditDocument,
29
+ LoanCustomerCreditDocumentUrl,
27
30
  LoanCreditDetail,
28
31
  LoanInstallmentResponse,
29
32
  LoanPaymentListResponse,
@@ -311,6 +314,23 @@ export interface ILoanCreditBusinessApi {
311
314
  tenantId: string,
312
315
  ): Promise<StandardResponse<LoanContractDownloadUrl>>;
313
316
 
317
+ /** Documentos de un tipo del ciclo de vida del crédito (comprobantes, estados de cuenta), el más reciente primero. */
318
+ listCustomerCreditDocuments(
319
+ directoryId: string,
320
+ creditId: string,
321
+ type: ContractTypeEnum,
322
+ tenantId: string,
323
+ ): Promise<StandardResponse<LoanCustomerCreditDocument[]>>;
324
+
325
+ /** URL prefirmada del PDF de un documento del ciclo de vida. 404 CREDIT_DOCUMENT_NOT_FOUND si no existe o no tiene PDF. */
326
+ getCustomerCreditDocumentUrl(
327
+ directoryId: string,
328
+ creditId: string,
329
+ documentType: ContractTypeEnum,
330
+ documentKey: string,
331
+ tenantId: string,
332
+ ): Promise<StandardResponse<LoanCustomerCreditDocumentUrl>>;
333
+
314
334
  // ─── Pagos de cliente (retail-loan-business) ────────────────────────────────
315
335
 
316
336
  /** Opciones de pago de un crédito del cliente, con montos ya calculados. */