@zauru-sdk/services 2.0.200 → 2.0.203

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.
@@ -5,14 +5,18 @@ import { getCasesStringQuery } from "@zauru-sdk/graphql";
5
5
  import { httpZauru } from "./httpZauru.js";
6
6
  /**
7
7
  * getCases
8
+ * @param session
9
+ * @param filters
10
+ * @param includes (optional) Example: ["case_supplies { id }"]
11
+ * @returns
8
12
  */
9
- export async function getCases(session, filters) {
13
+ export async function getCases(session, filters, includes) {
10
14
  return handlePossibleAxiosErrors(async () => {
11
15
  const headers = await getGraphQLAPIHeaders(session);
12
16
  const initialFilters = {
13
17
  ...(filters ? filters : {}),
14
18
  };
15
- const query = getCasesStringQuery(initialFilters);
19
+ const query = getCasesStringQuery(initialFilters, includes);
16
20
  const response = await httpGraphQLAPI.post("", {
17
21
  query,
18
22
  }, { headers });
@@ -432,3 +432,15 @@ export async function deleteFormSubmission(headers, id) {
432
432
  return true;
433
433
  });
434
434
  }
435
+ /**
436
+ * sendFormSubmissionEmail
437
+ * @param headers
438
+ * @param id
439
+ * @param body
440
+ */
441
+ export async function sendFormSubmissionEmail(headers, id, body) {
442
+ return handlePossibleAxiosErrors(async () => {
443
+ await httpZauru.post(`/settings/forms/form_submissions/${id}/send_email.json`, body, { headers });
444
+ return true;
445
+ });
446
+ }
@@ -9,9 +9,7 @@ import { getSerialsStringQuery } from "@zauru-sdk/graphql";
9
9
  export async function getSerials(session, filters) {
10
10
  return handlePossibleAxiosErrors(async () => {
11
11
  const headers = await getGraphQLAPIHeaders(session);
12
- const defaultFilters = {
13
- name: undefined,
14
- };
12
+ const defaultFilters = {};
15
13
  const finalFilters = { ...defaultFilters, ...filters };
16
14
  const response = await httpGraphQLAPI.post("", {
17
15
  query: getSerialsStringQuery(finalFilters),
@@ -2,6 +2,10 @@ import type { Session } from "@remix-run/node";
2
2
  import { AxiosUtilsResponse, CaseGraphQL } from "@zauru-sdk/types";
3
3
  /**
4
4
  * getCases
5
+ * @param session
6
+ * @param filters
7
+ * @param includes (optional) Example: ["case_supplies { id }"]
8
+ * @returns
5
9
  */
6
10
  export declare function getCases(session: Session, filters?: {
7
11
  id?: number;
@@ -10,6 +14,8 @@ export declare function getCases(session: Session, filters?: {
10
14
  client_id?: number;
11
15
  tag_id?: string;
12
16
  limit?: number;
17
+ }, includes?: {
18
+ includeSerial?: boolean;
13
19
  }): Promise<AxiosUtilsResponse<CaseGraphQL[]>>;
14
20
  /**
15
21
  * createCase
@@ -108,3 +108,15 @@ export declare function updateSubmissionInvoiceFormSubmission(headers: any, body
108
108
  * @param body
109
109
  */
110
110
  export declare function deleteFormSubmission(headers: any, id: string | number): Promise<AxiosUtilsResponse<boolean>>;
111
+ /**
112
+ * sendFormSubmissionEmail
113
+ * @param headers
114
+ * @param id
115
+ * @param body
116
+ */
117
+ export declare function sendFormSubmissionEmail(headers: any, id: string | number, body: {
118
+ recipient_email: string;
119
+ recipient_name: string;
120
+ email_subject: string;
121
+ email_body: string;
122
+ }): Promise<AxiosUtilsResponse<boolean>>;
@@ -5,6 +5,7 @@ import { Session } from "@remix-run/node";
5
5
  */
6
6
  export declare function getSerials(session: Session, filters?: {
7
7
  name?: string;
8
+ id?: number | string;
8
9
  }): Promise<AxiosUtilsResponse<SerialGraphQL[]>>;
9
10
  /**
10
11
  * createSupportSerialAttended
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/services",
3
- "version": "2.0.200",
3
+ "version": "2.0.203",
4
4
  "description": "Servicios de consulta a Zauru",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -25,12 +25,12 @@
25
25
  "dependencies": {
26
26
  "@remix-run/node": "^2.8.1",
27
27
  "@upstash/redis": "^1.34.5",
28
- "@zauru-sdk/common": "^2.0.198",
28
+ "@zauru-sdk/common": "^2.0.203",
29
29
  "@zauru-sdk/config": "^2.0.100",
30
- "@zauru-sdk/graphql": "^2.0.195",
31
- "@zauru-sdk/types": "^2.0.197",
30
+ "@zauru-sdk/graphql": "^2.0.203",
31
+ "@zauru-sdk/types": "^2.0.203",
32
32
  "axios": "^1.6.7",
33
33
  "chalk": "5.3.0"
34
34
  },
35
- "gitHead": "03df85eff31f6d868ffd76806e59b32e214a821e"
35
+ "gitHead": "71ffd90ef4de8f031f2b507b38151902caaeb006"
36
36
  }