@fiado/api-invoker 3.3.2 → 3.3.4
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/contract-business/api/ContractBusinessApi.d.ts +2 -0
- package/bin/contract-business/api/ContractBusinessApi.js +8 -0
- package/bin/contract-business/api/interfaces/IContractBusinessApi.d.ts +9 -0
- package/package.json +1 -1
- package/src/contract-business/api/ContractBusinessApi.ts +10 -0
- package/src/contract-business/api/interfaces/IContractBusinessApi.ts +11 -0
|
@@ -14,4 +14,6 @@ export default class ContractBusinessApi implements IContractBusinessApi {
|
|
|
14
14
|
partnerId?: string;
|
|
15
15
|
category?: string;
|
|
16
16
|
}): Promise<any>;
|
|
17
|
+
listSignedByDirectory(directoryId: string, enterprise?: string): Promise<any>;
|
|
18
|
+
getContractPdfUrl(contractId: string, partnerId: string, category?: string): Promise<any>;
|
|
17
19
|
}
|
|
@@ -22,6 +22,14 @@ let ContractBusinessApi = class ContractBusinessApi {
|
|
|
22
22
|
const { documentType, ...body } = params;
|
|
23
23
|
return await this.httpRequest.post(`${this.baseUrl}/sign/${documentType}`, body);
|
|
24
24
|
}
|
|
25
|
+
async listSignedByDirectory(directoryId, enterprise = "FIADOSA") {
|
|
26
|
+
const url = `${this.baseUrl}/directories/${directoryId}/signed-documents?enterprise=${encodeURIComponent(enterprise)}`;
|
|
27
|
+
return await this.httpRequest.get(url);
|
|
28
|
+
}
|
|
29
|
+
async getContractPdfUrl(contractId, partnerId, category = "CREDITS") {
|
|
30
|
+
const url = `${this.baseUrl}/contracts/${contractId}/pdf?partnerId=${encodeURIComponent(partnerId)}&category=${encodeURIComponent(category)}`;
|
|
31
|
+
return await this.httpRequest.get(url);
|
|
32
|
+
}
|
|
25
33
|
};
|
|
26
34
|
ContractBusinessApi = __decorate([
|
|
27
35
|
(0, inversify_1.injectable)(),
|
|
@@ -11,4 +11,13 @@ export interface IContractBusinessApi {
|
|
|
11
11
|
/** Opcional: category (ej: "credito") para el path profundo de template */
|
|
12
12
|
category?: string;
|
|
13
13
|
}): Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* Lista todos los contratos firmados del directorio (no solo el último por tipo).
|
|
16
|
+
* Backoffice consume este endpoint para mostrar el historial.
|
|
17
|
+
*/
|
|
18
|
+
listSignedByDirectory(directoryId: string, enterprise?: string): Promise<any>;
|
|
19
|
+
/**
|
|
20
|
+
* Obtiene una URL pre-firmada (15 min) para visualizar inline el PDF firmado.
|
|
21
|
+
*/
|
|
22
|
+
getContractPdfUrl(contractId: string, partnerId: string, category?: string): Promise<any>;
|
|
14
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.4",
|
|
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",
|
|
@@ -23,4 +23,14 @@ export default class ContractBusinessApi implements IContractBusinessApi {
|
|
|
23
23
|
const { documentType, ...body } = params;
|
|
24
24
|
return await this.httpRequest.post(`${this.baseUrl}/sign/${documentType}`, body);
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
async listSignedByDirectory(directoryId: string, enterprise: string = "FIADOSA"): Promise<any> {
|
|
28
|
+
const url = `${this.baseUrl}/directories/${directoryId}/signed-documents?enterprise=${encodeURIComponent(enterprise)}`;
|
|
29
|
+
return await this.httpRequest.get(url);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async getContractPdfUrl(contractId: string, partnerId: string, category: string = "CREDITS"): Promise<any> {
|
|
33
|
+
const url = `${this.baseUrl}/contracts/${contractId}/pdf?partnerId=${encodeURIComponent(partnerId)}&category=${encodeURIComponent(category)}`;
|
|
34
|
+
return await this.httpRequest.get(url);
|
|
35
|
+
}
|
|
26
36
|
}
|
|
@@ -11,4 +11,15 @@ export interface IContractBusinessApi {
|
|
|
11
11
|
/** Opcional: category (ej: "credito") para el path profundo de template */
|
|
12
12
|
category?: string;
|
|
13
13
|
}): Promise<any>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Lista todos los contratos firmados del directorio (no solo el último por tipo).
|
|
17
|
+
* Backoffice consume este endpoint para mostrar el historial.
|
|
18
|
+
*/
|
|
19
|
+
listSignedByDirectory(directoryId: string, enterprise?: string): Promise<any>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Obtiene una URL pre-firmada (15 min) para visualizar inline el PDF firmado.
|
|
23
|
+
*/
|
|
24
|
+
getContractPdfUrl(contractId: string, partnerId: string, category?: string): Promise<any>;
|
|
14
25
|
}
|