@zauru-sdk/hooks 1.0.52 → 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.
package/LICENCE.md CHANGED
@@ -1,11 +1,11 @@
1
- # Released under MIT License
2
-
3
- Copyright (c) 2013 Mark Otto.
4
-
5
- Copyright (c) 2017 Andrew Fong.
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
-
9
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
-
11
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ # Released under MIT License
2
+
3
+ Copyright (c) 2013 Mark Otto.
4
+
5
+ Copyright (c) 2017 Andrew Fong.
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -122,6 +122,10 @@ export declare const useGetBitacoraRechazoMasivo: (config?: ReduxParamsConfig) =
122
122
  loading: boolean;
123
123
  data: WebAppRowGraphQL<BitacoraPOMassive>[];
124
124
  };
125
+ export declare const useGetAllForms: (config?: ReduxParamsConfig) => {
126
+ loading: boolean;
127
+ data: FormGraphQL[];
128
+ };
125
129
  export declare const useGetInvoiceForms: (config?: ReduxParamsConfig) => {
126
130
  loading: boolean;
127
131
  data: FormGraphQL[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useGetInvoiceFormSubmissionsByInvoiceId = exports.useGetMyCaseFormSubmissions = exports.useGetInvoiceFormSubmissionsByAgencyId = exports.useGetCaseForms = exports.useGetInvoiceForms = exports.useGetBitacoraRechazoMasivo = exports.useGetMotivosDeRechazo = exports.useGetTiposDeMuestra = exports.useGetInvoicesByLab = exports.useGetShipmentsToMyAgency = exports.useGetEmployeesByCurrentAgency = exports.useGetEmployeesByLab = exports.useGetPaymentTerms = exports.useGetSuggestedPrices = exports.useGetAgencies = exports.useGetPayeesForLab = exports.useGetPayees = exports.useGetClientCategories = exports.useGetProviderCategories = exports.useGetMyCases = exports.useGetProviders = exports.useGetReceptionTypes = exports.useGetCurrencies = exports.useGetBundlesForLab = exports.useGetBundlesRecipForLab = exports.useGetPayeeCategoriesLabPrices = exports.useGetTemplates = exports.useGetBookings = exports.useGetItemCategoriesForLab = exports.useGetItemServicesByLab = exports.useGetMyAgencyLotStocks = exports.useGetItemsByLab = exports.useGetItemsByReception = exports.useGetItems = void 0;
3
+ exports.useGetInvoiceFormSubmissionsByInvoiceId = exports.useGetMyCaseFormSubmissions = exports.useGetInvoiceFormSubmissionsByAgencyId = exports.useGetCaseForms = exports.useGetInvoiceForms = exports.useGetAllForms = exports.useGetBitacoraRechazoMasivo = exports.useGetMotivosDeRechazo = exports.useGetTiposDeMuestra = exports.useGetInvoicesByLab = exports.useGetShipmentsToMyAgency = exports.useGetEmployeesByCurrentAgency = exports.useGetEmployeesByLab = exports.useGetPaymentTerms = exports.useGetSuggestedPrices = exports.useGetAgencies = exports.useGetPayeesForLab = exports.useGetPayees = exports.useGetClientCategories = exports.useGetProviderCategories = exports.useGetMyCases = exports.useGetProviders = exports.useGetReceptionTypes = exports.useGetCurrencies = exports.useGetBundlesForLab = exports.useGetBundlesRecipForLab = exports.useGetPayeeCategoriesLabPrices = exports.useGetTemplates = exports.useGetBookings = exports.useGetItemCategoriesForLab = exports.useGetItemServicesByLab = exports.useGetMyAgencyLotStocks = exports.useGetItemsByLab = exports.useGetItemsByReception = exports.useGetItems = void 0;
4
4
  const react_1 = require("@remix-run/react");
5
5
  const react_2 = require("react");
6
6
  const index_js_1 = require("./components/index.js");
@@ -176,6 +176,23 @@ const useGetMotivosDeRechazo = (config) => useGetReduxCatalog("motivosRechazo",
176
176
  exports.useGetMotivosDeRechazo = useGetMotivosDeRechazo;
177
177
  const useGetBitacoraRechazoMasivo = (config) => useGetReduxCatalog("bitacoraRechazoMasivo", config);
178
178
  exports.useGetBitacoraRechazoMasivo = useGetBitacoraRechazoMasivo;
179
+ const useGetAllForms = (config) => {
180
+ const data = useGetReduxCatalog("allForms", config);
181
+ // Filtrar los registros para obtener sólo los de la versión más alta.
182
+ const groupedByVersion = (data.data || []).reduce((acc, record) => {
183
+ const zid = record.zid;
184
+ if (!acc[zid]) {
185
+ acc[zid] = record;
186
+ }
187
+ return acc;
188
+ }, {});
189
+ const latestVersionRecords = Object.values(groupedByVersion);
190
+ return {
191
+ loading: data.loading,
192
+ data: latestVersionRecords.filter((x) => x.active),
193
+ };
194
+ };
195
+ exports.useGetAllForms = useGetAllForms;
179
196
  const useGetInvoiceForms = (config) => {
180
197
  const data = useGetReduxCatalog("invoiceForms", config);
181
198
  // Filtrar los registros para obtener sólo los de la versión más alta.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useGetInvoiceFormSubmissionsByInvoiceId = exports.useGetMyCaseFormSubmissions = exports.useGetInvoiceFormSubmissionsByAgencyId = exports.useGetCaseForms = exports.useGetInvoiceForms = exports.useGetBitacoraRechazoMasivo = exports.useGetMotivosDeRechazo = exports.useGetTiposDeMuestra = exports.useGetInvoicesByLab = exports.useGetShipmentsToMyAgency = exports.useGetEmployeesByCurrentAgency = exports.useGetEmployeesByLab = exports.useGetPaymentTerms = exports.useGetSuggestedPrices = exports.useGetAgencies = exports.useGetPayeesForLab = exports.useGetPayees = exports.useGetClientCategories = exports.useGetProviderCategories = exports.useGetMyCases = exports.useGetProviders = exports.useGetReceptionTypes = exports.useGetCurrencies = exports.useGetBundlesForLab = exports.useGetBundlesRecipForLab = exports.useGetPayeeCategoriesLabPrices = exports.useGetTemplates = exports.useGetBookings = exports.useGetItemCategoriesForLab = exports.useGetItemServicesByLab = exports.useGetMyAgencyLotStocks = exports.useGetItemsByLab = exports.useGetItemsByReception = exports.useGetItems = void 0;
3
+ exports.useGetInvoiceFormSubmissionsByInvoiceId = exports.useGetMyCaseFormSubmissions = exports.useGetInvoiceFormSubmissionsByAgencyId = exports.useGetCaseForms = exports.useGetInvoiceForms = exports.useGetAllForms = exports.useGetBitacoraRechazoMasivo = exports.useGetMotivosDeRechazo = exports.useGetTiposDeMuestra = exports.useGetInvoicesByLab = exports.useGetShipmentsToMyAgency = exports.useGetEmployeesByCurrentAgency = exports.useGetEmployeesByLab = exports.useGetPaymentTerms = exports.useGetSuggestedPrices = exports.useGetAgencies = exports.useGetPayeesForLab = exports.useGetPayees = exports.useGetClientCategories = exports.useGetProviderCategories = exports.useGetMyCases = exports.useGetProviders = exports.useGetReceptionTypes = exports.useGetCurrencies = exports.useGetBundlesForLab = exports.useGetBundlesRecipForLab = exports.useGetPayeeCategoriesLabPrices = exports.useGetTemplates = exports.useGetBookings = exports.useGetItemCategoriesForLab = exports.useGetItemServicesByLab = exports.useGetMyAgencyLotStocks = exports.useGetItemsByLab = exports.useGetItemsByReception = exports.useGetItems = void 0;
4
4
  const react_1 = require("@remix-run/react");
5
5
  const react_2 = require("react");
6
6
  const index_js_1 = require("./components/index.js");
@@ -176,6 +176,23 @@ const useGetMotivosDeRechazo = (config) => useGetReduxCatalog("motivosRechazo",
176
176
  exports.useGetMotivosDeRechazo = useGetMotivosDeRechazo;
177
177
  const useGetBitacoraRechazoMasivo = (config) => useGetReduxCatalog("bitacoraRechazoMasivo", config);
178
178
  exports.useGetBitacoraRechazoMasivo = useGetBitacoraRechazoMasivo;
179
+ const useGetAllForms = (config) => {
180
+ const data = useGetReduxCatalog("allForms", config);
181
+ // Filtrar los registros para obtener sólo los de la versión más alta.
182
+ const groupedByVersion = (data.data || []).reduce((acc, record) => {
183
+ const zid = record.zid;
184
+ if (!acc[zid]) {
185
+ acc[zid] = record;
186
+ }
187
+ return acc;
188
+ }, {});
189
+ const latestVersionRecords = Object.values(groupedByVersion);
190
+ return {
191
+ loading: data.loading,
192
+ data: latestVersionRecords.filter((x) => x.active),
193
+ };
194
+ };
195
+ exports.useGetAllForms = useGetAllForms;
179
196
  const useGetInvoiceForms = (config) => {
180
197
  const data = useGetReduxCatalog("invoiceForms", config);
181
198
  // Filtrar los registros para obtener sólo los de la versión más alta.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/hooks",
3
- "version": "1.0.52",
3
+ "version": "1.0.60",
4
4
  "description": "Hooks reutilizables dentro de las webapps de Zauru.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -27,15 +27,12 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@remix-run/react": "^2.8.1",
30
- "@zauru-sdk/common": "^1.0.50",
31
- "@zauru-sdk/graphql": "^1.0.48",
32
- "@zauru-sdk/icons": "^1.0.50",
33
- "@zauru-sdk/redux": "^1.0.52",
34
- "@zauru-sdk/services": "^1.0.52",
35
- "@zauru-sdk/types": "^1.0.49",
36
- "@zauru-sdk/utils": "^1.0.52",
30
+ "@zauru-sdk/common": "^1.0.60",
31
+ "@zauru-sdk/icons": "^1.0.60",
32
+ "@zauru-sdk/redux": "^1.0.60",
33
+ "@zauru-sdk/types": "^1.0.60",
37
34
  "react": "^18.2.0",
38
35
  "react-dom": "^18.2.0"
39
36
  },
40
- "gitHead": "f5c0e92ea8dbca13f636f8bdeaf3976a0b294424"
37
+ "gitHead": "8f9219bf94b9171f79ba4d5ddcab512d2715f314"
41
38
  }