@zauru-sdk/graphql 6.6.0 → 6.7.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.
@@ -90,8 +90,7 @@ export type GetWebAppRowsByTableIdOptions = {
90
90
  */
91
91
  data?: Record<string, WebAppRowDataFilterValue>;
92
92
  };
93
- export declare const toGetWebAppRowsByTableIdOptions: (limitOrOptions?: number | GetWebAppRowsByTableIdOptions) => GetWebAppRowsByTableIdOptions;
94
- export declare const getWebAppRowsByWebAppTableIdStringQuery: (webapp_table_id: number, limitOrOptions?: number | GetWebAppRowsByTableIdOptions) => string;
93
+ export declare const getWebAppRowsByWebAppTableIdStringQuery: (webapp_table_id: number, options?: GetWebAppRowsByTableIdOptions) => string;
95
94
  export declare const getPayeeCategoryByIdStringQuery: (id: number) => string;
96
95
  export declare const getPayeeCategoriesByNotesMatchStringQuery: (match: string) => string;
97
96
  export declare const getPayeeCategoriesStringQuery = "\nquery getPayeeCategories {\n payee_categories {\n id\n name\n notes\n payees_count\n price_list_id\n }\n}\n";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCasesStringQuery = exports.getInvoicesByAgencyIdStringQuery = exports.getPaymentTermByIdStringQuery = exports.getPaymentMethodsStringQuery = exports.getPaymentTermsStringQuery = exports.getSuggestedPricesStringQuery = exports.getCurrenciesStringQuery = exports.getInvoiceFormSubmissionsByInvoiceIdStringQuery = exports.getCaseFormSubmissionsByCaseIdStringQuery = 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.toGetWebAppRowsByTableIdOptions = exports.getWebAppRowStringQuery = exports.getAgenciesStringQuery = exports.getProvidersStringQuery = exports.getPayeesStringQuery = exports.getPurchaseOrdersBetweenDatesStringQuery = exports.getSerialsStringQuery = exports.getLotStocksByAgencyIdStringQuery = exports.getLotsByNameStringQuery = exports.getBookingByPurchaseOrderAndReferenceStringQuery = exports.getShipmentsStringQuery = exports.getPurchaseOrderStringQuery = exports.getPurchaseOrderByIdNumberStringQuery = exports.getLast100ReceptionsStringQuery = void 0;
4
- exports.getProductionWorkOrderStringQuery = exports.getPrintTemplatesStringQuery = void 0;
3
+ exports.getPrintTemplatesStringQuery = exports.getCasesStringQuery = exports.getInvoicesByAgencyIdStringQuery = exports.getPaymentTermByIdStringQuery = exports.getPaymentMethodsStringQuery = exports.getPaymentTermsStringQuery = exports.getSuggestedPricesStringQuery = exports.getCurrenciesStringQuery = exports.getInvoiceFormSubmissionsByInvoiceIdStringQuery = exports.getCaseFormSubmissionsByCaseIdStringQuery = 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.getSerialsStringQuery = exports.getLotStocksByAgencyIdStringQuery = exports.getLotsByNameStringQuery = exports.getBookingByPurchaseOrderAndReferenceStringQuery = exports.getShipmentsStringQuery = exports.getPurchaseOrderStringQuery = exports.getPurchaseOrderByIdNumberStringQuery = exports.getLast100ReceptionsStringQuery = void 0;
4
+ exports.getProductionWorkOrderStringQuery = void 0;
5
5
  const getLast100ReceptionsStringQuery = (agency_id) => {
6
6
  const conditions = ["voided: {_eq: false}"];
7
7
  if (agency_id) {
@@ -677,13 +677,6 @@ query getWebAppRow {
677
677
  `;
678
678
  exports.getWebAppRowStringQuery = getWebAppRowStringQuery;
679
679
  const GRAPHQL_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
680
- const toGetWebAppRowsByTableIdOptions = (limitOrOptions) => {
681
- if (typeof limitOrOptions === "number") {
682
- return { limit: limitOrOptions };
683
- }
684
- return limitOrOptions ?? {};
685
- };
686
- exports.toGetWebAppRowsByTableIdOptions = toGetWebAppRowsByTableIdOptions;
687
680
  const serializeGraphQLLiteral = (value) => {
688
681
  if (value === null) {
689
682
  return "null";
@@ -728,21 +721,21 @@ const buildDataFilterAndClauses = (data) => {
728
721
  }
729
722
  return andParts;
730
723
  };
731
- const getWebAppRowsByWebAppTableIdStringQuery = (webapp_table_id, limitOrOptions) => {
732
- const options = (0, exports.toGetWebAppRowsByTableIdOptions)(limitOrOptions);
724
+ const getWebAppRowsByWebAppTableIdStringQuery = (webapp_table_id, options) => {
725
+ const { limit, data } = options ?? {};
733
726
  const tableId = Number(webapp_table_id);
734
727
  const conditions = [];
735
728
  if (tableId) {
736
729
  conditions.push(`webapp_table_id: {_eq: ${tableId}}`);
737
730
  }
738
- const dataAnd = buildDataFilterAndClauses(options.data);
731
+ const dataAnd = buildDataFilterAndClauses(data);
739
732
  if (dataAnd.length > 0) {
740
733
  conditions.push(`_and: [${dataAnd.join(", ")}]`);
741
734
  }
742
735
  const whereClause = conditions.length
743
736
  ? `where: { ${conditions.join(", ")} }`
744
737
  : "";
745
- const limitClause = options.limit ? `limit: ${Number(options.limit)}` : "";
738
+ const limitClause = limit ? `limit: ${Number(limit)}` : "";
746
739
  const orderByClause = `order_by: { id: desc }`;
747
740
  return `
748
741
  query getWebAppRowsByWebAppTableId {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "6.6.0",
3
+ "version": "6.7.0",
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",
@@ -22,5 +22,5 @@
22
22
  "devDependencies": {
23
23
  "typescript": "^5.1.6"
24
24
  },
25
- "gitHead": "e32a0a82d185dbd8feb512c2252e458b415edc95"
25
+ "gitHead": "add1b36bf68bad8debe05c25fd826d68acce2810"
26
26
  }