@zauru-sdk/services 1.0.50 → 1.0.60

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.
Files changed (111) hide show
  1. package/LICENCE.md +11 -11
  2. package/dist/cjs/common.js +235 -0
  3. package/dist/cjs/index.js +50 -0
  4. package/dist/cjs/sessions/sessions.js +18 -0
  5. package/dist/cjs/sessions/upstash.js +59 -0
  6. package/dist/cjs/zauru/httpGraphQL.js +42 -0
  7. package/dist/cjs/zauru/httpOauth.js +42 -0
  8. package/dist/cjs/zauru/httpZauru.js +42 -0
  9. package/dist/cjs/zauru/zauru-agencies.js +27 -0
  10. package/dist/cjs/zauru/zauru-automatic-numbers.js +28 -0
  11. package/dist/cjs/zauru/zauru-bookings.js +90 -0
  12. package/dist/cjs/zauru/zauru-bundles.js +104 -0
  13. package/dist/cjs/zauru/zauru-cases.js +30 -0
  14. package/dist/cjs/zauru/zauru-consolidated.js +81 -0
  15. package/dist/cjs/zauru/zauru-currencies.js +27 -0
  16. package/dist/cjs/zauru/zauru-deliveries.js +53 -0
  17. package/dist/cjs/zauru/zauru-discharges.js +55 -0
  18. package/dist/cjs/zauru/zauru-employees.js +30 -0
  19. package/dist/cjs/zauru/zauru-forms.js +398 -0
  20. package/dist/cjs/zauru/zauru-invoices.js +104 -0
  21. package/dist/cjs/zauru/zauru-items.js +293 -0
  22. package/dist/cjs/zauru/zauru-lote-record.js +33 -0
  23. package/dist/cjs/zauru/zauru-lotes.js +312 -0
  24. package/dist/cjs/zauru/zauru-motivos-rechazo.js +57 -0
  25. package/dist/cjs/zauru/zauru-payees.js +247 -0
  26. package/dist/cjs/zauru/zauru-payment-terms.js +75 -0
  27. package/dist/cjs/zauru/zauru-price-lists.js +49 -0
  28. package/dist/cjs/zauru/zauru-profiles.js +80 -0
  29. package/dist/cjs/zauru/zauru-purchase-orders.js +438 -0
  30. package/dist/cjs/zauru/zauru-receptions.js +104 -0
  31. package/dist/cjs/zauru/zauru-shipments.js +62 -0
  32. package/dist/cjs/zauru/zauru-suggested-prices.js +94 -0
  33. package/dist/cjs/zauru/zauru-tags.js +20 -0
  34. package/dist/cjs/zauru/zauru-templates.js +22 -0
  35. package/dist/cjs/zauru/zauru-variables.js +56 -0
  36. package/dist/cjs/zauru/zauru-web-app-tables.js +167 -0
  37. package/dist/{zauru → esm/zauru}/zauru-forms.js +34 -1
  38. package/dist/zauru/zauru-forms.d.ts +7 -0
  39. package/dist/zauru/zauru-lotes.d.ts +0 -20
  40. package/package.json +15 -12
  41. package/CHANGELOG.md +0 -240
  42. package/src/common.ts +0 -343
  43. package/src/index.ts +0 -37
  44. package/src/sessions/sessions.ts +0 -17
  45. package/src/sessions/upstash.ts +0 -55
  46. package/src/zauru/httpGraphQL.ts +0 -55
  47. package/src/zauru/httpOauth.ts +0 -55
  48. package/src/zauru/httpZauru.ts +0 -56
  49. package/src/zauru/zauru-agencies.ts +0 -32
  50. package/src/zauru/zauru-automatic-numbers.ts +0 -35
  51. package/src/zauru/zauru-bookings.ts +0 -134
  52. package/src/zauru/zauru-bundles.ts +0 -157
  53. package/src/zauru/zauru-cases.ts +0 -44
  54. package/src/zauru/zauru-consolidated.ts +0 -129
  55. package/src/zauru/zauru-currencies.ts +0 -39
  56. package/src/zauru/zauru-deliveries.ts +0 -70
  57. package/src/zauru/zauru-discharges.ts +0 -90
  58. package/src/zauru/zauru-employees.ts +0 -43
  59. package/src/zauru/zauru-forms.ts +0 -618
  60. package/src/zauru/zauru-invoices.ts +0 -142
  61. package/src/zauru/zauru-items.ts +0 -481
  62. package/src/zauru/zauru-lote-record.ts +0 -77
  63. package/src/zauru/zauru-lotes.ts +0 -484
  64. package/src/zauru/zauru-motivos-rechazo.ts +0 -121
  65. package/src/zauru/zauru-payees.ts +0 -402
  66. package/src/zauru/zauru-payment-terms.ts +0 -126
  67. package/src/zauru/zauru-price-lists.ts +0 -68
  68. package/src/zauru/zauru-profiles.ts +0 -106
  69. package/src/zauru/zauru-purchase-orders.ts +0 -701
  70. package/src/zauru/zauru-receptions.ts +0 -148
  71. package/src/zauru/zauru-shipments.ts +0 -88
  72. package/src/zauru/zauru-suggested-prices.ts +0 -137
  73. package/src/zauru/zauru-tags.ts +0 -22
  74. package/src/zauru/zauru-templates.ts +0 -24
  75. package/src/zauru/zauru-variables.ts +0 -67
  76. package/src/zauru/zauru-web-app-tables.ts +0 -256
  77. package/tsconfig.json +0 -24
  78. /package/dist/{common.js → esm/common.js} +0 -0
  79. /package/dist/{index.js → esm/index.js} +0 -0
  80. /package/dist/{sessions → esm/sessions}/sessions.js +0 -0
  81. /package/dist/{sessions → esm/sessions}/upstash.js +0 -0
  82. /package/dist/{zauru → esm/zauru}/httpGraphQL.js +0 -0
  83. /package/dist/{zauru → esm/zauru}/httpOauth.js +0 -0
  84. /package/dist/{zauru → esm/zauru}/httpZauru.js +0 -0
  85. /package/dist/{zauru → esm/zauru}/zauru-agencies.js +0 -0
  86. /package/dist/{zauru → esm/zauru}/zauru-automatic-numbers.js +0 -0
  87. /package/dist/{zauru → esm/zauru}/zauru-bookings.js +0 -0
  88. /package/dist/{zauru → esm/zauru}/zauru-bundles.js +0 -0
  89. /package/dist/{zauru → esm/zauru}/zauru-cases.js +0 -0
  90. /package/dist/{zauru → esm/zauru}/zauru-consolidated.js +0 -0
  91. /package/dist/{zauru → esm/zauru}/zauru-currencies.js +0 -0
  92. /package/dist/{zauru → esm/zauru}/zauru-deliveries.js +0 -0
  93. /package/dist/{zauru → esm/zauru}/zauru-discharges.js +0 -0
  94. /package/dist/{zauru → esm/zauru}/zauru-employees.js +0 -0
  95. /package/dist/{zauru → esm/zauru}/zauru-invoices.js +0 -0
  96. /package/dist/{zauru → esm/zauru}/zauru-items.js +0 -0
  97. /package/dist/{zauru → esm/zauru}/zauru-lote-record.js +0 -0
  98. /package/dist/{zauru → esm/zauru}/zauru-lotes.js +0 -0
  99. /package/dist/{zauru → esm/zauru}/zauru-motivos-rechazo.js +0 -0
  100. /package/dist/{zauru → esm/zauru}/zauru-payees.js +0 -0
  101. /package/dist/{zauru → esm/zauru}/zauru-payment-terms.js +0 -0
  102. /package/dist/{zauru → esm/zauru}/zauru-price-lists.js +0 -0
  103. /package/dist/{zauru → esm/zauru}/zauru-profiles.js +0 -0
  104. /package/dist/{zauru → esm/zauru}/zauru-purchase-orders.js +0 -0
  105. /package/dist/{zauru → esm/zauru}/zauru-receptions.js +0 -0
  106. /package/dist/{zauru → esm/zauru}/zauru-shipments.js +0 -0
  107. /package/dist/{zauru → esm/zauru}/zauru-suggested-prices.js +0 -0
  108. /package/dist/{zauru → esm/zauru}/zauru-tags.js +0 -0
  109. /package/dist/{zauru → esm/zauru}/zauru-templates.js +0 -0
  110. /package/dist/{zauru → esm/zauru}/zauru-variables.js +0 -0
  111. /package/dist/{zauru → esm/zauru}/zauru-web-app-tables.js +0 -0
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.deleteBundle = exports.updateBundle = exports.createBundle = exports.getBundleByName = exports.getBundlesByItemCategoryId = void 0;
7
+ const common_1 = require("@zauru-sdk/common");
8
+ const common_js_1 = require("../common.js");
9
+ const httpGraphQL_js_1 = __importDefault(require("./httpGraphQL.js"));
10
+ const graphql_1 = require("@zauru-sdk/graphql");
11
+ const httpZauru_js_1 = __importDefault(require("./httpZauru.js"));
12
+ /**
13
+ * getBundlesByItemCategoryId
14
+ */
15
+ async function getBundlesByItemCategoryId(session, id) {
16
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
17
+ const headers = await (0, common_js_1.getGraphQLAPIHeaders)(session);
18
+ const response = await httpGraphQL_js_1.default.post("", {
19
+ query: graphql_1.getBundlesByItemCategoryIdStringQuery,
20
+ variables: {
21
+ id,
22
+ },
23
+ }, { headers });
24
+ if (response.data.errors) {
25
+ throw new Error(response.data.errors.map((x) => x.message).join(";"));
26
+ }
27
+ const registers = response?.data?.data?.bundles;
28
+ return registers;
29
+ });
30
+ }
31
+ exports.getBundlesByItemCategoryId = getBundlesByItemCategoryId;
32
+ /**
33
+ * getBundleByName
34
+ */
35
+ async function getBundleByName(session, name) {
36
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
37
+ const headers = await (0, common_js_1.getGraphQLAPIHeaders)(session);
38
+ const response = await httpGraphQL_js_1.default.post("", {
39
+ query: graphql_1.getBundleByNameStringQuery,
40
+ variables: {
41
+ name,
42
+ },
43
+ }, { headers });
44
+ if (response.data.errors) {
45
+ throw new Error(response.data.errors.map((x) => x.message).join(";"));
46
+ }
47
+ if (!response?.data?.data?.bundles[0]) {
48
+ throw new Error(`No se encontró ningún bundle con el nombre: ${name} asociado`);
49
+ }
50
+ const register = response?.data?.data?.bundles[0];
51
+ return register;
52
+ });
53
+ }
54
+ exports.getBundleByName = getBundleByName;
55
+ /**
56
+ * createBundle
57
+ * @param headers
58
+ * @param body
59
+ */
60
+ async function createBundle(headers, body) {
61
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
62
+ const sendBody = {
63
+ ...body,
64
+ bundle_details_attributes: (0, common_1.arrayToObject)(body.bundle_details, {
65
+ withOutId: true,
66
+ }),
67
+ };
68
+ delete sendBody.bundle_details;
69
+ const response = await httpZauru_js_1.default.post(`/inventories/bundles.json`, sendBody, { headers });
70
+ return response.data;
71
+ });
72
+ }
73
+ exports.createBundle = createBundle;
74
+ /**
75
+ * updateBundle
76
+ * @param headers
77
+ * @param body
78
+ */
79
+ async function updateBundle(headers, body) {
80
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
81
+ const sendBody = {
82
+ ...body,
83
+ bundle_details_attributes: (0, common_1.arrayToObject)(body.bundle_details),
84
+ };
85
+ delete sendBody.bundle_details;
86
+ const response = await httpZauru_js_1.default.patch(`/inventories/bundles/${body.id}.json`, sendBody, { headers });
87
+ return response.data;
88
+ });
89
+ }
90
+ exports.updateBundle = updateBundle;
91
+ /**
92
+ * deleteBundle
93
+ * @param headers
94
+ * @param body
95
+ */
96
+ async function deleteBundle(headers, id) {
97
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
98
+ await httpZauru_js_1.default.delete(`/inventories/bundles/${id}?destroy=true`, {
99
+ headers,
100
+ });
101
+ return true;
102
+ });
103
+ }
104
+ exports.deleteBundle = deleteBundle;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getCasesByResponsibleId = void 0;
7
+ const common_1 = require("@zauru-sdk/common");
8
+ const common_js_1 = require("../common.js");
9
+ const httpGraphQL_js_1 = __importDefault(require("./httpGraphQL.js"));
10
+ const graphql_1 = require("@zauru-sdk/graphql");
11
+ /**
12
+ * getCasesByResponsibleId
13
+ */
14
+ async function getCasesByResponsibleId(session, responsible_id, wheres = []) {
15
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
16
+ const headers = await (0, common_js_1.getGraphQLAPIHeaders)(session);
17
+ const response = await httpGraphQL_js_1.default.post("", {
18
+ query: (0, graphql_1.getCasesByResponsibleIdStringQuery)(wheres),
19
+ variables: {
20
+ responsible_id,
21
+ },
22
+ }, { headers });
23
+ if (response.data.errors) {
24
+ throw new Error(response.data.errors.map((x) => x.message).join(";"));
25
+ }
26
+ const registers = response?.data?.data?.cases;
27
+ return registers;
28
+ });
29
+ }
30
+ exports.getCasesByResponsibleId = getCasesByResponsibleId;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getConsolidatesBetweenDates = exports.getConsolidatedPDFResult = exports.generateConsolidatePDF = exports.createConsolidated = void 0;
7
+ const common_1 = require("@zauru-sdk/common");
8
+ const httpZauru_js_1 = __importDefault(require("./httpZauru.js"));
9
+ const common_js_1 = require("../common.js");
10
+ const httpGraphQL_js_1 = __importDefault(require("./httpGraphQL.js"));
11
+ const graphql_1 = require("@zauru-sdk/graphql");
12
+ /**
13
+ *
14
+ * @param headers
15
+ * @returns
16
+ */
17
+ const createConsolidated = async (headers, body) => {
18
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
19
+ const response = await httpZauru_js_1.default.post(`/purchases/consolidates/create_for_special_invoice.json`, body, {
20
+ headers,
21
+ });
22
+ return response.data;
23
+ });
24
+ };
25
+ exports.createConsolidated = createConsolidated;
26
+ /**
27
+ * generateConsolidatePDF
28
+ * @param headers
29
+ * @param body
30
+ */
31
+ const generateConsolidatePDF = async (headers, session, body) => {
32
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
33
+ const { consolidated_template_id } = await (0, common_js_1.getVariablesByName)(headers, session, ["consolidated_template_id"]);
34
+ body.print_template = consolidated_template_id;
35
+ const response = await httpZauru_js_1.default.post("/purchases/consolidates/gen_print_all.json", body, { headers });
36
+ return response.data;
37
+ });
38
+ };
39
+ exports.generateConsolidatePDF = generateConsolidatePDF;
40
+ /**
41
+ * getConsolidatedPDFResult
42
+ * @param headers
43
+ * @param zid
44
+ * @returns
45
+ */
46
+ const getConsolidatedPDFResult = async (headers, zid) => {
47
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
48
+ const response = await httpZauru_js_1.default.get("purchases/consolidates/check_print_all", {
49
+ headers,
50
+ params: { zid },
51
+ });
52
+ return response.data;
53
+ });
54
+ };
55
+ exports.getConsolidatedPDFResult = getConsolidatedPDFResult;
56
+ /**
57
+ *
58
+ * @param session
59
+ * @param dates
60
+ * @returns
61
+ */
62
+ const getConsolidatesBetweenDates = async (session, dates) => {
63
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
64
+ const headers = await (0, common_js_1.getGraphQLAPIHeaders)(session);
65
+ const response = await httpGraphQL_js_1.default.post("", {
66
+ query: graphql_1.getConsolidatesBetweenDatesStringQuery,
67
+ variables: {
68
+ startDate: (0, common_1.formatDateToUTC)(dates.startDate),
69
+ endDate: (0, common_1.formatDateToUTC)(dates.endDate),
70
+ },
71
+ }, { headers });
72
+ if (response.data.errors) {
73
+ throw new Error(response.data.errors.map((x) => x.message).join(";"));
74
+ }
75
+ if (!response?.data?.data.consolidates) {
76
+ return [];
77
+ }
78
+ return response.data?.data.consolidates;
79
+ });
80
+ };
81
+ exports.getConsolidatesBetweenDates = getConsolidatesBetweenDates;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getCurrencies = void 0;
7
+ const common_1 = require("@zauru-sdk/common");
8
+ const common_js_1 = require("../common.js");
9
+ const httpGraphQL_js_1 = __importDefault(require("./httpGraphQL.js"));
10
+ const graphql_1 = require("@zauru-sdk/graphql");
11
+ /**
12
+ * getCurrencies
13
+ */
14
+ async function getCurrencies(session) {
15
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
16
+ const headers = await (0, common_js_1.getGraphQLAPIHeaders)(session);
17
+ const response = await httpGraphQL_js_1.default.post("", {
18
+ query: graphql_1.getCurrenciesStringQuery,
19
+ }, { headers });
20
+ if (response.data.errors) {
21
+ throw new Error(response.data.errors.map((x) => x.message).join(";"));
22
+ }
23
+ const registers = response?.data?.data?.currencies;
24
+ return registers;
25
+ });
26
+ }
27
+ exports.getCurrencies = getCurrencies;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.deleteDelivery = exports.getDeliveriesDataTables = exports.getDelivery = void 0;
7
+ const common_1 = require("@zauru-sdk/common");
8
+ const httpZauru_js_1 = __importDefault(require("./httpZauru.js"));
9
+ /**
10
+ * getDelivery
11
+ * @param headers
12
+ * @param body
13
+ * @returns
14
+ */
15
+ async function getDelivery(headers, idDelivery) {
16
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
17
+ const response = await httpZauru_js_1.default.get(`/inventories/deliveries/${idDelivery}.json`, {
18
+ headers,
19
+ });
20
+ return response.data;
21
+ });
22
+ }
23
+ exports.getDelivery = getDelivery;
24
+ /**
25
+ * GET DELIVERIES DATA TABLES
26
+ * @param headers
27
+ * @param body
28
+ * @returns
29
+ */
30
+ async function getDeliveriesDataTables(headers, body) {
31
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
32
+ const response = await httpZauru_js_1.default.post(`/inventories/deliveries/datatables.json`, body, {
33
+ headers,
34
+ });
35
+ return response.data;
36
+ });
37
+ }
38
+ exports.getDeliveriesDataTables = getDeliveriesDataTables;
39
+ /**
40
+ * deleteDelivery
41
+ * @param headers
42
+ * @param id
43
+ * @returns
44
+ */
45
+ async function deleteDelivery(headers, id) {
46
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
47
+ await httpZauru_js_1.default.delete(`/inventories/deliveries/${id}.json?destroy=true`, {
48
+ headers,
49
+ });
50
+ return true;
51
+ });
52
+ }
53
+ exports.deleteDelivery = deleteDelivery;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getDischargePDFResult = exports.generateDischargePDF = exports.createDischarge = void 0;
7
+ const common_js_1 = require("../common.js");
8
+ const common_1 = require("@zauru-sdk/common");
9
+ const httpZauru_js_1 = __importDefault(require("./httpZauru.js"));
10
+ /**
11
+ *
12
+ * @param headers
13
+ * @returns
14
+ */
15
+ const createDischarge = async (session, headers, body) => {
16
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
17
+ const { id_check_discharge_method } = await (0, common_js_1.getVariablesByName)(headers, session, ["id_check_discharge_method"]);
18
+ body.discharge.discharge_method_id = id_check_discharge_method;
19
+ const response = await httpZauru_js_1.default.post(`/purchases/discharges.json`, body, {
20
+ headers,
21
+ });
22
+ return response.data;
23
+ });
24
+ };
25
+ exports.createDischarge = createDischarge;
26
+ /**
27
+ * generateDischargePDF
28
+ * @param headers
29
+ * @param body
30
+ */
31
+ const generateDischargePDF = async (headers, session, body) => {
32
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
33
+ const { consolidated_template_id } = await (0, common_js_1.getVariablesByName)(headers, session, ["consolidated_template_id"]);
34
+ body.print_template = consolidated_template_id;
35
+ const response = await httpZauru_js_1.default.post("/purchases/consolidates/gen_print_all.json", body, { headers });
36
+ return response.data;
37
+ });
38
+ };
39
+ exports.generateDischargePDF = generateDischargePDF;
40
+ /**
41
+ * getDischargePDFResult
42
+ * @param headers
43
+ * @param zid
44
+ * @returns
45
+ */
46
+ const getDischargePDFResult = async (headers, zid) => {
47
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
48
+ const response = await httpZauru_js_1.default.get("purchases/consolidates/check_print_all", {
49
+ headers,
50
+ params: { zid },
51
+ });
52
+ return response.data;
53
+ });
54
+ };
55
+ exports.getDischargePDFResult = getDischargePDFResult;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getEmployeesByAgencyId = void 0;
7
+ const common_1 = require("@zauru-sdk/common");
8
+ const common_js_1 = require("../common.js");
9
+ const httpGraphQL_js_1 = __importDefault(require("./httpGraphQL.js"));
10
+ const graphql_1 = require("@zauru-sdk/graphql");
11
+ /**
12
+ * getEmployeesByAgencyId
13
+ */
14
+ async function getEmployeesByAgencyId(session, id) {
15
+ return (0, common_1.handlePossibleAxiosErrors)(async () => {
16
+ const headers = await (0, common_js_1.getGraphQLAPIHeaders)(session);
17
+ const response = await httpGraphQL_js_1.default.post("", {
18
+ query: graphql_1.getEmployeesByAgencyIdStringQuery,
19
+ variables: {
20
+ id,
21
+ },
22
+ }, { headers });
23
+ if (response.data.errors) {
24
+ throw new Error(response.data.errors.map((x) => x.message).join(";"));
25
+ }
26
+ const registers = response?.data?.data?.employees;
27
+ return registers;
28
+ });
29
+ }
30
+ exports.getEmployeesByAgencyId = getEmployeesByAgencyId;