@fiado/api-invoker 1.5.38 → 1.5.39
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/referral-business/ReferralBusinessApi.d.ts +4 -0
- package/bin/referral-business/ReferralBusinessApi.js +4 -0
- package/bin/referral-business/interfaces/IReferralBusinessApi.d.ts +10 -0
- package/package.json +1 -1
- package/src/referral-business/ReferralBusinessApi.ts +5 -0
- package/src/referral-business/interfaces/IReferralBusinessApi.ts +8 -0
|
@@ -6,6 +6,10 @@ export declare class ReferralBusinessApi implements IReferralBusinessApi {
|
|
|
6
6
|
private httpRequest;
|
|
7
7
|
private readonly baseUrl;
|
|
8
8
|
constructor(httpRequest: IHttpRequest);
|
|
9
|
+
isDescendant(params: {
|
|
10
|
+
email: string;
|
|
11
|
+
directoryId: string;
|
|
12
|
+
}): Promise<FiadoApiResponse<boolean>>;
|
|
9
13
|
createAgent(params: {
|
|
10
14
|
directoryId: string;
|
|
11
15
|
notes?: string;
|
|
@@ -24,6 +24,10 @@ let ReferralBusinessApi = class ReferralBusinessApi {
|
|
|
24
24
|
this.httpRequest = httpRequest;
|
|
25
25
|
this.baseUrl = process.env.REFERRAL_BUSINESS_LAMBDA_URL || "";
|
|
26
26
|
}
|
|
27
|
+
async isDescendant(params) {
|
|
28
|
+
const url = `${this.baseUrl}private/agents/is-descendant?email=${params.email}&directoryId=${params.directoryId}`;
|
|
29
|
+
return await this.httpRequest.get(url);
|
|
30
|
+
}
|
|
27
31
|
async createAgent(params) {
|
|
28
32
|
const url = `${this.baseUrl}private/agents`;
|
|
29
33
|
return await this.httpRequest.post(url, params);
|
|
@@ -28,4 +28,14 @@ export interface IReferralBusinessApi {
|
|
|
28
28
|
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
29
29
|
*/
|
|
30
30
|
accountOpeningsBySponsor(newDirectoryId: string, scope: Scope): Promise<FiadoApiResponse<void>>;
|
|
31
|
+
/**
|
|
32
|
+
* Verifica si un agente es descendiente de otro agente.
|
|
33
|
+
* @param email Email del agente padre.
|
|
34
|
+
* @param directoryId ID del directorio del agente hijo.
|
|
35
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
36
|
+
*/
|
|
37
|
+
isDescendant(params: {
|
|
38
|
+
email: string;
|
|
39
|
+
directoryId: string;
|
|
40
|
+
}): Promise<FiadoApiResponse<boolean>>;
|
|
31
41
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.39",
|
|
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",
|
|
@@ -13,6 +13,11 @@ export class ReferralBusinessApi implements IReferralBusinessApi {
|
|
|
13
13
|
private readonly baseUrl = process.env.REFERRAL_BUSINESS_LAMBDA_URL || "";
|
|
14
14
|
|
|
15
15
|
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
16
|
+
|
|
17
|
+
async isDescendant(params: { email: string; directoryId: string; }): Promise<FiadoApiResponse<boolean>> {
|
|
18
|
+
const url = `${this.baseUrl}private/agents/is-descendant?email=${params.email}&directoryId=${params.directoryId}`;
|
|
19
|
+
return await this.httpRequest.get(url);
|
|
20
|
+
}
|
|
16
21
|
|
|
17
22
|
async createAgent(params: { directoryId: string; notes?: string; type?: string; category?: string; groupId?: string; }): Promise<FiadoApiResponse<any>> {
|
|
18
23
|
const url = `${this.baseUrl}private/agents`;
|
|
@@ -27,4 +27,12 @@ export interface IReferralBusinessApi {
|
|
|
27
27
|
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
28
28
|
*/
|
|
29
29
|
accountOpeningsBySponsor(newDirectoryId: string, scope:Scope): Promise<FiadoApiResponse<void>>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Verifica si un agente es descendiente de otro agente.
|
|
33
|
+
* @param email Email del agente padre.
|
|
34
|
+
* @param directoryId ID del directorio del agente hijo.
|
|
35
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
36
|
+
*/
|
|
37
|
+
isDescendant(params:{email: string; directoryId: string}): Promise<FiadoApiResponse<boolean>>;
|
|
30
38
|
}
|