@zauru-sdk/graphql 2.0.216 → 2.0.223

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.
@@ -69,7 +69,7 @@ export declare const getPayeesStringQuery: (filters?: {
69
69
  export declare const getProvidersStringQuery = "\nquery getProviders {\n payees (where: {vendor: {_eq: true}}) {\n id\n id_number\n name\n tin\n address_line_1\n }\n}\n";
70
70
  export declare const getAgenciesStringQuery = "\nquery getAgencies {\n agencies {\n id\n name\n address_line_2\n }\n}\n";
71
71
  export declare const getWebAppRowStringQuery: (id: number) => string;
72
- export declare const getWebAppRowsByWebAppTableIdStringQuery: (webapp_table_id: number) => string;
72
+ export declare const getWebAppRowsByWebAppTableIdStringQuery: (webapp_table_id: number, limit?: number) => string;
73
73
  export declare const getPayeeCategoryByIdStringQuery: (id: number) => string;
74
74
  export declare const getPayeeCategoriesByNotesMatchStringQuery: (match: string) => string;
75
75
  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";
@@ -103,6 +103,7 @@ query getPurchaseOrder($id: bigint) @cached {
103
103
  shipment_reference
104
104
  webapp_table_rowables {
105
105
  webapp_rows {
106
+ webapp_table_id
106
107
  data
107
108
  }
108
109
  }
@@ -543,24 +544,28 @@ query getWebAppRow {
543
544
  }
544
545
  `;
545
546
  exports.getWebAppRowStringQuery = getWebAppRowStringQuery;
546
- const getWebAppRowsByWebAppTableIdStringQuery = (webapp_table_id) => `
547
- query getWebAppRowsByWebAppTableId {
548
- webapp_rows (
549
- where: {
550
- webapp_table_id: {
551
- _eq: ${webapp_table_id}
547
+ const getWebAppRowsByWebAppTableIdStringQuery = (webapp_table_id, limit) => {
548
+ const conditions = [];
549
+ if (webapp_table_id) {
550
+ conditions.push(`webapp_table_id: {_eq: ${webapp_table_id}}`);
551
+ }
552
+ const whereClause = conditions.length
553
+ ? `where: { ${conditions.join(", ")} }`
554
+ : "";
555
+ const limitClause = limit ? `limit: ${limit}` : "";
556
+ const orderByClause = `order_by: { id: desc }`;
557
+ return `
558
+ query getWebAppRowsByWebAppTableId {
559
+ webapp_rows (${[whereClause, orderByClause, limitClause]
560
+ .filter(Boolean)
561
+ .join(", ")}) {
562
+ id
563
+ data
564
+ created_at
552
565
  }
553
- },
554
- order_by: {
555
- id: desc
556
566
  }
557
- ) {
558
- id
559
- data
560
- created_at
561
- }
562
- }
563
567
  `;
568
+ };
564
569
  exports.getWebAppRowsByWebAppTableIdStringQuery = getWebAppRowsByWebAppTableIdStringQuery;
565
570
  const getPayeeCategoryByIdStringQuery = (id) => `
566
571
  query getPayeeCategoryById {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "2.0.216",
3
+ "version": "2.0.223",
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": "66b6f658705bd4642f63be3a28a0f24aebce73d7"
24
+ "gitHead": "6315d069c4c276a87f7384947e01fe2420f1eab3"
25
25
  }