@zauru-sdk/graphql 2.0.32 → 2.0.33

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.
@@ -3,16 +3,18 @@ export declare const getPurchaseOrderByIdNumberStringQuery: (id_number: string)
3
3
  export declare const getPurchaseOrderStringQuery: (id: number, config?: {
4
4
  withLotStocks: boolean;
5
5
  }) => string;
6
- export declare const getLast100ShipmentsStringQuery: ({ agency_to_id, agency_from_id, suffix, voided, id_number_not_null, id_number, id_number_not_empty, }: {
6
+ export declare const getShipmentsStringQuery: ({ agency_to_id, agency_from_id, suffix, voided, id_number_not_null, id_number, id_number_not_empty, withMovementLots, limit, id, wheres, }: {
7
7
  agency_to_id?: number;
8
8
  agency_from_id?: number;
9
9
  suffix?: string;
10
10
  id_number_not_null?: boolean;
11
11
  voided?: boolean;
12
- shipped?: boolean;
13
- delivered?: boolean;
14
12
  id_number?: string;
15
13
  id_number_not_empty?: boolean;
14
+ withMovementLots?: boolean;
15
+ limit?: number;
16
+ id?: number;
17
+ wheres?: string[];
16
18
  }) => string;
17
19
  export declare const getLotsByNameStringQuery: (name: string, entity_id: number) => string;
18
20
  export declare const getLotStocksByAgencyIdStringQuery: (agency_id: number) => string;
@@ -59,7 +61,6 @@ export declare const getEmployeesByAgencyIdStringQuery: (id: number) => string;
59
61
  export declare const getBundlesByItemCategoryIdStringQuery: (id: number) => string;
60
62
  export declare const getBundleByNameStringQuery: (name: string) => string;
61
63
  export declare const getItemByNameStringQuery: (name: string) => string;
62
- export declare const getShipmentsStringQuery: (wheres?: string[]) => string;
63
64
  export declare const getAllFormsStringQuery: (config?: {
64
65
  withSubmissions: boolean;
65
66
  }) => string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPrintTemplatesStringQuery = exports.getCasesByResponsibleIdStringQuery = exports.getInvoicesByAgencyIdStringQuery = exports.getPaymentTermByIdStringQuery = exports.getPaymentMethodsStringQuery = exports.getPaymentTermsStringQuery = exports.getSuggestedPricesStringQuery = exports.getCurrenciesStringQuery = exports.getInvoiceFormSubmissionsByInvoiceIdStringQuery = exports.getLastInvoiceFormSubmissionStringQuery = exports.getInvoiceFormSubmissionsByAgencyIdStringQuery = exports.getFormSubmissionByIdStringQuery = exports.getMyCaseFormSubmissionsStringQuery = exports.getFormsByDocumentTypeStringQuery = exports.getFormsStringQuery = exports.getFormByNameStringQuery = exports.getAllFormsStringQuery = exports.getShipmentsStringQuery = exports.getItemByNameStringQuery = exports.getBundleByNameStringQuery = exports.getBundlesByItemCategoryIdStringQuery = exports.getEmployeesByAgencyIdStringQuery = exports.getEmployeesStringQuery = exports.getEmployeeProfileStringQuery = exports.getConsolidatesBetweenDatesStringQuery = exports.getItemsBySuperCategoryStringQuery = exports.getItemsStringQuery = exports.getItemsByCategoryStringQuery = exports.getItemCategoryByIdStringQuery = exports.getSuperCategoryByIdStringQuery = exports.getPayeeByIdStringQuery = exports.getClientCategoriesStringQuery = exports.getProviderCategoriesStringQuery = exports.getPayeeCategoriesStringQuery = exports.getPayeeCategoriesByNotesMatchStringQuery = exports.getPayeeCategoryByIdStringQuery = exports.getWebAppRowsByWebAppTableIdStringQuery = exports.getWebAppRowStringQuery = exports.getAgenciesStringQuery = exports.getProvidersStringQuery = exports.getPayeesStringQuery = exports.getPurchaseOrdersBetweenDatesStringQuery = exports.getLotStocksByAgencyIdStringQuery = exports.getLotsByNameStringQuery = exports.getLast100ShipmentsStringQuery = exports.getPurchaseOrderStringQuery = exports.getPurchaseOrderByIdNumberStringQuery = exports.getLast100ReceptionsStringQuery = void 0;
3
+ exports.getPrintTemplatesStringQuery = exports.getCasesByResponsibleIdStringQuery = exports.getInvoicesByAgencyIdStringQuery = exports.getPaymentTermByIdStringQuery = exports.getPaymentMethodsStringQuery = exports.getPaymentTermsStringQuery = exports.getSuggestedPricesStringQuery = exports.getCurrenciesStringQuery = exports.getInvoiceFormSubmissionsByInvoiceIdStringQuery = exports.getLastInvoiceFormSubmissionStringQuery = exports.getInvoiceFormSubmissionsByAgencyIdStringQuery = exports.getFormSubmissionByIdStringQuery = exports.getMyCaseFormSubmissionsStringQuery = exports.getFormsByDocumentTypeStringQuery = exports.getFormsStringQuery = exports.getFormByNameStringQuery = exports.getAllFormsStringQuery = exports.getItemByNameStringQuery = exports.getBundleByNameStringQuery = exports.getBundlesByItemCategoryIdStringQuery = exports.getEmployeesByAgencyIdStringQuery = exports.getEmployeesStringQuery = exports.getEmployeeProfileStringQuery = exports.getConsolidatesBetweenDatesStringQuery = exports.getItemsBySuperCategoryStringQuery = exports.getItemsStringQuery = exports.getItemsByCategoryStringQuery = exports.getItemCategoryByIdStringQuery = exports.getSuperCategoryByIdStringQuery = exports.getPayeeByIdStringQuery = exports.getClientCategoriesStringQuery = exports.getProviderCategoriesStringQuery = exports.getPayeeCategoriesStringQuery = exports.getPayeeCategoriesByNotesMatchStringQuery = exports.getPayeeCategoryByIdStringQuery = exports.getWebAppRowsByWebAppTableIdStringQuery = exports.getWebAppRowStringQuery = exports.getAgenciesStringQuery = exports.getProvidersStringQuery = exports.getPayeesStringQuery = exports.getPurchaseOrdersBetweenDatesStringQuery = exports.getLotStocksByAgencyIdStringQuery = exports.getLotsByNameStringQuery = exports.getShipmentsStringQuery = exports.getPurchaseOrderStringQuery = exports.getPurchaseOrderByIdNumberStringQuery = exports.getLast100ReceptionsStringQuery = void 0;
4
4
  const getLast100ReceptionsStringQuery = (agency_id) => `
5
5
  query getLast100Receptions {
6
6
  purchase_orders(limit: 100, order_by: {created_at: desc}, where: {voided: {_eq: false}, agency_id: {_eq: ${agency_id}}}) {
@@ -152,7 +152,7 @@ query getPurchaseOrder($id: bigint) @cached {
152
152
  }
153
153
  `;
154
154
  exports.getPurchaseOrderStringQuery = getPurchaseOrderStringQuery;
155
- const getLast100ShipmentsStringQuery = ({ agency_to_id, agency_from_id, suffix, voided = false, id_number_not_null = false, id_number, id_number_not_empty = false, }) => {
155
+ const getShipmentsStringQuery = ({ agency_to_id, agency_from_id, suffix, voided = false, id_number_not_null = false, id_number, id_number_not_empty = false, withMovementLots = false, limit = 1000, id, wheres, }) => {
156
156
  let conditions = [];
157
157
  conditions.push(`voided: {_eq: ${voided}}`);
158
158
  if (suffix) {
@@ -173,9 +173,22 @@ const getLast100ShipmentsStringQuery = ({ agency_to_id, agency_from_id, suffix,
173
173
  if (id_number_not_null) {
174
174
  conditions.push(`id_number: {_is_null: false}`);
175
175
  }
176
+ if (id) {
177
+ conditions.push(`id: {_eq: ${id}}`);
178
+ }
179
+ if (wheres) {
180
+ conditions.push(...wheres);
181
+ }
182
+ const movementLots = withMovementLots
183
+ ? `lot {
184
+ id
185
+ name
186
+ description
187
+ }`
188
+ : "";
176
189
  return `query getLast100Shipments {
177
190
  shipments(
178
- limit: 100,
191
+ limit: ${limit},
179
192
  order_by: {id: desc},
180
193
  where: {
181
194
  ${conditions.join(", ")}
@@ -193,21 +206,26 @@ const getLast100ShipmentsStringQuery = ({ agency_to_id, agency_from_id, suffix,
193
206
  agency_to_id
194
207
  transporter_id
195
208
  created_at
209
+ planned_shipping
210
+ planned_delivery
211
+ delivered
212
+ shipped
213
+ shipped_at
214
+ delivered_at
215
+ returned
216
+ returned_at
196
217
  movements {
197
218
  id
198
219
  booked_quantity
199
220
  delivered_quantity
200
221
  reference
201
- lot {
202
- id
203
- name
204
- description
205
- }
222
+ item_id
223
+ ${movementLots}
206
224
  }
207
225
  }
208
226
  }`;
209
227
  };
210
- exports.getLast100ShipmentsStringQuery = getLast100ShipmentsStringQuery;
228
+ exports.getShipmentsStringQuery = getShipmentsStringQuery;
211
229
  const getLotsByNameStringQuery = (name, entity_id) => `
212
230
  query getLots {
213
231
  lots (limit: 100, order_by: {id: desc}, where: {entity_id: {_eq: ${entity_id}}, name: {_eq: "${name}"}}) {
@@ -695,29 +713,6 @@ query getItemByName {
695
713
  }
696
714
  `;
697
715
  exports.getItemByNameStringQuery = getItemByNameStringQuery;
698
- const getShipmentsStringQuery = (wheres = []) => {
699
- const additionalWheres = wheres.join(",");
700
- return `query getShipments {
701
- shipments (${additionalWheres.length > 0 ? `where: {${additionalWheres}},` : ""} order_by: {id: desc}) {
702
- id
703
- id_number
704
- reference
705
- needs_transport
706
- payee_id
707
- booker_id
708
- shipped
709
- shipper_id
710
- delivered
711
- delivered_at
712
- voided
713
- returned
714
- memo
715
- planned_delivery
716
- }
717
- }
718
- `;
719
- };
720
- exports.getShipmentsStringQuery = getShipmentsStringQuery;
721
716
  const getAllFormsStringQuery = (config = { withSubmissions: false }) => `
722
717
  query getAllForms {
723
718
  settings_forms (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "2.0.32",
3
+ "version": "2.0.33",
4
4
  "description": "Queries de uso común para las aplicación de Zauru.",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -21,5 +21,5 @@
21
21
  "devDependencies": {
22
22
  "typescript": "^5.1.6"
23
23
  },
24
- "gitHead": "a8ae6ccbcb3c0f52ec84250385dcc9d04008489f"
24
+ "gitHead": "16838516924a5b98ef2fdf89ec46881451b9589b"
25
25
  }