@fiado/api-invoker 1.1.65 → 1.1.67
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/transaction/api/TransactionApi.d.ts +4 -0
- package/bin/transaction/api/TransactionApi.js +6 -2
- package/bin/transaction/api/interfaces/ITransactionApi.d.ts +4 -0
- package/package.json +1 -1
- package/src/transaction/api/TransactionApi.ts +8 -2
- package/src/transaction/api/interfaces/ITransactionApi.ts +2 -0
|
@@ -5,6 +5,10 @@ export default class TransactionApi implements ITransactionApi {
|
|
|
5
5
|
private httpRequest;
|
|
6
6
|
private readonly baseUrl;
|
|
7
7
|
constructor(httpRequest: IHttpRequest);
|
|
8
|
+
getTransactionDetailById(params: {
|
|
9
|
+
id: string;
|
|
10
|
+
source: TransactionSourceEnum;
|
|
11
|
+
}): Promise<any>;
|
|
8
12
|
getTransactionsByDirectoryIdAndSource(params: {
|
|
9
13
|
directoryId: string;
|
|
10
14
|
source: TransactionSourceEnum;
|
|
@@ -16,7 +16,11 @@ const inversify_1 = require("inversify");
|
|
|
16
16
|
let TransactionApi = class TransactionApi {
|
|
17
17
|
constructor(httpRequest) {
|
|
18
18
|
this.httpRequest = httpRequest;
|
|
19
|
-
this.baseUrl = process.env.
|
|
19
|
+
this.baseUrl = process.env.TRANSACTION_LAMBDA_URL || "";
|
|
20
|
+
}
|
|
21
|
+
async getTransactionDetailById(params) {
|
|
22
|
+
const url = `${this.baseUrl}/private/transaction${params.source}/${params.id}`;
|
|
23
|
+
return await this.httpRequest.get(url);
|
|
20
24
|
}
|
|
21
25
|
async getTransactionsByDirectoryIdAndSource(params) {
|
|
22
26
|
let queryParams = [];
|
|
@@ -44,7 +48,7 @@ let TransactionApi = class TransactionApi {
|
|
|
44
48
|
return await this.httpRequest.get(url);
|
|
45
49
|
}
|
|
46
50
|
async getTransactionDetailByTransactionNumber(params) {
|
|
47
|
-
const url = `${this.baseUrl}
|
|
51
|
+
const url = `${this.baseUrl}/private/${params.transactionNumber}/${params.directoryId}/${params.source}`;
|
|
48
52
|
return await this.httpRequest.get(url);
|
|
49
53
|
}
|
|
50
54
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.67",
|
|
4
4
|
"description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a traves de invocaciones http",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -6,10 +6,16 @@ import { TransactionSourceEnum } from "@fiado/type-kit/bin/transaction";
|
|
|
6
6
|
|
|
7
7
|
@injectable()
|
|
8
8
|
export default class TransactionApi implements ITransactionApi {
|
|
9
|
-
private readonly baseUrl = process.env.
|
|
9
|
+
private readonly baseUrl = process.env.TRANSACTION_LAMBDA_URL || "";
|
|
10
10
|
|
|
11
11
|
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
12
12
|
}
|
|
13
|
+
|
|
14
|
+
async getTransactionDetailById(params: { id: string; source: TransactionSourceEnum; }): Promise<any> {
|
|
15
|
+
const url: string = `${this.baseUrl}/private/transaction${params.source}/${params.id}`;
|
|
16
|
+
return await this.httpRequest.get(url);
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
async getTransactionsByDirectoryIdAndSource(params: { directoryId: string; source: TransactionSourceEnum; index?: string; pageSize?: number; }): Promise<any> {
|
|
14
20
|
|
|
15
21
|
let queryParams = [];
|
|
@@ -44,7 +50,7 @@ export default class TransactionApi implements ITransactionApi {
|
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
async getTransactionDetailByTransactionNumber(params:{transactionNumber:string,directoryId:string,source:TransactionSourceEnum}): Promise<any> {
|
|
47
|
-
const url: string = `${this.baseUrl}
|
|
53
|
+
const url: string = `${this.baseUrl}/private/${params.transactionNumber}/${params.directoryId}/${params.source}`;
|
|
48
54
|
return await this.httpRequest.get(url);
|
|
49
55
|
}
|
|
50
56
|
|
|
@@ -19,4 +19,6 @@ export interface ITransactionApi {
|
|
|
19
19
|
}): Promise<any>;
|
|
20
20
|
|
|
21
21
|
getTransactionDetailByTransactionNumber(params:{transactionNumber:string,directoryId:string,source:TransactionSourceEnum}): Promise<any>
|
|
22
|
+
|
|
23
|
+
getTransactionDetailById(params:{id:string, source: TransactionSourceEnum }): Promise<any>
|
|
22
24
|
}
|