@zauru-sdk/services 2.0.184 → 2.0.186

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.
@@ -2,11 +2,15 @@ import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
2
2
  import { getGraphQLAPIHeaders } from "../common.js";
3
3
  import { httpGraphQLAPI } from "./httpGraphQL.js";
4
4
  import { getEmployeesByAgencyIdStringQuery, getEmployeesStringQuery, } from "@zauru-sdk/graphql";
5
- export async function getEmployees(session) {
5
+ export async function getEmployees(session, filters) {
6
6
  return handlePossibleAxiosErrors(async () => {
7
7
  const headers = await getGraphQLAPIHeaders(session);
8
+ const initialFilters = {
9
+ ...(filters ? filters : {}),
10
+ };
11
+ const query = getEmployeesStringQuery(initialFilters);
8
12
  const response = await httpGraphQLAPI.post("", {
9
- query: getEmployeesStringQuery,
13
+ query,
10
14
  }, { headers });
11
15
  if (response.data.errors) {
12
16
  throw new Error(response.data.errors.map((x) => x.message).join(";"));
@@ -4,6 +4,7 @@ import { AxiosUtilsResponse, CaseGraphQL } from "@zauru-sdk/types";
4
4
  * getCases
5
5
  */
6
6
  export declare function getCases(session: Session, filters?: {
7
+ id?: number;
7
8
  responsible_id?: number;
8
9
  closed?: boolean;
9
10
  client_id?: number;
@@ -1,6 +1,8 @@
1
1
  import type { Session } from "@remix-run/node";
2
2
  import { AxiosUtilsResponse, EmployeeGraphQL } from "@zauru-sdk/types";
3
- export declare function getEmployees(session: Session): Promise<AxiosUtilsResponse<EmployeeGraphQL[]>>;
3
+ export declare function getEmployees(session: Session, filters?: {
4
+ id?: number;
5
+ }): Promise<AxiosUtilsResponse<EmployeeGraphQL[]>>;
4
6
  /**
5
7
  * getEmployeesByAgencyId
6
8
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/services",
3
- "version": "2.0.184",
3
+ "version": "2.0.186",
4
4
  "description": "Servicios de consulta a Zauru",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -24,12 +24,12 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@remix-run/node": "^2.8.1",
27
- "@zauru-sdk/common": "^2.0.177",
27
+ "@zauru-sdk/common": "^2.0.186",
28
28
  "@zauru-sdk/config": "^2.0.100",
29
- "@zauru-sdk/graphql": "^2.0.184",
30
- "@zauru-sdk/types": "^2.0.177",
29
+ "@zauru-sdk/graphql": "^2.0.186",
30
+ "@zauru-sdk/types": "^2.0.186",
31
31
  "axios": "^1.6.7",
32
32
  "chalk": "5.3.0"
33
33
  },
34
- "gitHead": "04f5abcf077387b2dc0069077aae0f598f5b656b"
34
+ "gitHead": "ac66c630f3321403498b88e85be6bd8ad7655493"
35
35
  }