@zauru-sdk/hooks 1.0.54 → 1.0.64
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 +11 -11
- package/dist/catalogs.d.ts +8 -0
- package/dist/cjs/catalogs.js +20 -1
- package/dist/esm/catalogs.js +20 -1
- package/package.json +6 -9
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.
|
package/dist/catalogs.d.ts
CHANGED
|
@@ -36,6 +36,10 @@ export declare const useGetTemplates: (config?: ReduxParamsConfig) => {
|
|
|
36
36
|
loading: boolean;
|
|
37
37
|
data: WebAppRowGraphQL<Template>[];
|
|
38
38
|
};
|
|
39
|
+
export declare const useGetPayeeCategories: () => {
|
|
40
|
+
loading: boolean;
|
|
41
|
+
data: PayeeCategoryGraphQL[];
|
|
42
|
+
};
|
|
39
43
|
export declare const useGetPayeeCategoriesLabPrices: (config?: {
|
|
40
44
|
withPriceListIdNull: boolean;
|
|
41
45
|
}) => {
|
|
@@ -122,6 +126,10 @@ export declare const useGetBitacoraRechazoMasivo: (config?: ReduxParamsConfig) =
|
|
|
122
126
|
loading: boolean;
|
|
123
127
|
data: WebAppRowGraphQL<BitacoraPOMassive>[];
|
|
124
128
|
};
|
|
129
|
+
export declare const useGetAllForms: (config?: ReduxParamsConfig) => {
|
|
130
|
+
loading: boolean;
|
|
131
|
+
data: FormGraphQL[];
|
|
132
|
+
};
|
|
125
133
|
export declare const useGetInvoiceForms: (config?: ReduxParamsConfig) => {
|
|
126
134
|
loading: boolean;
|
|
127
135
|
data: FormGraphQL[];
|
package/dist/cjs/catalogs.js
CHANGED
|
@@ -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.useGetPayeeCategories = 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");
|
|
@@ -127,6 +127,8 @@ const useGetBookings = (config) => useGetReduxCatalog("bookings", config);
|
|
|
127
127
|
exports.useGetBookings = useGetBookings;
|
|
128
128
|
const useGetTemplates = (config) => useGetReduxCatalog("templates", config);
|
|
129
129
|
exports.useGetTemplates = useGetTemplates;
|
|
130
|
+
const useGetPayeeCategories = () => useGetReduxCatalog("payeeCategories");
|
|
131
|
+
exports.useGetPayeeCategories = useGetPayeeCategories;
|
|
130
132
|
const useGetPayeeCategoriesLabPrices = (config = { withPriceListIdNull: false }) => {
|
|
131
133
|
const data = useGetReduxCatalog("payeeCategoriesLabPrices");
|
|
132
134
|
let tempData = data.data;
|
|
@@ -176,6 +178,23 @@ const useGetMotivosDeRechazo = (config) => useGetReduxCatalog("motivosRechazo",
|
|
|
176
178
|
exports.useGetMotivosDeRechazo = useGetMotivosDeRechazo;
|
|
177
179
|
const useGetBitacoraRechazoMasivo = (config) => useGetReduxCatalog("bitacoraRechazoMasivo", config);
|
|
178
180
|
exports.useGetBitacoraRechazoMasivo = useGetBitacoraRechazoMasivo;
|
|
181
|
+
const useGetAllForms = (config) => {
|
|
182
|
+
const data = useGetReduxCatalog("allForms", config);
|
|
183
|
+
// Filtrar los registros para obtener sólo los de la versión más alta.
|
|
184
|
+
const groupedByVersion = (data.data || []).reduce((acc, record) => {
|
|
185
|
+
const zid = record.zid;
|
|
186
|
+
if (!acc[zid]) {
|
|
187
|
+
acc[zid] = record;
|
|
188
|
+
}
|
|
189
|
+
return acc;
|
|
190
|
+
}, {});
|
|
191
|
+
const latestVersionRecords = Object.values(groupedByVersion);
|
|
192
|
+
return {
|
|
193
|
+
loading: data.loading,
|
|
194
|
+
data: latestVersionRecords.filter((x) => x.active),
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
exports.useGetAllForms = useGetAllForms;
|
|
179
198
|
const useGetInvoiceForms = (config) => {
|
|
180
199
|
const data = useGetReduxCatalog("invoiceForms", config);
|
|
181
200
|
// Filtrar los registros para obtener sólo los de la versión más alta.
|
package/dist/esm/catalogs.js
CHANGED
|
@@ -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.useGetPayeeCategories = 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");
|
|
@@ -127,6 +127,8 @@ const useGetBookings = (config) => useGetReduxCatalog("bookings", config);
|
|
|
127
127
|
exports.useGetBookings = useGetBookings;
|
|
128
128
|
const useGetTemplates = (config) => useGetReduxCatalog("templates", config);
|
|
129
129
|
exports.useGetTemplates = useGetTemplates;
|
|
130
|
+
const useGetPayeeCategories = () => useGetReduxCatalog("payeeCategories");
|
|
131
|
+
exports.useGetPayeeCategories = useGetPayeeCategories;
|
|
130
132
|
const useGetPayeeCategoriesLabPrices = (config = { withPriceListIdNull: false }) => {
|
|
131
133
|
const data = useGetReduxCatalog("payeeCategoriesLabPrices");
|
|
132
134
|
let tempData = data.data;
|
|
@@ -176,6 +178,23 @@ const useGetMotivosDeRechazo = (config) => useGetReduxCatalog("motivosRechazo",
|
|
|
176
178
|
exports.useGetMotivosDeRechazo = useGetMotivosDeRechazo;
|
|
177
179
|
const useGetBitacoraRechazoMasivo = (config) => useGetReduxCatalog("bitacoraRechazoMasivo", config);
|
|
178
180
|
exports.useGetBitacoraRechazoMasivo = useGetBitacoraRechazoMasivo;
|
|
181
|
+
const useGetAllForms = (config) => {
|
|
182
|
+
const data = useGetReduxCatalog("allForms", config);
|
|
183
|
+
// Filtrar los registros para obtener sólo los de la versión más alta.
|
|
184
|
+
const groupedByVersion = (data.data || []).reduce((acc, record) => {
|
|
185
|
+
const zid = record.zid;
|
|
186
|
+
if (!acc[zid]) {
|
|
187
|
+
acc[zid] = record;
|
|
188
|
+
}
|
|
189
|
+
return acc;
|
|
190
|
+
}, {});
|
|
191
|
+
const latestVersionRecords = Object.values(groupedByVersion);
|
|
192
|
+
return {
|
|
193
|
+
loading: data.loading,
|
|
194
|
+
data: latestVersionRecords.filter((x) => x.active),
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
exports.useGetAllForms = useGetAllForms;
|
|
179
198
|
const useGetInvoiceForms = (config) => {
|
|
180
199
|
const data = useGetReduxCatalog("invoiceForms", config);
|
|
181
200
|
// 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.
|
|
3
|
+
"version": "1.0.64",
|
|
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.
|
|
31
|
-
"@zauru-sdk/
|
|
32
|
-
"@zauru-sdk/
|
|
33
|
-
"@zauru-sdk/
|
|
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.64",
|
|
33
|
+
"@zauru-sdk/types": "^1.0.60",
|
|
37
34
|
"react": "^18.2.0",
|
|
38
35
|
"react-dom": "^18.2.0"
|
|
39
36
|
},
|
|
40
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "7edda6e02380d48667a0daa4625ad3e87341f6b4"
|
|
41
38
|
}
|