npm-pkg-hook 1.13.0 → 1.13.1

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.
Files changed (347) hide show
  1. package/dist/index.js +8 -2
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +8 -2
  4. package/dist/index.mjs.map +1 -1
  5. package/package.json +8 -2
  6. package/.babelrc +0 -0
  7. package/.github/pull_request_template.md +0 -18
  8. package/.github/workflows/pepeline.yaml +0 -30
  9. package/eslint.config.mts +0 -153
  10. package/expire.json +0 -1
  11. package/jsconfig.json +0 -28
  12. package/script.txt +0 -7
  13. package/src/config/client/errors.ts +0 -39
  14. package/src/config/client/index.ts +0 -1
  15. package/src/config/content/en.json +0 -5
  16. package/src/config/content/es.json +0 -5
  17. package/src/config/content/index.ts +0 -16
  18. package/src/cookies/index.ts +0 -3
  19. package/src/hooks/addTenMinutes/index.ts +0 -14
  20. package/src/hooks/calculateLogLatHaversine/index.ts +0 -41
  21. package/src/hooks/completeSchedules/index.ts +0 -22
  22. package/src/hooks/convertToMilitaryTime/index.ts +0 -18
  23. package/src/hooks/generateStoreURL/index.ts +0 -41
  24. package/src/hooks/generateTemplate/index.ts +0 -66
  25. package/src/hooks/getCardType/index.ts +0 -24
  26. package/src/hooks/getCategoriesWithProduct/helpers/index.ts +0 -7
  27. package/src/hooks/getCategoriesWithProduct/index.ts +0 -62
  28. package/src/hooks/getGlobalSession/index.ts +0 -69
  29. package/src/hooks/getSession/index.ts +0 -72
  30. package/src/hooks/getTodayTimestamps/index.ts +0 -70
  31. package/src/hooks/getTotalHours/index.ts +0 -76
  32. package/src/hooks/handleLogin/index.ts +0 -14
  33. package/src/hooks/index.ts +0 -154
  34. package/src/hooks/isTokenExpired/index.ts +0 -17
  35. package/src/hooks/newMessageSubscription/index.ts +0 -28
  36. package/src/hooks/newStoreOrderSubscription/index.ts +0 -26
  37. package/src/hooks/statusOpenStores/helpers/index.ts +0 -124
  38. package/src/hooks/statusOpenStores/index.ts +0 -221
  39. package/src/hooks/updateExtProductFoodsOptional/index.ts +0 -49
  40. package/src/hooks/useAcumulateDate/index.ts +0 -18
  41. package/src/hooks/useAllStoresPendingToRegister/index.ts +0 -37
  42. package/src/hooks/useAmountInput/index.ts +0 -127
  43. package/src/hooks/useAnimationFrame/index.ts +0 -45
  44. package/src/hooks/useAnimationText/index.ts +0 -31
  45. package/src/hooks/useAsideCart/helpers/index.ts +0 -22
  46. package/src/hooks/useAsideCart/index.ts +0 -217
  47. package/src/hooks/useAsideCart/queries.ts +0 -10
  48. package/src/hooks/useBanner/index.ts +0 -20
  49. package/src/hooks/useCart/index.ts +0 -2
  50. package/src/hooks/useCart/queries.ts +0 -174
  51. package/src/hooks/useCart/useCart/helpers/index.ts +0 -79
  52. package/src/hooks/useCart/useCart/index.ts +0 -424
  53. package/src/hooks/useCart/useGetCart/index.ts +0 -34
  54. package/src/hooks/useCatWithProduct/index.ts +0 -54
  55. package/src/hooks/useCatWithProduct/queries.ts +0 -200
  56. package/src/hooks/useCatWithProduct/types/index.ts +0 -104
  57. package/src/hooks/useCatWithProductClient/index.ts +0 -57
  58. package/src/hooks/useCatWithProductClient/queries.ts +0 -56
  59. package/src/hooks/useCategoriesProduct/index.ts +0 -14
  60. package/src/hooks/useCategoriesProduct/queries.ts +0 -16
  61. package/src/hooks/useCategoryInStore/index.ts +0 -167
  62. package/src/hooks/useCategoryInStore/queries.ts +0 -78
  63. package/src/hooks/useCategoryStore/index.ts +0 -8
  64. package/src/hooks/useCategoryStore/queries.ts +0 -16
  65. package/src/hooks/useChartData/index.ts +0 -171
  66. package/src/hooks/useChartData/useChartData/index.ts +0 -200
  67. package/src/hooks/useChartData/useChartDataAllOrders/index.ts +0 -94
  68. package/src/hooks/useChatRoomSubscription/index.ts +0 -28
  69. package/src/hooks/useCheckbox/index.ts +0 -115
  70. package/src/hooks/useCities/index.ts +0 -14
  71. package/src/hooks/useCities/queries.ts +0 -12
  72. package/src/hooks/useClients/index.ts +0 -97
  73. package/src/hooks/useClients/queries.ts +0 -215
  74. package/src/hooks/useColorByLetters/helpers/alea.ts +0 -73
  75. package/src/hooks/useColorByLetters/helpers/colors.ts +0 -45
  76. package/src/hooks/useColorByLetters/helpers/index.ts +0 -24
  77. package/src/hooks/useColorByLetters/helpers/mersenne_twister.ts +0 -118
  78. package/src/hooks/useColorByLetters/index.ts +0 -24
  79. package/src/hooks/useConnection/index.ts +0 -24
  80. package/src/hooks/useCountries/index.ts +0 -20
  81. package/src/hooks/useCountries/queries.ts +0 -12
  82. package/src/hooks/useCreateDeliveryTime/index.ts +0 -51
  83. package/src/hooks/useCreateOrderStatusType/index.ts +0 -134
  84. package/src/hooks/useCreateProduct/helpers/index.ts +0 -23
  85. package/src/hooks/useCreateProduct/helpers/manageCacheDataCatProduct/index.ts +0 -52
  86. package/src/hooks/useCreateProduct/helpers/useEditImageProduct/index.ts +0 -182
  87. package/src/hooks/useCreateProduct/index.ts +0 -337
  88. package/src/hooks/useCreateStorePendingToRegister/index.ts +0 -17
  89. package/src/hooks/useCreateStorePendingToRegister/queries.ts +0 -10
  90. package/src/hooks/useDashboardComponents/index.ts +0 -50
  91. package/src/hooks/useDeleteExtraProductFoods/index.ts +0 -13
  92. package/src/hooks/useDeleteSubProductOptional/index.ts +0 -32
  93. package/src/hooks/useDeleteSubProductOptional/queries.ts +0 -10
  94. package/src/hooks/useDeliveryTime/index.ts +0 -29
  95. package/src/hooks/useDepartments/index.ts +0 -14
  96. package/src/hooks/useDepartments/queries.ts +0 -13
  97. package/src/hooks/useDessert/helpers/index.ts +0 -51
  98. package/src/hooks/useDessert/index.ts +0 -529
  99. package/src/hooks/useDessertWithPrice/helpers/index.ts +0 -76
  100. package/src/hooks/useDessertWithPrice/index.ts +0 -381
  101. package/src/hooks/useDessertWithPrice/queries.ts +0 -18
  102. package/src/hooks/useDevWS/index.ts +0 -53
  103. package/src/hooks/useDevices/index.ts +0 -2
  104. package/src/hooks/useDevices/queries.ts +0 -28
  105. package/src/hooks/useDevices/useGetDevices.ts +0 -28
  106. package/src/hooks/useDevices/useRegisterDevices.ts +0 -75
  107. package/src/hooks/useDownloadReports/helpers/downloadFileFromResponse.ts +0 -21
  108. package/src/hooks/useDownloadReports/index.ts +0 -2
  109. package/src/hooks/useDownloadReports/useDownloadReportByDay/index.ts +0 -105
  110. package/src/hooks/useDownloadReports/useGetReportByDateRange/index.ts +0 -116
  111. package/src/hooks/useDrag/index.ts +0 -79
  112. package/src/hooks/useDropzone/index.ts +0 -94
  113. package/src/hooks/useDynamicAuth/index.ts +0 -14
  114. package/src/hooks/useDynamicAuth/queries.ts +0 -24
  115. package/src/hooks/useEditCategory/index.ts +0 -41
  116. package/src/hooks/useEditOneExtProductFoodOptional/index.ts +0 -28
  117. package/src/hooks/useEditOneExtProductFoodOptional/queries.ts +0 -16
  118. package/src/hooks/useEditSubProductOptional/index.ts +0 -12
  119. package/src/hooks/useEditSubProductOptional/queries.ts +0 -10
  120. package/src/hooks/useEmployee/index.ts +0 -18
  121. package/src/hooks/useEmployee/queries.ts +0 -85
  122. package/src/hooks/useEmployee/useCreateEmployee.ts +0 -90
  123. package/src/hooks/useEvent/index.ts +0 -34
  124. package/src/hooks/useFavoriteStores/index.ts +0 -31
  125. package/src/hooks/useFavoriteStores/queries.ts +0 -54
  126. package/src/hooks/useFetchJson/index.ts +0 -25
  127. package/src/hooks/useFetchMoreInteractions/index.jsx +0 -39
  128. package/src/hooks/useFilterConfigs/index.ts +0 -173
  129. package/src/hooks/useFingerprintjs/index.ts +0 -197
  130. package/src/hooks/useFormTools/index.ts +0 -143
  131. package/src/hooks/useFormatDate/index.ts +0 -91
  132. package/src/hooks/useFormatNumberPhone/index.ts +0 -23
  133. package/src/hooks/useFullScreenMode/index.ts +0 -61
  134. package/src/hooks/useGenerateNumberArray/index.ts +0 -17
  135. package/src/hooks/useGetAllLocationUser/index.ts +0 -13
  136. package/src/hooks/useGetAllLocationUser/queries.ts +0 -44
  137. package/src/hooks/useGetAllSales/index.ts +0 -26
  138. package/src/hooks/useGetCookies/index.ts +0 -43
  139. package/src/hooks/useGetExtProductFoodsSubOptionalAll/index.ts +0 -15
  140. package/src/hooks/useGetFoodRecomended/index.ts +0 -33
  141. package/src/hooks/useGetFoodRecomended/queries.ts +0 -47
  142. package/src/hooks/useGetMessagesToRoom/index.ts +0 -23
  143. package/src/hooks/useGetMinPrice/index.ts +0 -13
  144. package/src/hooks/useGetMinPrice/queries.ts +0 -7
  145. package/src/hooks/useGetOneStoreRating/index.ts +0 -41
  146. package/src/hooks/useGetOneStoreRating/queries.ts +0 -18
  147. package/src/hooks/useGetSalesAmountToday/index.ts +0 -31
  148. package/src/hooks/useGetStoreCookie/index.ts +0 -21
  149. package/src/hooks/useGoogleLogin/index.ts +0 -169
  150. package/src/hooks/useGoogleLogin/loadScript.ts +0 -15
  151. package/src/hooks/useGoogleLogin/removeScript.ts +0 -7
  152. package/src/hooks/useHover/index.ts +0 -32
  153. package/src/hooks/useImageOptimization/index.ts +0 -32
  154. package/src/hooks/useImageUploaderProduct/helper/canvasUtils.ts +0 -146
  155. package/src/hooks/useImageUploaderProduct/helper/getOrientation.ts +0 -54
  156. package/src/hooks/useImageUploaderProduct/helper/index.ts +0 -5
  157. package/src/hooks/useImageUploaderProduct/index.ts +0 -295
  158. package/src/hooks/useImageWeight/index.ts +0 -55
  159. package/src/hooks/useImagesStore/index.ts +0 -227
  160. package/src/hooks/useImagesStore/queries.ts +0 -193
  161. package/src/hooks/useImagesStore/utils/index.ts +0 -4
  162. package/src/hooks/useIncomingOrders/index.ts +0 -11
  163. package/src/hooks/useIncomingOrders/queries.ts +0 -87
  164. package/src/hooks/useInnerHtml/index.ts +0 -39
  165. package/src/hooks/useIntersection/index.ts +0 -84
  166. package/src/hooks/useInventory/index.ts +0 -2
  167. package/src/hooks/useInventory/queries.ts +0 -58
  168. package/src/hooks/useInventory/useGetProductsInStock.ts +0 -16
  169. package/src/hooks/useInventory/useUpdateManageStock.ts +0 -41
  170. package/src/hooks/useKeypress/index.ts +0 -28
  171. package/src/hooks/useLazyScript/index.ts +0 -74
  172. package/src/hooks/useLocalBackendIp/index.ts +0 -34
  173. package/src/hooks/useLocalSorage/index.ts +0 -36
  174. package/src/hooks/useLocationManager/index.ts +0 -63
  175. package/src/hooks/useLocationNavigate/index.ts +0 -54
  176. package/src/hooks/useLoginEmployeeInStore/index.ts +0 -38
  177. package/src/hooks/useLogout/helpers/BroadcastChannel.ts +0 -74
  178. package/src/hooks/useLogout/helpers/apiBaseUrl.ts +0 -12
  179. package/src/hooks/useLogout/helpers/fetchData.ts +0 -37
  180. package/src/hooks/useLogout/helpers/getCsrfToken.ts +0 -37
  181. package/src/hooks/useLogout/helpers/index.ts +0 -65
  182. package/src/hooks/useLogout/helpers/logger.ts +0 -88
  183. package/src/hooks/useLogout/helpers/parseUrl.ts +0 -39
  184. package/src/hooks/useLogout/index.ts +0 -105
  185. package/src/hooks/useManageNewOrder/helpers/index.ts +0 -45
  186. package/src/hooks/useManageNewOrder/helpers/mock.ts +0 -0
  187. package/src/hooks/useManageNewOrder/index.ts +0 -104
  188. package/src/hooks/useManageQueryParams/index.ts +0 -120
  189. package/src/hooks/useMobile/index.ts +0 -65
  190. package/src/hooks/useModules/helpers/index.ts +0 -1
  191. package/src/hooks/useModules/helpers/validateModules.ts +0 -43
  192. package/src/hooks/useModules/index.ts +0 -124
  193. package/src/hooks/useMouse/index.ts +0 -55
  194. package/src/hooks/useMutateHeight/index.ts +0 -36
  195. package/src/hooks/useOrderClient/index.ts +0 -5
  196. package/src/hooks/useOrderStatusTypes/index.ts +0 -2
  197. package/src/hooks/useOrderStatusTypes/useOrderStatusTypes/index.ts +0 -133
  198. package/src/hooks/useOrderStatusTypes/useUpdateOrderStatusPriorities/index.ts +0 -99
  199. package/src/hooks/useOrders/index.ts +0 -3
  200. package/src/hooks/useOrders/queries.ts +0 -99
  201. package/src/hooks/useOrders/useChangeOrderState/index.ts +0 -128
  202. package/src/hooks/useOrders/useOrdersFromStore/index.ts +0 -77
  203. package/src/hooks/usePWAInstall/index.ts +0 -38
  204. package/src/hooks/usePaymentMethod/index.ts +0 -3
  205. package/src/hooks/usePaymentMethod/paymentMethod.gql.ts +0 -62
  206. package/src/hooks/usePaymentMethod/paymentMethod.types.ts +0 -28
  207. package/src/hooks/usePaymentMethod/useCreatePaymentMethod/index.ts +0 -25
  208. package/src/hooks/usePaymentMethod/useGetAllPaymentMethods/index.ts +0 -19
  209. package/src/hooks/usePaymentMethod/useGetPaymentMethod/index.ts +0 -26
  210. package/src/hooks/usePortFetcher/index.ts +0 -33
  211. package/src/hooks/usePrintSaleTicket/index.ts +0 -68
  212. package/src/hooks/useProductsFood/index.ts +0 -341
  213. package/src/hooks/useProductsFood/queriesStore.ts +0 -964
  214. package/src/hooks/useProductsFood/types/index.ts +0 -0
  215. package/src/hooks/useProductsFood/useEditProduct.ts +0 -49
  216. package/src/hooks/useProductsFood/usetagsProducts.ts +0 -101
  217. package/src/hooks/useProviders/index.ts +0 -3
  218. package/src/hooks/useProviders/queries.ts +0 -31
  219. package/src/hooks/useProviders/useProvidersCreateStore/index.ts +0 -13
  220. package/src/hooks/useProviders/useProvidersDataStore/index.ts +0 -25
  221. package/src/hooks/useProvidersStore/index.ts +0 -25
  222. package/src/hooks/useProvidersStore/queries.ts +0 -31
  223. package/src/hooks/usePushNotificationOrder/index.ts +0 -52
  224. package/src/hooks/usePushNotifications/helpers/index.ts +0 -123
  225. package/src/hooks/usePushNotifications/index.ts +0 -150
  226. package/src/hooks/useQueryLocationsMap/index.ts +0 -20
  227. package/src/hooks/useQueryLocationsMap/queries.ts +0 -40
  228. package/src/hooks/useRatingArrayData/index.ts +0 -54
  229. package/src/hooks/useRatingArrayData/queries.ts +0 -19
  230. package/src/hooks/useReactToPrint/index.ts +0 -4
  231. package/src/hooks/useReactToPrint/index.txt +0 -1223
  232. package/src/hooks/useRemoveExtraProductFoodsOptional/index.ts +0 -24
  233. package/src/hooks/useRemoveExtraProductFoodsOptional/queries.ts +0 -48
  234. package/src/hooks/useReport/index.ts +0 -48
  235. package/src/hooks/useReport/queries.ts +0 -72
  236. package/src/hooks/useRestaurant/helpers/index.ts +0 -28
  237. package/src/hooks/useRestaurant/helpers/manageStatusOpen.ts +0 -26
  238. package/src/hooks/useRestaurant/index.ts +0 -71
  239. package/src/hooks/useRestaurant/queries.ts +0 -81
  240. package/src/hooks/useRoads/index.ts +0 -20
  241. package/src/hooks/useRoads/queries.ts +0 -13
  242. package/src/hooks/useRoles/index.ts +0 -4
  243. package/src/hooks/useRoles/queries.ts +0 -70
  244. package/src/hooks/useRoles/useCreateRole.ts +0 -40
  245. package/src/hooks/useRoles/useGetRoles.ts +0 -37
  246. package/src/hooks/useRoles/useRemoveRoles.ts +0 -40
  247. package/src/hooks/useRoles/useUpdateRolesPriority.ts +0 -44
  248. package/src/hooks/useSales/helpers/add-product.utils.ts +0 -120
  249. package/src/hooks/useSales/helpers/apply-discount-to-cart.utils.ts +0 -292
  250. package/src/hooks/useSales/helpers/comment-product.utils.ts +0 -41
  251. package/src/hooks/useSales/helpers/constants/index.ts +0 -38
  252. package/src/hooks/useSales/helpers/extras.utils.ts +0 -42
  253. package/src/hooks/useSales/helpers/filterProductsByCarProId.utils.ts +0 -17
  254. package/src/hooks/useSales/helpers/increment-product-quantity.utils.ts +0 -76
  255. package/src/hooks/useSales/helpers/index.ts +0 -3
  256. package/src/hooks/useSales/helpers/initializer.utils.ts +0 -22
  257. package/src/hooks/useSales/helpers/isStockInsufficient.ts +0 -3
  258. package/src/hooks/useSales/helpers/remove-product.utils.test.ts +0 -49
  259. package/src/hooks/useSales/helpers/remove-product.utils.ts +0 -34
  260. package/src/hooks/useSales/helpers/resolveProduct.ts +0 -29
  261. package/src/hooks/useSales/helpers/useAddToCart.ts +0 -64
  262. package/src/hooks/useSales/index.ts +0 -1418
  263. package/src/hooks/useSales/queries.ts +0 -532
  264. package/src/hooks/useSales/types/index.ts +0 -206
  265. package/src/hooks/useSales/types/use-sales.types.ts +0 -8
  266. package/src/hooks/useSales/useGetSale.ts +0 -21
  267. package/src/hooks/useSales/useTotalSales.ts +0 -24
  268. package/src/hooks/useSaveAvailableProduct/helpers/index.ts +0 -38
  269. package/src/hooks/useSaveAvailableProduct/index.ts +0 -32
  270. package/src/hooks/useSaveAvailableProduct/queries.ts +0 -10
  271. package/src/hooks/useSaveLocation/index.ts +0 -17
  272. package/src/hooks/useSaveLocation/queries.ts +0 -19
  273. package/src/hooks/useSchedule/index.ts +0 -35
  274. package/src/hooks/useSchedule/queries.ts +0 -43
  275. package/src/hooks/useSchedule/schedule.ts +0 -79
  276. package/src/hooks/useScheduleData/index.ts +0 -135
  277. package/src/hooks/useScroll/index.ts +0 -56
  278. package/src/hooks/useScrollRotate/index.ts +0 -16
  279. package/src/hooks/useSetImageProducts/index.ts +0 -59
  280. package/src/hooks/useSetImageProducts/queries.ts +0 -18
  281. package/src/hooks/useSetSession/index.ts +0 -44
  282. package/src/hooks/useSetState/index.ts +0 -24
  283. package/src/hooks/useSetupSchedule/helpers/index.ts +0 -85
  284. package/src/hooks/useSetupSchedule/index.ts +0 -284
  285. package/src/hooks/useStatusOpenStore/helpers/index.ts +0 -124
  286. package/src/hooks/useStatusOpenStore/index.ts +0 -195
  287. package/src/hooks/useStatusOrdersClient/helpers/index.ts +0 -14
  288. package/src/hooks/useStatusOrdersClient/index.ts +0 -18
  289. package/src/hooks/useStatusOrdersClient/queries.ts +0 -80
  290. package/src/hooks/useStock/index.ts +0 -1
  291. package/src/hooks/useStock/useStockUpdatedAllSubscription.ts +0 -40
  292. package/src/hooks/useStockMovements/helpers/index.ts +0 -16
  293. package/src/hooks/useStockMovements/index.ts +0 -39
  294. package/src/hooks/useStore/index.ts +0 -83
  295. package/src/hooks/useStore/queries.ts +0 -163
  296. package/src/hooks/useStoreCalendar/index.ts +0 -5
  297. package/src/hooks/useStoreContacts/index.ts +0 -53
  298. package/src/hooks/useStoreContacts/queries.ts +0 -48
  299. package/src/hooks/useStoreTable/index.ts +0 -2
  300. package/src/hooks/useStoreTable/queries.ts +0 -47
  301. package/src/hooks/useStoreTable/useStoreTableCreate.ts +0 -77
  302. package/src/hooks/useStoreTable/useStoreTables.ts +0 -15
  303. package/src/hooks/useSubscriptionValidation/index.ts +0 -112
  304. package/src/hooks/useTagProducts/index.ts +0 -3
  305. package/src/hooks/useTagProducts/useDeleteOneTag.ts +0 -106
  306. package/src/hooks/useTagProducts/useGetAllTags.ts +0 -68
  307. package/src/hooks/useTagProducts/useRegisterMultipleTags.ts +0 -157
  308. package/src/hooks/useTheme/index.ts +0 -65
  309. package/src/hooks/useTimeAgo/useTimeAgo.ts +0 -39
  310. package/src/hooks/useTokenCards/index.ts +0 -45
  311. package/src/hooks/useTopProductsMovements/index.ts +0 -27
  312. package/src/hooks/useTotalAllSales/index.ts +0 -25
  313. package/src/hooks/useTotalProductsInStock/index.ts +0 -23
  314. package/src/hooks/useTotalProductsSold/index.ts +0 -23
  315. package/src/hooks/useTotalProductsSolded/index.ts +0 -20
  316. package/src/hooks/useUpdateCart/index.ts +0 -131
  317. package/src/hooks/useUpdateCartCookie/index.ts +0 -60
  318. package/src/hooks/useUpdateDashboardComponent/index.ts +0 -91
  319. package/src/hooks/useUpdateExistingOrders/index.ts +0 -85
  320. package/src/hooks/useUpdateExtProductFoodsSubOptional/index.ts +0 -61
  321. package/src/hooks/useUpdateModuleOrder/index.ts +0 -37
  322. package/src/hooks/useUpdateMultipleExtProduct/index.ts +0 -34
  323. package/src/hooks/useUpdateMultipleExtProduct/queries.ts +0 -33
  324. package/src/hooks/useUpdateMultipleProducts/index.ts +0 -117
  325. package/src/hooks/useUpdateMultipleProducts/queries.ts +0 -51
  326. package/src/hooks/useUploadProducts/helpers/index.ts +0 -1
  327. package/src/hooks/useUploadProducts/helpers/parseNumber.ts +0 -37
  328. package/src/hooks/useUploadProducts/helpers/validateProductDataExcel.ts +0 -73
  329. package/src/hooks/useUploadProducts/index.ts +0 -442
  330. package/src/hooks/useUpsertGoal/index.ts +0 -68
  331. package/src/hooks/useUser/index.ts +0 -24
  332. package/src/hooks/useUser/queries.ts +0 -131
  333. package/src/hooks/useWeeklyStockMovement/helpers/index.ts +0 -32
  334. package/src/hooks/useWeeklyStockMovement/index.ts +0 -52
  335. package/src/hooks/useWindowSize/index.ts +0 -45
  336. package/src/index.ts +0 -11
  337. package/src/mock/dessert/index.ts +0 -16
  338. package/src/mock/index.ts +0 -1
  339. package/src/security/index.ts +0 -1
  340. package/src/services/index.ts +0 -1
  341. package/src/utils/UtilDateRange.ts +0 -56
  342. package/src/utils/generateCode.ts +0 -222
  343. package/src/utils/index.ts +0 -2
  344. package/src/utils/utils.ts +0 -344
  345. package/tsconfig.eslint.json +0 -16
  346. package/tsconfig.json +0 -21
  347. package/tsup.config.ts +0 -24
@@ -1,69 +0,0 @@
1
- import crypto from 'crypto'
2
-
3
- /**
4
- *
5
- * @param password
6
- * @param salt
7
- */
8
- function generateEncryptionKey(password: string, salt: string): string {
9
- return crypto
10
- .pbkdf2Sync(password, salt, 100000, 32, 'sha256')
11
- .toString('hex')
12
- .slice(0, 32)
13
- }
14
-
15
- const ENCRYPTION_KEY = generateEncryptionKey(
16
- 'tu-contraseña',
17
- 'alguna-sal-segura'
18
- )
19
- const IV_LENGTH = 12 // Para AES-GCM, el IV recomendado es 12 bytes
20
-
21
- export const encryptSession = (text: string): string | null => {
22
- try {
23
- const iv = crypto.randomBytes(IV_LENGTH)
24
- const cipher = crypto.createCipheriv(
25
- 'aes-256-gcm',
26
- Buffer.from(ENCRYPTION_KEY),
27
- iv
28
- )
29
- let encrypted = cipher.update(text, 'utf8')
30
- encrypted = Buffer.concat([encrypted, cipher.final()])
31
- const authTag = cipher.getAuthTag()
32
- // Concatenar IV, AuthTag y el texto cifrado, separados por ':'
33
- return [
34
- iv.toString('hex'),
35
- authTag.toString('hex'),
36
- encrypted.toString('hex')
37
- ].join(':')
38
- } catch (error) {
39
- if (error instanceof Error) {
40
- console.error('Error de cifrado:', error.message)
41
- }
42
- return null
43
- }
44
- }
45
-
46
- export const decryptSession = (text: string): string | null => {
47
- try {
48
- if (!text) return null
49
- const textParts = text.split(':')
50
- if (textParts.length !== 3) return null
51
- const iv = Buffer.from(textParts[0], 'hex')
52
- const authTag = Buffer.from(textParts[1], 'hex')
53
- const encryptedText = Buffer.from(textParts[2], 'hex')
54
- const decipher = crypto.createDecipheriv(
55
- 'aes-256-gcm',
56
- Buffer.from(ENCRYPTION_KEY),
57
- iv
58
- )
59
- decipher.setAuthTag(authTag)
60
- let decrypted = decipher.update(encryptedText)
61
- decrypted = Buffer.concat([decrypted, decipher.final()])
62
- return decrypted.toString('utf8')
63
- } catch (error) {
64
- if (error instanceof Error) {
65
- console.error('Error de descifrado:', error.message)
66
- }
67
- return null
68
- }
69
- }
@@ -1,72 +0,0 @@
1
- import { Cookies } from '../../cookies'
2
-
3
- /**
4
- * Decodes a JWT safely without verifying signature.
5
- * Use ONLY for reading payload data.
6
- *
7
- * @param {string} token - JWT string
8
- * @returns {Record<string, any> | null}
9
- */
10
- const decodeJwtPayload = (token: string): Record<string, any> | null => {
11
- try {
12
- const [, payload] = token.split('.')
13
- if (!payload) return null
14
-
15
- const decoded = Buffer.from(payload, 'base64').toString('utf-8')
16
- return JSON.parse(decoded)
17
- } catch {
18
- return null
19
- }
20
- }
21
-
22
- /**
23
- * Gets session data from cookie "session".
24
- * Designed for Next.js 15 App Router (server-side).
25
- *
26
- * @returns {Promise<{
27
- * isSession: boolean
28
- * token?: string
29
- * user?: Record<string, any>
30
- * deviceid?: string
31
- * error?: string
32
- * }>}
33
- */
34
- export const getSession = async () => {
35
- try {
36
- const token = Cookies.get('session')
37
- return new Promise((resolve) => {
38
- if (!token) {
39
- resolve({ isSession: false })
40
- return
41
- }
42
- const payload = decodeJwtPayload(token)
43
- if (!payload) {
44
- resolve({ isSession: false })
45
- return
46
- }
47
- const { user, deviceid, exp } = payload
48
- const currentTime = Math.floor(Date.now() / 1000)
49
- if (exp && currentTime >= exp) {
50
- resolve({ isSession: false })
51
- return
52
- }
53
- resolve({
54
- isSession: true,
55
- token,
56
- user,
57
- deviceid
58
- })
59
- })
60
- } catch (error) {
61
- if (error instanceof Error) {
62
- return {
63
- isSession: false,
64
- error: String(error.message)
65
- }
66
- }
67
- return {
68
- isSession: false,
69
- error: 'Unexpected session error'
70
- }
71
- }
72
- }
@@ -1,70 +0,0 @@
1
- /**
2
- * Get the start timestamp for the current day.
3
- * @returns {string} The start timestamp for the current day.
4
- */
5
- export const getStartOfDayTimestamp = () => {
6
- const start = new Date()
7
- start.setHours(0, 0, 0, 0)
8
- return start.toISOString()
9
- }
10
-
11
- /**
12
- * Get the end timestamp for the current day.
13
- * @returns {string} The end timestamp for the current day.
14
- */
15
- export const getEndOfDayTimestamp = () => {
16
- const end = new Date()
17
- end.setHours(23, 59, 59, 999)
18
- return end.toISOString()
19
- }
20
-
21
- /**
22
- * Get start and end timestamps for the current day.
23
- * @returns {Object} An object containing start and end timestamps.
24
- */
25
- export const getTodayTimestamps = () => {
26
- return {
27
- startTimestamp: getStartOfDayTimestamp(),
28
- endTimestamp: getEndOfDayTimestamp()
29
- }
30
- }
31
-
32
- /**
33
- * Get start timestamp for a specific number of days ago.
34
- * @param {number} daysAgo - The number of days ago.
35
- * @returns {string} The start timestamp for the specified number of days ago.
36
- */
37
- export const getStartTimestampDaysAgo = (daysAgo) => {
38
- if (isNaN(daysAgo) || daysAgo < 0) {
39
- throw new Error('Invalid input. Provide a valid number of days.')
40
- }
41
-
42
- const start = new Date()
43
- start.setDate(start.getDate() - daysAgo)
44
- start.setHours(0, 0, 0, 0)
45
-
46
- return start.toISOString()
47
- }
48
-
49
- /**
50
- *
51
- * @param root0
52
- * @param root0.dateString
53
- * @param root0.start
54
- */
55
- export function convertDateFormat ({ dateString, start }) {
56
- const parsedDate = dateString ? new Date(dateString) : new Date()
57
- const year = parsedDate.getFullYear()
58
- const month = `0${parsedDate.getMonth() + 1}`.slice(-2)
59
- const day = `0${parsedDate.getDate()}`.slice(-2)
60
-
61
- if (start) {
62
- // Inicio del día (00:00:00)
63
- return `${year}-${month}-${day}T00:00:00.000Z`
64
- }
65
- // Final del día (23:59:59.999)
66
- const endOfDay = new Date(parsedDate)
67
- endOfDay.setHours(23, 59, 59, 999)
68
- return endOfDay.toISOString()
69
-
70
- }
@@ -1,76 +0,0 @@
1
- /**
2
- * Schedule day structure
3
- */
4
- export interface ScheduleDay {
5
- schHoSta?: string
6
- schHoEnd?: string
7
- }
8
-
9
- /**
10
- * Calculate total worked hours from a list of days.
11
- * Keeps original behavior and edge cases intact.
12
- *
13
- * @param {ScheduleDay[]} days - Array of days with start and end times
14
- * @returns {string} Total time formatted as HH:MM
15
- */
16
- export const getTotalHours = (days: ScheduleDay[] = []): string => {
17
- const totalMinutesArray: number[] = days.map((day) => {
18
- const { schHoSta, schHoEnd } = day
19
-
20
- // Handle potential invalid time strings
21
- if (!isValidTimeString(schHoSta) || !isValidTimeString(schHoEnd)) {
22
- return 0
23
- }
24
-
25
- const [startHours, startMinutes] = schHoSta.split(':')
26
- const [endHours, endMinutes] = schHoEnd.split(':')
27
-
28
- // Convert hours and minutes to integers for calculations
29
- let totalHoursInt =
30
- parseInt(endHours, 10) - parseInt(startHours, 10)
31
-
32
- const totalMinutesInt =
33
- parseInt(endMinutes, 10) - parseInt(startMinutes, 10)
34
-
35
- // Handle negative total minutes
36
- let totalMinutes = totalMinutesInt
37
- if (totalMinutes < 0) {
38
- totalHoursInt--
39
- totalMinutes += 60
40
- }
41
-
42
- // Calculate total time in minutes
43
- return totalHoursInt * 60 + totalMinutes
44
- })
45
-
46
- // Sum all minutes
47
- const totalMinutes: number = totalMinutesArray.reduce(
48
- (acc, curr) => {return acc + curr},
49
- 0
50
- )
51
-
52
- // Convert to hours and minutes
53
- const totalHours: number = Math.floor(totalMinutes / 60)
54
- const remainingMinutes: number = totalMinutes % 60
55
-
56
- // Format HH:MM
57
- const formattedHours = totalHours.toString().padStart(2, '0')
58
- const formattedMinutes = remainingMinutes.toString().padStart(2, '0')
59
-
60
- return `${formattedHours}:${formattedMinutes}`
61
- }
62
-
63
- /**
64
- * Validate time string format (HH:MM)
65
- *
66
- * @param {string | undefined} timeString
67
- * @returns {boolean}
68
- */
69
- export const isValidTimeString = (
70
- timeString?: string
71
- ): timeString is string => {
72
- if (!timeString) return false
73
-
74
- const timeRegex = /^([0-1][0-9]|2[0-3]):([0-5][0-9])$/
75
- return timeRegex.test(timeString)
76
- }
@@ -1,14 +0,0 @@
1
- /**
2
- *
3
- * @param body
4
- */
5
- export async function handleLogin (body) {
6
- const response = await fetch(`${process.env.URL_BASE}/api/auth/login`, {
7
- method: 'POST',
8
- headers: { 'Content-Type': 'application/json' },
9
- body: JSON.stringify(body),
10
- credentials: 'include'
11
- })
12
-
13
- return response.json()
14
- }
@@ -1,154 +0,0 @@
1
- export * from './updateExtProductFoodsOptional'
2
- export * from './useAcumulateDate'
3
- export * from './useBanner'
4
- export * from './useCategoryInStore'
5
- export * from './useCategoryStore'
6
- export * from './useCatWithProduct'
7
- export * from './useManageQueryParams'
8
- export * from './useDeliveryTime'
9
- export * from './useModules'
10
- export * from './getTotalHours'
11
- export * from './useUpdateMultipleProducts'
12
- export * from './useTokenCards'
13
- export * from './useStoreTable/index'
14
- export * from './useSubscriptionValidation'
15
- export * from './convertToMilitaryTime'
16
- export * from './useRoles'
17
- export * from './useLocalBackendIp'
18
- export * from './statusOpenStores'
19
- export * from './completeSchedules'
20
- export * from './useLogout/helpers/BroadcastChannel'
21
- export * from './useLogout/helpers/index'
22
- export * from './getCardType'
23
- export * from './useLoginEmployeeInStore'
24
- export * from './useUploadProducts'
25
- export * from './useAmountInput'
26
- export * from './useColorByLetters'
27
- export * from './newMessageSubscription'
28
- export * from './usePWAInstall'
29
- export * from './useGetCookies'
30
- export * from './generateTemplate'
31
- export * from './isTokenExpired'
32
- export * from './useCreateDeliveryTime'
33
- export * from './addTenMinutes'
34
- export * from './useUpdateCartCookie'
35
- export * from './useCategoriesProduct'
36
- export * from './useLogout'
37
- export * from './useSetupSchedule'
38
- export * from './useMouse'
39
- export * from './useStatusOpenStore'
40
- export * from './usePushNotificationOrder'
41
- export * from './newStoreOrderSubscription'
42
- export * from './useChatRoomSubscription'
43
- export * from './useScheduleData'
44
- export * from './useGetMessagesToRoom'
45
- export * from './useOrders'
46
- export * from './usePushNotifications'
47
- export * from './useLocationManager'
48
- export * from './useQueryLocationsMap'
49
- export * from './useGetAllLocationUser'
50
- export * from './useFingerprintjs'
51
- export * from './useCountries'
52
- export * from './useDessertWithPrice'
53
- export * from './generateStoreURL'
54
- export * from './useCreateStorePendingToRegister'
55
- export * from './useDepartments'
56
- export * from './useSaveLocation'
57
- export * from './useRoads'
58
- export * from './useCities'
59
- export * from './useEditCategory'
60
- export * from './useEmployee'
61
- export * from './useEmployee/useCreateEmployee'
62
- export * from './useCheckbox'
63
- export * from './useRemoveExtraProductFoodsOptional'
64
- export * from './useDeleteSubProductOptional'
65
- export * from './useGetOneStoreRating'
66
- export * from './useFavoriteStores'
67
- export * from './useAsideCart'
68
- export * from './useRatingArrayData'
69
- export * from './useChartData'
70
- export * from './useDevices'
71
- export * from './useClients'
72
- export * from './useScroll'
73
- export * from './useStatusOrdersClient'
74
- export * from './useUpdateExistingOrders'
75
- export * from './useConnection'
76
- export * from './useManageNewOrder'
77
- export * from './useCreateProduct'
78
- export * from './useCreateProduct/helpers/useEditImageProduct'
79
- export * from './useDessert'
80
- export * from './useDrag'
81
- export * from './useEvent'
82
- export * from './useFetchJson'
83
- export * from './useFormatDate'
84
- export * from './getTodayTimestamps'
85
- export * from './useFormatNumberPhone'
86
- export * from './useFormTools/index'
87
- export * from './useHover'
88
- export * from './useImageOptimization'
89
- export * from './useImagesStore'
90
- export * from './useImageWeight'
91
- export * from './useIntersection'
92
- export * from './useKeypress'
93
- export * from './useLazyScript'
94
- export * from './useLocalSorage'
95
- export * from './useLocationNavigate'
96
- export * from './useSetSession'
97
- export * from './useMobile'
98
- export * from './useMutateHeight'
99
- export * from './useProductsFood'
100
- export * from './useProductsFood/usetagsProducts'
101
- // export * from './useReactToPrint'
102
- export * from './useReport'
103
- export * from './useSales/useTotalSales'
104
- export * from './useOrderClient'
105
- export * from './useStoreContacts'
106
- export * from './useRestaurant'
107
- export * from './useSales/index'
108
- export * from './useSales/useGetSale'
109
- export * from './useGetMinPrice'
110
- export * from './useCatWithProductClient'
111
- export * from './useGetFoodRecomended'
112
- export * from './useSaveAvailableProduct'
113
- export * from './useSchedule'
114
- export * from './useSetState'
115
- export * from './useStore'
116
- export * from './useStoreCalendar'
117
- export * from './getCategoriesWithProduct'
118
- export * from './useIncomingOrders'
119
- export * from './useTimeAgo/useTimeAgo'
120
- export * from './useUpdateCart'
121
- export * from './useUpdateExtProductFoodsSubOptional'
122
- export * from './useUser'
123
- export * from './useCart'
124
- export * from './useGetStoreCookie'
125
- export * from './getGlobalSession'
126
- export * from './handleLogin'
127
- export * from './useInventory'
128
- export * from './useStockMovements'
129
- export * from './useTopProductsMovements'
130
- export * from './useTotalProductsSold'
131
- export * from './useTotalProductsInStock/index'
132
- export * from './useTotalAllSales/index'
133
- export * from './useTotalProductsSolded'
134
- export * from './useWeeklyStockMovement'
135
- export * from './useSetImageProducts'
136
- export * from './useGetSalesAmountToday'
137
- export * from './useUpsertGoal'
138
- export * from './useDashboardComponents'
139
- export * from './useUpdateDashboardComponent'
140
- export * from './useUpdateModuleOrder'
141
- export * from './useDownloadReports'
142
- export * from './usePortFetcher'
143
- export * from './useImageUploaderProduct'
144
- export * from './useTagProducts'
145
- export * from './useOrderStatusTypes'
146
- export * from './useCreateOrderStatusType'
147
- export * from './useDevWS'
148
- export * from './usePrintSaleTicket'
149
- export * from './usePaymentMethod'
150
- export * from './useGetAllSales'
151
- export * from './useTheme'
152
- export * from './useFilterConfigs'
153
- export * from './useStock'
154
- export * from './getSession'
@@ -1,17 +0,0 @@
1
- /**
2
- * Verifica si un token JWT ha expirado.
3
- * @param {string} token El token JWT a verificar.
4
- * @param {string} [expField='exp'] El nombre del campo que contiene la fecha de expiración en el token.
5
- * @returns {boolean} True si el token ha expirado, false de lo contrario.
6
- */
7
- export const isTokenExpired = (token, expField = 'exp') => {
8
- try {
9
- const [, payloadBase64] = token.split('.')
10
- const decodedJson = Buffer.from(payloadBase64, 'base64').toString()
11
- const decoded = JSON.parse(decodedJson)
12
- const exp = decoded[expField] * 1000 // Convertir segundos a milisegundos
13
- return Date.now() >= exp
14
- } catch (error) {
15
- return true
16
- }
17
- }
@@ -1,28 +0,0 @@
1
- import { useSubscription, gql } from '@apollo/client'
2
-
3
- const NEW_MESSAGE_SUBSCRIPTION = gql`
4
- subscription NewMessage($idStore: String!) {
5
- newMessage(idStore: $idStore) {
6
- uuid
7
- content
8
- aDatCre
9
- from
10
- to
11
- }
12
- }
13
- `
14
-
15
- export const newMessageSubscription = (idStore, onMessageReceived) => {
16
- const subscription = useSubscription(NEW_MESSAGE_SUBSCRIPTION, {
17
- variables: { idStore },
18
- onSubscriptionData: ({ client, subscriptionData }) => {
19
- if (subscriptionData.data && subscriptionData.data.newMessage) {
20
- // Llama a la función proporcionada cuando se recibe un nuevo mensaje
21
- onMessageReceived(subscriptionData.data.newMessage)
22
- }
23
- }
24
- })
25
-
26
- // Puedes ajustar lo que devuelve el hook según tus necesidades
27
- return subscription
28
- }
@@ -1,26 +0,0 @@
1
- import { useSubscription, gql } from '@apollo/client'
2
-
3
- const NEW_STORE_ORDER_SUBSCRIPTION = gql`
4
- subscription NewStoreOrder($idStore: String!) {
5
- newStoreOrder(idStore: $idStore) {
6
- id
7
- idStore
8
- pCodeRef
9
- }
10
- }
11
- `
12
-
13
- export const newStoreOrderSubscription = (idStore, onOrderReceived) => {
14
- const subscription = useSubscription(NEW_STORE_ORDER_SUBSCRIPTION, {
15
- variables: { idStore },
16
- onSubscriptionData: ({ client, subscriptionData }) => {
17
- if (subscriptionData.data && subscriptionData.data.newStoreOrder) {
18
- // Llama a la función proporcionada cuando se recibe una nueva orden
19
- onOrderReceived(subscriptionData.data.newStoreOrder)
20
- }
21
- }
22
- })
23
-
24
- // Puedes ajustar lo que devuelve el hook según tus necesidades
25
- return subscription
26
- }
@@ -1,124 +0,0 @@
1
- export const getDayFromOpeningKey = (key) => {
2
- const days = {
3
- openingSun: 0,
4
- openingMon: 1,
5
- openingTue: 2,
6
- openingWed: 3,
7
- openingThu: 4,
8
- openingFri: 5,
9
- openingSat: 6
10
- }
11
- return days[key] !== undefined ? days[key] : -1
12
- }
13
-
14
- // Función para convertir el objeto de tiempo en una cadena de tiempo
15
- /**
16
- *
17
- * @param timeStr
18
- */
19
- export function getTimeString (timeStr) {
20
- return timeStr || '00:00' // Return '00:00' for empty time strings
21
- }
22
-
23
- /**
24
- *
25
- */
26
- export function getCurrentDayAndTime () {
27
- try {
28
- const date = new Date()
29
- const currentTime = date.getHours() * 60 + date.getMinutes()
30
- const currentDayOfWeek = date.getDay()
31
- return { currentTime, currentDayOfWeek }
32
- } catch (error) {
33
- return {
34
-
35
- }
36
- }
37
- }
38
-
39
- /**
40
- *
41
- * @param timeStr
42
- */
43
- export function getTimeObject (timeStr) {
44
- try {
45
- if (!timeStr || !/\d{2}:\d{2}/.test(timeStr)) {
46
- return { hours: 0, minutes: 0 } // Return default values for invalid input
47
- }
48
- const [hours, minutes] = timeStr.split(':').map(str => {return parseInt(str)})
49
- return { hours, minutes }
50
- } catch (e) {
51
- return { hours: 0, minutes: 0 } // Return default values on error
52
- }
53
- }
54
-
55
- /**
56
- *
57
- * @param openings
58
- */
59
- export function sortOpeningsByDay (openings) {
60
- const days = [
61
- 'openingSun',
62
- 'openingMon',
63
- 'openingTue',
64
- 'openingWed',
65
- 'openingThu',
66
- 'openingFri',
67
- 'openingSat'
68
- ]
69
- const sortedOpenings = {}
70
-
71
- days.forEach((day) => {
72
- sortedOpenings[day] = openings[day] || '00:00 - 00:00' // Agregar horario vacío para los días faltantes
73
- })
74
-
75
- return sortedOpenings
76
- }
77
-
78
- // Función para obtener la clave de openings a partir del día de la semana
79
- /**
80
- *
81
- * @param day
82
- */
83
- export function getOpeningKeyFromDay (day) {
84
- const days = {
85
- 0: 'openingSun',
86
- 1: 'openingMon',
87
- 2: 'openingTue',
88
- 3: 'openingWed',
89
- 4: 'openingThu',
90
- 5: 'openingFri',
91
- 6: 'openingSat'
92
- }
93
- return days[day]
94
- }
95
-
96
- export const weekDays = [
97
- 'Domingo',
98
- 'Lunes',
99
- 'Martes',
100
- 'Miércoles',
101
- 'Jueves',
102
- 'Viernes',
103
- 'Sábado'
104
- ]
105
-
106
- /**
107
- *
108
- * @param text
109
- */
110
- export function timeToInt (text) {
111
- const hour = parseInt(text.substring(0, 2))
112
- const minute = parseInt(text.substring(3))
113
- return hour * 60 + minute
114
- }
115
-
116
- export const days = {
117
- Monday: 'Lunes',
118
- Tuesday: 'Martes',
119
- Wednesday: 'Miércoles',
120
- Thursday: 'Jueves',
121
- Friday: 'Viernes',
122
- Saturday: 'Sábado',
123
- Sunday: 'Domingo'
124
- }