@zauru-sdk/graphql 1.0.7 → 1.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.33](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.32...v1.0.33) (2024-03-25)
7
+
8
+ **Note:** Version bump only for package @zauru-sdk/graphql
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.0.9](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.8...v1.0.9) (2024-03-16)
15
+
16
+ **Note:** Version bump only for package @zauru-sdk/graphql
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.0.7](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.6...v1.0.7) (2024-03-16)
7
23
 
8
24
  **Note:** Version bump only for package @zauru-sdk/graphql
@@ -68,6 +68,7 @@ export declare const getSuggestedPricesStringQuery: (config?: {
68
68
  notNullPriceList: boolean;
69
69
  withItems: boolean;
70
70
  withItemCategories: boolean;
71
+ onlyCurrent: boolean;
71
72
  }) => string;
72
73
  export declare const getPaymentTermsStringQuery = "\nquery getPaymentTerms {\n payment_terms {\n active\n id\n memo\n name\n }\n}\n";
73
74
  export declare const getPaymentTermByIdStringQuery = "\nquery getPaymentTermById ($id: Int) {\n payment_terms (where: {id: {_eq: $id }}) {\n active\n id\n memo\n name\n account_from_id\n account_to_id\n allowed_payment_terms {\n payee_category_id\n }\n }\n}\n";
@@ -967,10 +967,19 @@ export const getSuggestedPricesStringQuery = (config = {
967
967
  notNullPriceList: false,
968
968
  withItems: false,
969
969
  withItemCategories: false,
970
+ onlyCurrent: false,
970
971
  }) => `
971
972
  query getSuggestedPrices {
972
- suggested_prices ${config?.notNullPriceList
973
- ? "(where: {price_list_id: {_is_null: false}})"
973
+ suggested_prices ${config?.notNullPriceList || config?.onlyCurrent
974
+ ? `(
975
+ where: {${[
976
+ config?.onlyCurrent ? "current: { _eq: true }" : "",
977
+ config?.notNullPriceList ? "price_list_id: { _is_null: false }" : "",
978
+ ]
979
+ .filter(Boolean)
980
+ .join(", ")}
981
+ }
982
+ )`
974
983
  : ""} {
975
984
  id
976
985
  current
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./GraphQL.queries";
1
+ export * from "./GraphQL.queries.js";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export * from "./GraphQL.queries";
1
+ export * from "./GraphQL.queries.js";
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "1.0.7",
3
+ "version": "1.0.33",
4
4
  "description": "Queries de uso común para las aplicación de Zauru.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "type": "module",
7
8
  "publishConfig": {
8
9
  "access": "public"
9
10
  },
@@ -19,5 +20,5 @@
19
20
  "engines": {
20
21
  "node": ">=18.0.0"
21
22
  },
22
- "gitHead": "8078893206a171382f3783914ceec8959cdda945"
23
+ "gitHead": "6f74ce89d7da3e948fac00ef04d244ddc4777b12"
23
24
  }
@@ -1069,16 +1069,26 @@ export const getSuggestedPricesStringQuery = (
1069
1069
  notNullPriceList: boolean;
1070
1070
  withItems: boolean;
1071
1071
  withItemCategories: boolean;
1072
+ onlyCurrent: boolean;
1072
1073
  } = {
1073
1074
  notNullPriceList: false,
1074
1075
  withItems: false,
1075
1076
  withItemCategories: false,
1077
+ onlyCurrent: false,
1076
1078
  }
1077
1079
  ) => `
1078
1080
  query getSuggestedPrices {
1079
1081
  suggested_prices ${
1080
- config?.notNullPriceList
1081
- ? "(where: {price_list_id: {_is_null: false}})"
1082
+ config?.notNullPriceList || config?.onlyCurrent
1083
+ ? `(
1084
+ where: {${[
1085
+ config?.onlyCurrent ? "current: { _eq: true }" : "",
1086
+ config?.notNullPriceList ? "price_list_id: { _is_null: false }" : "",
1087
+ ]
1088
+ .filter(Boolean)
1089
+ .join(", ")}
1090
+ }
1091
+ )`
1082
1092
  : ""
1083
1093
  } {
1084
1094
  id
@@ -1121,6 +1131,7 @@ query getSuggestedPrices {
1121
1131
  }
1122
1132
  }
1123
1133
  `;
1134
+
1124
1135
  export const getPaymentTermsStringQuery = `
1125
1136
  query getPaymentTerms {
1126
1137
  payment_terms {
package/src/index.ts CHANGED
@@ -1 +1 @@
1
- export * from "./GraphQL.queries";
1
+ export * from "./GraphQL.queries.js";
package/tsconfig.json CHANGED
@@ -3,6 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "allowSyntheticDefaultImports": true,
5
5
  "lib": ["ES2022"],
6
+ "module": "ES2022",
6
7
  "isolatedModules": true,
7
8
  "esModuleInterop": true,
8
9
  "target": "ES2022",