@fiado/api-invoker 5.27.0 → 5.28.0

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,7 +1,8 @@
1
- import { IHttpRequest } from "@fiado/http-client";
1
+ import type { IHttpRequest } from "@fiado/http-client";
2
2
  import { IPeopleBusinessApi } from "./interfaces/IPeopleBusinessApi.js";
3
3
  type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
4
4
  import { CPStatusEnum } from "@fiado/type-kit/bin/identity/index.js";
5
+ import { PeopleBatchIncludeEnum, PeopleBatchResponse } from "@fiado/type-kit/bin/peopleBusiness/index.js";
5
6
  export default class PeopleBusinessApi implements IPeopleBusinessApi {
6
7
  private httpRequest;
7
8
  private readonly baseUrl;
@@ -18,5 +19,9 @@ export default class PeopleBusinessApi implements IPeopleBusinessApi {
18
19
  }[];
19
20
  index: string | null;
20
21
  }>>;
22
+ getByIds(params: {
23
+ ids: string[];
24
+ include?: PeopleBatchIncludeEnum;
25
+ }): Promise<FiadoApiResponse<PeopleBatchResponse>>;
21
26
  }
22
27
  export {};
@@ -31,6 +31,14 @@ let PeopleBusinessApi = class PeopleBusinessApi {
31
31
  const queryString = queryParamsArray.length > 0 ? '?' + queryParamsArray.join('&') : '';
32
32
  return this.httpRequest.get(`${this.baseUrl}private/people/get/cpstatus/${params.cpStatus}${queryString}`);
33
33
  }
34
+ getByIds(params) {
35
+ const queryParamsArray = params.ids.map((id) => `id=${encodeURIComponent(id)}`);
36
+ if (params.include) {
37
+ queryParamsArray.push(`include=${params.include}`);
38
+ }
39
+ const queryString = queryParamsArray.length > 0 ? '?' + queryParamsArray.join('&') : '';
40
+ return this.httpRequest.get(`${this.baseUrl}private/people/batch${queryString}`);
41
+ }
34
42
  };
35
43
  PeopleBusinessApi = __decorate([
36
44
  injectable(),
@@ -1,4 +1,5 @@
1
1
  import { CPStatusEnum } from "@fiado/type-kit/bin/identity/index.js";
2
+ import { PeopleBatchIncludeEnum, PeopleBatchResponse } from "@fiado/type-kit/bin/peopleBusiness/index.js";
2
3
  type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
3
4
  export interface IPeopleBusinessApi {
4
5
  getByCPStatus(params: {
@@ -13,5 +14,14 @@ export interface IPeopleBusinessApi {
13
14
  }[];
14
15
  index: string | null;
15
16
  }>>;
17
+ /**
18
+ * Lee hasta 100 peopleIds de una sola vez. `include` acota a una sola tabla; omitirlo lee
19
+ * People_GT y AccountRequirementControl_GT. La respuesta trae `notFound` con los ids que
20
+ * ninguna tabla devolvio.
21
+ */
22
+ getByIds(params: {
23
+ ids: string[];
24
+ include?: PeopleBatchIncludeEnum;
25
+ }): Promise<FiadoApiResponse<PeopleBatchResponse>>;
16
26
  }
17
27
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "5.27.0",
3
+ "version": "5.28.0",
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
  "type": "module",
6
6
  "main": "bin/index.js",
@@ -34,7 +34,7 @@
34
34
  "@fiado/gateway-adapter": "^3.9.0",
35
35
  "@fiado/http-client": "^2.0.1",
36
36
  "@fiado/logger": "^1.1.3",
37
- "@fiado/type-kit": "^3.295.0",
37
+ "@fiado/type-kit": "^3.305.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -1,8 +1,9 @@
1
1
  import { inject, injectable } from "inversify";
2
- import { IHttpRequest } from "@fiado/http-client";
2
+ import type { IHttpRequest } from "@fiado/http-client";
3
3
  import { IPeopleBusinessApi } from "./interfaces/IPeopleBusinessApi.js";
4
4
  type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
5
5
  import { CPStatusEnum } from "@fiado/type-kit/bin/identity/index.js";
6
+ import { PeopleBatchIncludeEnum, PeopleBatchResponse } from "@fiado/type-kit/bin/peopleBusiness/index.js";
6
7
 
7
8
 
8
9
  @injectable()
@@ -28,5 +29,15 @@ export default class PeopleBusinessApi implements IPeopleBusinessApi {
28
29
  const queryString = queryParamsArray.length > 0 ? '?' + queryParamsArray.join('&') : '';
29
30
  return this.httpRequest.get(`${this.baseUrl}private/people/get/cpstatus/${params.cpStatus}${queryString}`);
30
31
  }
32
+
33
+ getByIds(params: { ids: string[]; include?: PeopleBatchIncludeEnum; }): Promise<FiadoApiResponse<PeopleBatchResponse>> {
34
+ const queryParamsArray = params.ids.map((id) => `id=${encodeURIComponent(id)}`);
35
+ if (params.include) {
36
+ queryParamsArray.push(`include=${params.include}`);
37
+ }
38
+
39
+ const queryString = queryParamsArray.length > 0 ? '?' + queryParamsArray.join('&') : '';
40
+ return this.httpRequest.get(`${this.baseUrl}private/people/batch${queryString}`);
41
+ }
31
42
  }
32
43
 
@@ -1,8 +1,15 @@
1
1
  import { CPStatusEnum } from "@fiado/type-kit/bin/identity/index.js";
2
+ import { PeopleBatchIncludeEnum, PeopleBatchResponse } from "@fiado/type-kit/bin/peopleBusiness/index.js";
2
3
  type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
3
4
 
4
5
 
5
6
  export interface IPeopleBusinessApi {
6
7
  getByCPStatus(params: { index: string; pageSize: number; cpStatus: CPStatusEnum; sort: "ascending" | "descending"; }): Promise<FiadoApiResponse<{ items: {people: any, accountRequirementControl: any}[]; index: string | null; }>>;
7
8
 
9
+ /**
10
+ * Lee hasta 100 peopleIds de una sola vez. `include` acota a una sola tabla; omitirlo lee
11
+ * People_GT y AccountRequirementControl_GT. La respuesta trae `notFound` con los ids que
12
+ * ninguna tabla devolvio.
13
+ */
14
+ getByIds(params: { ids: string[]; include?: PeopleBatchIncludeEnum }): Promise<FiadoApiResponse<PeopleBatchResponse>>;
8
15
  }