@fiado/api-invoker 1.5.16 → 1.5.18
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/account-pagoconfiado/AccountPagoConfiadoApi.d.ts +5 -0
- package/bin/account-pagoconfiado/AccountPagoConfiadoApi.js +14 -0
- package/bin/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.d.ts +5 -0
- package/bin/referral-business/ReferralBusinessApi.d.ts +2 -1
- package/bin/referral-business/ReferralBusinessApi.js +2 -2
- package/bin/referral-business/interfaces/IReferralBusinessApi.d.ts +2 -1
- package/package.json +2 -2
- package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +21 -1
- package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +12 -3
- package/src/referral-business/ReferralBusinessApi.ts +3 -2
- package/src/referral-business/interfaces/IReferralBusinessApi.ts +2 -1
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +0 -46
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.js +0 -2
- package/bin/estafeta/EstafetaApi.d.ts +0 -0
- package/bin/estafeta/EstafetaApi.js +0 -0
|
@@ -14,4 +14,9 @@ export default class AccountPagoConfiadoApi implements IAccountPagoConfiadoApi {
|
|
|
14
14
|
update(directoryId: string, data: AccountUpdateRequest): Promise<ApiGatewayResponse<void>>;
|
|
15
15
|
updateByAccountNumber(accountNumber: string, data: AccountUpdateRequest): Promise<ApiGatewayResponse<void>>;
|
|
16
16
|
getAccountByAccountNumber(accountNumber: string): Promise<ApiGatewayResponse<void>>;
|
|
17
|
+
getAccountListByDateMinorOrEqual(params: {
|
|
18
|
+
index?: string | null;
|
|
19
|
+
pageSize?: string;
|
|
20
|
+
date?: string;
|
|
21
|
+
}): Promise<ApiGatewayResponse<any>>;
|
|
17
22
|
}
|
|
@@ -46,6 +46,20 @@ let AccountPagoConfiadoApi = class AccountPagoConfiadoApi {
|
|
|
46
46
|
const url = `${this.baseUrl}users/accountNumber/${accountNumber}`;
|
|
47
47
|
return await this.httpRequest.get(url);
|
|
48
48
|
}
|
|
49
|
+
async getAccountListByDateMinorOrEqual(params) {
|
|
50
|
+
let queryParams = [];
|
|
51
|
+
if (params.index) {
|
|
52
|
+
queryParams.push(`index=${params.index}`);
|
|
53
|
+
}
|
|
54
|
+
if (params.pageSize) {
|
|
55
|
+
queryParams.push(`pageSize=${params.pageSize}`);
|
|
56
|
+
}
|
|
57
|
+
if (params.date) {
|
|
58
|
+
queryParams.push(`date=${params.date}`);
|
|
59
|
+
}
|
|
60
|
+
const url = `${this.baseUrl}?${queryParams.join('&')}`;
|
|
61
|
+
return await this.httpRequest.get(url);
|
|
62
|
+
}
|
|
49
63
|
};
|
|
50
64
|
AccountPagoConfiadoApi = __decorate([
|
|
51
65
|
(0, inversify_1.injectable)(),
|
|
@@ -9,4 +9,9 @@ export interface IAccountPagoConfiadoApi {
|
|
|
9
9
|
updateByAccountNumber(accountNumber: string, data: AccountUpdateRequest): Promise<ApiGatewayResponse<void>>;
|
|
10
10
|
getAccountByAccountNumber(accountNumber: string): Promise<ApiGatewayResponse<void>>;
|
|
11
11
|
cancelAccount(directoryId: string, accountNumber?: string, documentNumber?: string): Promise<ApiGatewayResponse<void>>;
|
|
12
|
+
getAccountListByDateMinorOrEqual(params: {
|
|
13
|
+
index?: string | null;
|
|
14
|
+
pageSize?: string;
|
|
15
|
+
date?: string;
|
|
16
|
+
}): Promise<ApiGatewayResponse<any>>;
|
|
12
17
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { IReferralBusinessApi } from "./interfaces/IReferralBusinessApi";
|
|
3
3
|
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
4
|
+
import { Scope } from "@fiado/type-kit/bin/directory/enums/Scope";
|
|
4
5
|
export declare class ReferralBusinessApi implements IReferralBusinessApi {
|
|
5
6
|
private httpRequest;
|
|
6
7
|
private readonly baseUrl;
|
|
@@ -13,5 +14,5 @@ export declare class ReferralBusinessApi implements IReferralBusinessApi {
|
|
|
13
14
|
groupId?: string;
|
|
14
15
|
}): Promise<FiadoApiResponse<any>>;
|
|
15
16
|
getByDirectoryId(directoryId: string): Promise<FiadoApiResponse<any>>;
|
|
16
|
-
accountOpeningsBySponsor(newDirectoryId: string): Promise<FiadoApiResponse<any>>;
|
|
17
|
+
accountOpeningsBySponsor(newDirectoryId: string, scope: Scope): Promise<FiadoApiResponse<any>>;
|
|
17
18
|
}
|
|
@@ -32,9 +32,9 @@ let ReferralBusinessApi = class ReferralBusinessApi {
|
|
|
32
32
|
const url = `${this.baseUrl}private/agents/directoryId/${directoryId}`;
|
|
33
33
|
return await this.httpRequest.get(url);
|
|
34
34
|
}
|
|
35
|
-
async accountOpeningsBySponsor(newDirectoryId) {
|
|
35
|
+
async accountOpeningsBySponsor(newDirectoryId, scope) {
|
|
36
36
|
const url = `${this.baseUrl}private/account-openings-by-sponsor/${newDirectoryId}`;
|
|
37
|
-
return await this.httpRequest.post(url, { directoryId: newDirectoryId });
|
|
37
|
+
return await this.httpRequest.post(url, { directoryId: newDirectoryId, scope });
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
exports.ReferralBusinessApi = ReferralBusinessApi;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
2
|
+
import { Scope } from "@fiado/type-kit/bin/directory/enums/Scope";
|
|
2
3
|
/**
|
|
3
4
|
* Interfaz para el servicio Payroll que permite operaciones sobre payroll.
|
|
4
5
|
*/
|
|
@@ -26,5 +27,5 @@ export interface IReferralBusinessApi {
|
|
|
26
27
|
* @param newDirectoryId ID del nuevo directorio.
|
|
27
28
|
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
28
29
|
*/
|
|
29
|
-
accountOpeningsBySponsor(newDirectoryId: string): Promise<FiadoApiResponse<void>>;
|
|
30
|
+
accountOpeningsBySponsor(newDirectoryId: string, scope: Scope): Promise<FiadoApiResponse<void>>;
|
|
30
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.18",
|
|
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": "^2.
|
|
19
|
+
"@fiado/type-kit": "^2.0.76",
|
|
20
20
|
"dotenv": "^16.4.7",
|
|
21
21
|
"inversify": "^6.2.2",
|
|
22
22
|
"reflect-metadata": "^0.2.2"
|
|
@@ -9,7 +9,7 @@ import { Provider } from "@fiado/type-kit/bin/provider";
|
|
|
9
9
|
export default class AccountPagoConfiadoApi implements IAccountPagoConfiadoApi {
|
|
10
10
|
private readonly baseUrl = process.env.ACCOUNT_PAGOCONFIADO_LAMBDA_URL || "";
|
|
11
11
|
|
|
12
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
|
|
12
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
|
|
13
13
|
|
|
14
14
|
async cancelAccount(directoryId:string,accountNumber?: string, documentNumber?: string): Promise<ApiGatewayResponse<void>> {
|
|
15
15
|
const url = `${this.baseUrl}/cancel`;
|
|
@@ -45,4 +45,24 @@ export default class AccountPagoConfiadoApi implements IAccountPagoConfiadoApi {
|
|
|
45
45
|
const url = `${this.baseUrl}users/accountNumber/${accountNumber}`;
|
|
46
46
|
return await this.httpRequest.get(url);
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
async getAccountListByDateMinorOrEqual(params: { index?: string | null; pageSize?: string; date?: string; }): Promise<ApiGatewayResponse<any>> {
|
|
50
|
+
|
|
51
|
+
let queryParams = [];
|
|
52
|
+
|
|
53
|
+
if (params.index) {
|
|
54
|
+
queryParams.push(`index=${params.index}`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (params.pageSize) {
|
|
58
|
+
queryParams.push(`pageSize=${params.pageSize}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (params.date) {
|
|
62
|
+
queryParams.push(`date=${params.date}`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const url = `${this.baseUrl}?${queryParams.join('&')}`;
|
|
66
|
+
return await this.httpRequest.get(url);
|
|
67
|
+
}
|
|
48
68
|
}
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
AccountUpdateRequest,
|
|
6
6
|
GetAccountResponse
|
|
7
7
|
} from "@fiado/type-kit/bin/account";
|
|
8
|
-
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
8
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
9
9
|
import { Provider } from "@fiado/type-kit/bin/provider";
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
export interface IAccountPagoConfiadoApi {
|
|
13
13
|
createAccount(provider: Provider, data: AccountCreateRequest): Promise<ApiGatewayResponse<AccountCreateResponse>>;
|
|
14
14
|
|
|
15
|
-
getAccountByDirectoryId(directoryId: string, provider:string): Promise<ApiGatewayResponse<GetAccountResponse[]>>;
|
|
15
|
+
getAccountByDirectoryId(directoryId: string, provider: string): Promise<ApiGatewayResponse<GetAccountResponse[]>>;
|
|
16
16
|
|
|
17
17
|
updateAccountBalance(accountId: string, params: AccountUpdateBalanceRequest): Promise<ApiGatewayResponse<Boolean>>;
|
|
18
18
|
|
|
@@ -22,5 +22,14 @@ export interface IAccountPagoConfiadoApi {
|
|
|
22
22
|
|
|
23
23
|
getAccountByAccountNumber(accountNumber: string): Promise<ApiGatewayResponse<void>>;
|
|
24
24
|
|
|
25
|
-
cancelAccount(directoryId:string,accountNumber?:string,documentNumber?:string): Promise<ApiGatewayResponse<void>>;
|
|
25
|
+
cancelAccount(directoryId: string, accountNumber?: string, documentNumber?: string): Promise<ApiGatewayResponse<void>>;
|
|
26
|
+
|
|
27
|
+
getAccountListByDateMinorOrEqual(
|
|
28
|
+
params: {
|
|
29
|
+
|
|
30
|
+
index?: string | null,
|
|
31
|
+
pageSize?: string,
|
|
32
|
+
date?: string,
|
|
33
|
+
}
|
|
34
|
+
): Promise<ApiGatewayResponse<any>>;
|
|
26
35
|
}
|
|
@@ -3,6 +3,7 @@ import { IHttpRequest } from "@fiado/http-client";
|
|
|
3
3
|
import dotenv from 'dotenv';
|
|
4
4
|
import { IReferralBusinessApi } from "./interfaces/IReferralBusinessApi";
|
|
5
5
|
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
6
|
+
import { Scope } from "@fiado/type-kit/bin/directory/enums/Scope";
|
|
6
7
|
|
|
7
8
|
dotenv.config();
|
|
8
9
|
|
|
@@ -23,10 +24,10 @@ export class ReferralBusinessApi implements IReferralBusinessApi {
|
|
|
23
24
|
return await this.httpRequest.get(url);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
async accountOpeningsBySponsor(newDirectoryId: string): Promise<FiadoApiResponse<any>> {
|
|
27
|
+
async accountOpeningsBySponsor(newDirectoryId: string, scope: Scope): Promise<FiadoApiResponse<any>> {
|
|
27
28
|
|
|
28
29
|
const url = `${this.baseUrl}private/account-openings-by-sponsor/${newDirectoryId}`;
|
|
29
30
|
|
|
30
|
-
return await this.httpRequest.post(url, { directoryId: newDirectoryId });
|
|
31
|
+
return await this.httpRequest.post(url, { directoryId: newDirectoryId, scope });
|
|
31
32
|
}
|
|
32
33
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
2
|
+
import { Scope } from "@fiado/type-kit/bin/directory/enums/Scope";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Interfaz para el servicio Payroll que permite operaciones sobre payroll.
|
|
@@ -25,5 +26,5 @@ export interface IReferralBusinessApi {
|
|
|
25
26
|
* @param newDirectoryId ID del nuevo directorio.
|
|
26
27
|
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
27
28
|
*/
|
|
28
|
-
accountOpeningsBySponsor(newDirectoryId: string): Promise<FiadoApiResponse<void>>;
|
|
29
|
+
accountOpeningsBySponsor(newDirectoryId: string, scope:Scope): Promise<FiadoApiResponse<void>>;
|
|
29
30
|
}
|
|
@@ -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
|