@fiado/api-invoker 1.0.46 → 1.0.48

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,5 +1,5 @@
1
1
  import { IAccountFiadoSAApi } from "./interfaces/IAccountFiadoSAApi";
2
- import { AccountCreateRequest, AccountCreateResponse } from "@fiado/type-kit/bin/account";
2
+ import { AccountCreateRequest, AccountCreateResponse, GetAccountResponse } from "@fiado/type-kit/bin/account";
3
3
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
4
4
  import { IHttpRequest } from "@fiado/http-client";
5
5
  export default class AccountFiadoSAApi implements IAccountFiadoSAApi {
@@ -7,4 +7,5 @@ export default class AccountFiadoSAApi implements IAccountFiadoSAApi {
7
7
  private readonly baseUrl;
8
8
  constructor(httpRequest: IHttpRequest);
9
9
  createAccount(data: AccountCreateRequest): Promise<ApiGatewayResponse<AccountCreateResponse[]>>;
10
+ getAccountByDirectoryId(directoryId: string): Promise<ApiGatewayResponse<GetAccountResponse[]>>;
10
11
  }
@@ -22,6 +22,10 @@ let AccountFiadoSAApi = class AccountFiadoSAApi {
22
22
  const url = `${this.baseUrl}`;
23
23
  return await this.httpRequest.post(url, data);
24
24
  }
25
+ async getAccountByDirectoryId(directoryId) {
26
+ const url = `${this.baseUrl}/${directoryId}`;
27
+ return await this.httpRequest.get(url);
28
+ }
25
29
  };
26
30
  AccountFiadoSAApi = __decorate([
27
31
  (0, inversify_1.injectable)(),
@@ -1,5 +1,6 @@
1
- import { AccountCreateRequest, AccountCreateResponse } from "@fiado/type-kit/bin/account";
1
+ import { AccountCreateRequest, AccountCreateResponse, GetAccountResponse } from "@fiado/type-kit/bin/account";
2
2
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
3
3
  export interface IAccountFiadoSAApi {
4
4
  createAccount(data: AccountCreateRequest): Promise<ApiGatewayResponse<AccountCreateResponse[]>>;
5
+ getAccountByDirectoryId(directoryId: string): Promise<ApiGatewayResponse<GetAccountResponse[]>>;
5
6
  }
@@ -8,4 +8,5 @@ export declare class DirectoryApi implements IDirectoryApi {
8
8
  getByIds(ids: string[]): Promise<any>;
9
9
  updateExternalUserId(directoryId: string, provider: Provider, externalUserId: string): Promise<void>;
10
10
  updateScope(directoryId: string, scope: string[]): Promise<void>;
11
+ getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any>;
11
12
  }
@@ -53,6 +53,11 @@ let DirectoryApi = class DirectoryApi {
53
53
  };
54
54
  return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
55
55
  }
56
+ async getByOwnerDirectoryId(ownerDirectoryId) {
57
+ const url = `${this.baseUrl}?ownerDirectoryId=${ownerDirectoryId}`;
58
+ const operationName = "getByOwnerDirectoryId";
59
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
60
+ }
56
61
  };
57
62
  exports.DirectoryApi = DirectoryApi;
58
63
  exports.DirectoryApi = DirectoryApi = __decorate([
@@ -28,4 +28,12 @@ export interface IDirectoryApi {
28
28
  * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
29
29
  */
30
30
  updateScope(directoryId: string, scope: string[]): Promise<void>;
31
+ /**
32
+ * Obtiene un directorio por su ID de directorio propietario.
33
+ * @param ownerDirectoryId ID de directorio propietario (UUID) a buscar.
34
+ * @returns Una promesa que resuelve a un objeto de directorio.
35
+ * Puede devolver un objeto vacío si no se encuentra coincidencia.
36
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
37
+ */
38
+ getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any>;
31
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.0.46",
3
+ "version": "1.0.48",
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",
@@ -1,5 +1,5 @@
1
1
  import {IAccountFiadoSAApi} from "./interfaces/IAccountFiadoSAApi";
2
- import {AccountCreateRequest, AccountCreateResponse} from "@fiado/type-kit/bin/account";
2
+ import {AccountCreateRequest, AccountCreateResponse, GetAccountResponse} from "@fiado/type-kit/bin/account";
3
3
  import {ApiGatewayResponse} from "@fiado/gateway-adapter";
4
4
  import {inject, injectable} from "inversify";
5
5
  import {IHttpRequest} from "@fiado/http-client";
@@ -15,4 +15,9 @@ export default class AccountFiadoSAApi implements IAccountFiadoSAApi {
15
15
  const url = `${this.baseUrl}`;
16
16
  return await this.httpRequest.post(url, data);
17
17
  }
18
+
19
+ async getAccountByDirectoryId(directoryId: string): Promise<ApiGatewayResponse<GetAccountResponse[]>> {
20
+ const url = `${this.baseUrl}/${directoryId}`;
21
+ return await this.httpRequest.get(url);
22
+ }
18
23
  }
@@ -1,7 +1,10 @@
1
- import {AccountCreateRequest, AccountCreateResponse} from "@fiado/type-kit/bin/account";
1
+ import {AccountCreateRequest, AccountCreateResponse, GetAccountResponse} from "@fiado/type-kit/bin/account";
2
2
  import {ApiGatewayResponse} from "@fiado/gateway-adapter";
3
3
 
4
4
 
5
5
  export interface IAccountFiadoSAApi {
6
6
  createAccount(data: AccountCreateRequest): Promise<ApiGatewayResponse<AccountCreateResponse[]>>;
7
+
8
+ getAccountByDirectoryId(directoryId: string): Promise<ApiGatewayResponse<GetAccountResponse[]>>;
9
+
7
10
  }
@@ -54,4 +54,13 @@ export class DirectoryApi implements IDirectoryApi {
54
54
 
55
55
  return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
56
56
  }
57
+
58
+ public async getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any> {
59
+
60
+ const url = `${this.baseUrl}?ownerDirectoryId=${ownerDirectoryId}`;
61
+ const operationName = "getByOwnerDirectoryId";
62
+
63
+
64
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
65
+ }
57
66
  }
@@ -32,4 +32,13 @@ export interface IDirectoryApi {
32
32
  * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
33
33
  */
34
34
  updateScope(directoryId: string, scope: string[]): Promise<void>;
35
+
36
+ /**
37
+ * Obtiene un directorio por su ID de directorio propietario.
38
+ * @param ownerDirectoryId ID de directorio propietario (UUID) a buscar.
39
+ * @returns Una promesa que resuelve a un objeto de directorio.
40
+ * Puede devolver un objeto vacío si no se encuentra coincidencia.
41
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
42
+ */
43
+ getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any>
35
44
  }