@nocios/crudify-ui 4.4.72 → 4.4.76
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/dist/{CrudiaMarkdownField-Bs940oF4.d.ts → CrudiaMarkdownField-C30enyF9.d.ts} +2 -2
- package/dist/{CrudiaMarkdownField-CKPdr2JL.d.mts → CrudiaMarkdownField-D-VooBtq.d.mts} +2 -2
- package/dist/{api-Djqihi4n.d.mts → api-RK-xY1Ah.d.mts} +22 -2
- package/dist/{api-Djqihi4n.d.ts → api-RK-xY1Ah.d.ts} +22 -2
- package/dist/chunk-2G33BADS.mjs +1 -0
- package/dist/{chunk-ZANWILS7.mjs → chunk-7J5RTLCS.mjs} +1 -1
- package/dist/chunk-AEHAZP5F.js +1 -0
- package/dist/{chunk-4LSVF26Q.js → chunk-D3NBX3SM.js} +1 -1
- package/dist/chunk-GCH3QGKL.mjs +1 -0
- package/dist/chunk-GNGIFVA4.js +1 -0
- package/dist/{chunk-L454VIXN.js → chunk-HDNGW5H5.js} +1 -1
- package/dist/chunk-IYTXJHKO.js +1 -0
- package/dist/{chunk-Q5EJLSB4.mjs → chunk-NZIH26GS.mjs} +1 -1
- package/dist/chunk-ZKWTILQT.mjs +1 -0
- package/dist/components.d.mts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/components.mjs +1 -1
- package/dist/{errorTranslation-BuEEtVg4.d.mts → errorTranslation-B4wcHzD3.d.mts} +1 -1
- package/dist/{errorTranslation-BIyBYuGF.d.ts → errorTranslation-CCC5IWoN.d.ts} +1 -1
- package/dist/hooks.d.mts +4 -3
- package/dist/hooks.d.ts +4 -3
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/{index-CQnAzvOE.d.mts → index-DEnlzdtV.d.mts} +90 -16
- package/dist/{index-BVT7flO5.d.ts → index-pQmuVg3q.d.ts} +90 -16
- package/dist/index.d.mts +101 -70
- package/dist/index.d.ts +101 -70
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/utils.d.mts +11 -4
- package/dist/utils.d.ts +11 -4
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +3 -3
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/configResolver.ts.html +0 -499
- package/coverage/coverage-final.json +0 -2
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -116
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -210
- package/dist/chunk-JCMHUFYK.mjs +0 -1
- package/dist/chunk-LPC6P3Z7.mjs +0 -1
- package/dist/chunk-SEDLJT7G.js +0 -1
- package/dist/chunk-UJD6SL66.mjs +0 -1
- package/dist/chunk-X3JFRSEA.js +0 -1
- package/dist/chunk-YLKGZV2N.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as $,j as U}from"./chunk-2G33BADS.mjs";import{a as V}from"./chunk-GCH3QGKL.mjs";import{useState as K,useEffect as z,useCallback as j,useRef as v}from"react";import Q from"@nocios/crudify-browser";var J=(S={})=>{let{autoFetch:c=!0,retryOnError:N=!1,maxRetries:m=3}=S,{isAuthenticated:T,isInitialized:I,sessionData:u,tokens:p}=U(),[R,d]=K(null),[y,A]=K(c&&T),[C,E]=K(null),l=v(null),o=v(!0),g=v(0),f=v(0),F=j(()=>{if(!u)return null;let h=u["cognito:username"];return u.email||(typeof h=="string"?h:null)},[u]),P=j(()=>{d(null),E(null),A(!1),f.current=0},[]),D=j(async()=>{let h=F();if(!h){o.current&&(E("No user email available from session data"),A(!1));return}if(!I){o.current&&(E("Session not initialized"),A(!1));return}l.current&&l.current.abort();let e=new AbortController;l.current=e;let i=++g.current;try{o.current&&(A(!0),E(null));let s=await Q.readItems("users",{filter:{email:h},pagination:{limit:1}});if(i===g.current&&o.current&&!e.signal.aborted){let r=null;if(s.success){let t=s.data;if(Array.isArray(t)&&t.length>0)r=t[0];else if(t&&typeof t=="object"&&!Array.isArray(t)&&t.response?.data)try{let n=t.response.data,a=typeof n=="string"?JSON.parse(n):n;a&&a.items&&Array.isArray(a.items)&&a.items.length>0&&(r=a.items[0])}catch{}else t&&typeof t=="object"&&!Array.isArray(t)&&t.items&&Array.isArray(t.items)&&t.items.length>0&&(r=t.items[0]);if(!r&&t&&typeof t=="object"&&!Array.isArray(t)&&t.data?.response?.data)try{let n=t.data.response.data,a=typeof n=="string"?JSON.parse(n):n;a&&a.items&&Array.isArray(a.items)&&a.items.length>0&&(r=a.items[0])}catch{}}r?(d(r),E(null),f.current=0):(E("User profile not found in database"),d(null))}}catch(s){if(i===g.current&&o.current){let r=s;if(r.name==="AbortError")return;N&&f.current<m&&(r.message?.includes("Network Error")||r.message?.includes("Failed to fetch"))?(f.current++,setTimeout(()=>{o.current&&D()},1e3*f.current)):(E("Failed to load user profile from database"),d(null))}}finally{i===g.current&&o.current&&A(!1),l.current===e&&(l.current=null)}},[I,F,N,m]);return z(()=>{c&&T&&I?D():T||P()},[c,T,I,D,P]),z(()=>(o.current=!0,()=>{o.current=!1,l.current&&(l.current.abort(),l.current=null)}),[]),{user:{session:u,data:R},loading:y,error:C,refreshProfile:D,clearProfile:P}};import{useCallback as W}from"react";var te=()=>{let{isAuthenticated:S,isLoading:c,isInitialized:N,tokens:m,error:T,sessionData:I,login:u,logout:p,refreshTokens:R,clearError:d,getTokenInfo:y,isExpiringSoon:A,expiresIn:C,refreshExpiresIn:E}=U(),l=W(g=>{g?V.warn("useAuth.setToken() is deprecated. Use login() method instead for better security."):p()},[p]),o=m?.expiresAt?new Date(m.expiresAt):null;return{isAuthenticated:S,loading:c,error:T,token:m?.accessToken||null,user:I,tokenExpiration:o,setToken:l,logout:p,refreshToken:R,login:u,isExpiringSoon:A,expiresIn:C,refreshExpiresIn:E,getTokenInfo:y,clearError:d}};import{useCallback as w}from"react";import k from"@nocios/crudify-browser";var ae=()=>{let{isInitialized:S,isLoading:c,error:N,isAuthenticated:m,login:T}=U(),I=w(()=>S&&!c&&!N,[S,c,N]),u=w(async()=>new Promise((o,g)=>{let f=()=>{I()?o():N?g(new Error(N)):setTimeout(f,100)};f()}),[I,N]),p=w(async()=>{if(!I())throw new Error("System not ready. Check isInitialized, isLoading, and error states.")},[I]),R=w(async(o,g,f)=>(await p(),await k.readItems(o,g||{},f)),[p]),d=w(async(o,g,f)=>(await p(),await k.readItem(o,g,f)),[p]),y=w(async(o,g,f)=>(await p(),await k.createItem(o,g,f)),[p]),A=w(async(o,g,f)=>(await p(),await k.updateItem(o,g,f)),[p]),C=w(async(o,g,f)=>(await p(),await k.deleteItem(o,g,f)),[p]),E=w(async(o,g)=>(await p(),await k.transaction(o,g)),[p]),l=w(async(o,g)=>{try{let f=await T(o,g);return f.success?{success:!0,data:f.tokens}:{success:!1,errors:f.error||"Login failed"}}catch(f){return{success:!1,errors:f instanceof Error?f.message:"Login failed"}}},[T]);return{readItems:R,readItem:d,createItem:y,updateItem:A,deleteItem:C,transaction:E,login:l,isInitialized:S,isInitializing:c,initializationError:N,isReady:I,waitForReady:u}};import{useCallback as _}from"react";import b from"@nocios/crudify-browser";var Y={INVALID_CREDENTIALS:"warning",UNAUTHORIZED:"warning",INVALID_API_KEY:"error",USER_NOT_FOUND:"warning",USER_NOT_ACTIVE:"warning",NO_PERMISSION:"warning",ITEM_NOT_FOUND:"info",NOT_FOUND:"info",IN_USE:"warning",FIELD_ERROR:"warning",BAD_REQUEST:"warning",INTERNAL_SERVER_ERROR:"error",DATABASE_CONNECTION_ERROR:"error",INVALID_CONFIGURATION:"error",UNKNOWN_OPERATION:"error",TOO_MANY_REQUESTS:"warning"},M={INVALID_CREDENTIALS:"errors.auth.INVALID_CREDENTIALS",UNAUTHORIZED:"errors.auth.UNAUTHORIZED",INVALID_API_KEY:"errors.auth.INVALID_API_KEY",USER_NOT_FOUND:"errors.auth.USER_NOT_FOUND",USER_NOT_ACTIVE:"errors.auth.USER_NOT_ACTIVE",NO_PERMISSION:"errors.auth.NO_PERMISSION",ITEM_NOT_FOUND:"errors.data.ITEM_NOT_FOUND",NOT_FOUND:"errors.data.NOT_FOUND",IN_USE:"errors.data.IN_USE",FIELD_ERROR:"errors.data.FIELD_ERROR",BAD_REQUEST:"errors.data.BAD_REQUEST",INTERNAL_SERVER_ERROR:"errors.system.INTERNAL_SERVER_ERROR",DATABASE_CONNECTION_ERROR:"errors.system.DATABASE_CONNECTION_ERROR",INVALID_CONFIGURATION:"errors.system.INVALID_CONFIGURATION",UNKNOWN_OPERATION:"errors.system.UNKNOWN_OPERATION",TOO_MANY_REQUESTS:"errors.system.TOO_MANY_REQUESTS"},de=(S={})=>{let{showNotification:c}=$(),{showSuccessNotifications:N=!1,showErrorNotifications:m=!0,customErrorMessages:T={},defaultErrorMessage:I="Ha ocurrido un error inesperado",autoHideDuration:u=6e3,appStructure:p=[],translateFn:R=e=>e}=S,d=_(e=>{if(!e.success&&e.errors&&(Object.keys(e.errors).some(r=>r!=="_error"&&r!=="_graphql"&&r!=="_transaction")||e.errors._transaction?.includes("ONE_OR_MORE_OPERATIONS_FAILED")||e.errors._error?.includes("TOO_MANY_REQUESTS")))return!1;let i=e.data;return!(!e.success&&i?.response?.status==="TOO_MANY_REQUESTS")},[]),y=_((e,i)=>{let s=R(e);return s===e?i||R("error.unknown"):s},[R]),A=_(e=>["create","update","delete"].includes(e),[]),C=_((e,i)=>N?A(e)&&i?!0:p.some(s=>s.key===e):!1,[N,p,A]),E=_((e,i,s)=>{let r=s?.key&&typeof s.key=="string"?s.key:e,t=`action.onSuccess.${r}`,n=y(t);if(n!==R("error.unknown")){if(A(r)&&i){let a=`action.${i}Singular`,O=y(a);if(O!==R("error.unknown"))return R(t,{item:O});{let L=`action.onSuccess.${r}WithoutItem`,x=y(L);return x!==R("error.unknown")?x:n}}return n}return R("success.transaction")},[y,R,A]),l=_(e=>{if(e.errorCode&&T[e.errorCode])return T[e.errorCode];if(e.errorCode&&M[e.errorCode])return y(M[e.errorCode]);if(e.errorCode){let i=[`errors.auth.${e.errorCode}`,`errors.data.${e.errorCode}`,`errors.system.${e.errorCode}`,`errors.${e.errorCode}`];for(let s of i){let r=y(s);if(r!==R("error.unknown"))return r}}if(typeof e.data=="string"&&e.data.startsWith("errors.")){let i=y(e.data);if(i!==R("error.unknown"))return i}if(e.errors&&Object.keys(e.errors).length>0){let i=Object.keys(e.errors);if(i.length===1&&i[0]==="_transaction"){let s=e.errors._transaction;if(s?.includes("ONE_OR_MORE_OPERATIONS_FAILED"))return"";if(Array.isArray(s)&&s.length>0){let r=s[0];if(typeof r=="string"&&r!=="ONE_OR_MORE_OPERATIONS_FAILED")try{let t=JSON.parse(r);if(Array.isArray(t)&&t.length>0){let n=t[0];if(n?.response?.errorCode){let a=n.response.errorCode;if(M[a])return y(M[a]);let O=[`errors.auth.${a}`,`errors.data.${a}`,`errors.system.${a}`,`errors.${a}`];for(let L of O){let x=y(L);if(x!==y("error.unknown"))return x}}if(n?.response?.data)return n.response.data}if(t?.response?.message){let n=t.response.message.toLowerCase();return n.includes("expired")?y("resetPassword.linkExpired","El enlace ha expirado"):n.includes("invalid")?y("resetPassword.invalidCode","C\xF3digo inv\xE1lido"):t.response.message}}catch{return r.toLowerCase().includes("expired")?y("resetPassword.linkExpired","El enlace ha expirado"):r.toLowerCase().includes("invalid")?y("resetPassword.invalidCode","C\xF3digo inv\xE1lido"):r}}return y("error.transaction","Error en la operaci\xF3n")}if(i.length===1&&i[0]==="_error"){let s=e.errors._error;return Array.isArray(s)?s[0]:String(s)}return i.length===1&&i[0]==="_graphql"?y("errors.system.DATABASE_CONNECTION_ERROR"):`${y("errors.data.FIELD_ERROR")}: ${i.join(", ")}`}return I||R("error.unknown")},[T,I,R,y]),o=_(e=>e.errorCode&&Y[e.errorCode]?Y[e.errorCode]:"error",[]),g=_(async(e,i,s)=>{let r=await b.createItem(e,i,s);if(!r.success&&m&&d(r)){let t=l(r),n=o(r);c(t,n,{autoHideDuration:u})}else if(r.success){let t=s?.actionConfig,n=t?.key||"create",a=t?.moduleKey||e;if(C(n,a)){let O=E(n,a,t);c(O,"success",{autoHideDuration:u})}}return r},[m,C,c,l,o,E,u,d]),f=_(async(e,i,s)=>{let r=await b.updateItem(e,i,s),t=s?.skipNotifications===!0;if(!t&&!r.success&&m&&d(r)){let n=l(r),a=o(r);c(n,a,{autoHideDuration:u})}else if(!t&&r.success){let n=s?.actionConfig,a=n?.key||"update",O=n?.moduleKey||e;if(C(a,O)){let L=E(a,O,n);c(L,"success",{autoHideDuration:u})}}return r},[m,C,c,l,o,E,u,d]),F=_(async(e,i,s)=>{let r=await b.deleteItem(e,i,s);if(!r.success&&m&&d(r)){let t=l(r),n=o(r);c(t,n,{autoHideDuration:u})}else if(r.success){let t=s?.actionConfig,n=t?.key||"delete",a=t?.moduleKey||e;if(C(n,a)){let O=E(n,a,t);c(O,"success",{autoHideDuration:u})}}return r},[m,C,c,l,o,E,u,d]),P=_(async(e,i,s)=>{let r=await b.readItem(e,i,s);if(!r.success&&m&&d(r)){let t=l(r),n=o(r);c(t,n,{autoHideDuration:u})}return r},[m,c,l,o,u,d]),D=_(async(e,i,s)=>{let r=await b.readItems(e,i,s);if(!r.success&&m&&d(r)){let t=l(r),n=o(r);c(t,n,{autoHideDuration:u})}return r},[m,c,l,o,u,d]),q=_(async(e,i)=>{let s=await b.transaction(e,i),r=i?.skipNotifications===!0;if(!r&&!s.success&&m&&d(s)){let t=l(s),n=o(s);c(t,n,{autoHideDuration:u})}else if(!r&&s.success){let t="transaction",n,a=null;if(i?.actionConfig?(a=i.actionConfig,t=a.key,n=a.moduleKey):Array.isArray(e)&&e.length>0&&e[0].operation&&(t=e[0].operation,a=p.find(O=>O.key===t),a&&(n=a.moduleKey)),C(t,n)){let O=E(t,n,a);c(O,"success",{autoHideDuration:u})}}return s},[m,C,c,l,o,E,u,d,p]),h=_((e,i)=>{if(!e.success&&m&&d(e)){let s=l(e),r=o(e);c(s,r,{autoHideDuration:u})}else e.success&&N&&i&&c(i,"success",{autoHideDuration:u});return e},[m,N,c,l,o,u,d,R]);return{createItem:g,updateItem:f,deleteItem:F,readItem:P,readItems:D,transaction:q,handleResponse:h,getErrorMessage:l,getErrorSeverity:o,shouldShowNotification:d}};export{J as a,te as b,ae as c,de as d};
|
package/dist/components.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BoxScreenType, a as CrudiaAutoGenerate, i as CrudiaAutoGenerateProps, b as CrudiaFileField, j as CrudiaFileFieldProps, c as CrudiaMarkdownField, k as CrudiaMarkdownFieldProps, C as CrudifyLogin, d as CrudifyLoginConfig, e as CrudifyLoginProps, f as CrudifyLoginTranslations, L as LoginComponent, P as Policies, h as PolicyAction, S as SessionStatus, g as UserLoginData, U as UserProfileDisplay } from './CrudiaMarkdownField-
|
|
1
|
+
export { B as BoxScreenType, a as CrudiaAutoGenerate, i as CrudiaAutoGenerateProps, b as CrudiaFileField, j as CrudiaFileFieldProps, c as CrudiaMarkdownField, k as CrudiaMarkdownFieldProps, C as CrudifyLogin, d as CrudifyLoginConfig, e as CrudifyLoginProps, f as CrudifyLoginTranslations, L as LoginComponent, P as Policies, h as PolicyAction, S as SessionStatus, g as UserLoginData, U as UserProfileDisplay } from './CrudiaMarkdownField-D-VooBtq.mjs';
|
|
2
2
|
export { G as GlobalNotificationProvider, a as GlobalNotificationProviderProps, N as Notification, b as NotificationSeverity, u as useGlobalNotification } from './GlobalNotificationProvider-Zq18OkpI.mjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
package/dist/components.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BoxScreenType, a as CrudiaAutoGenerate, i as CrudiaAutoGenerateProps, b as CrudiaFileField, j as CrudiaFileFieldProps, c as CrudiaMarkdownField, k as CrudiaMarkdownFieldProps, C as CrudifyLogin, d as CrudifyLoginConfig, e as CrudifyLoginProps, f as CrudifyLoginTranslations, L as LoginComponent, P as Policies, h as PolicyAction, S as SessionStatus, g as UserLoginData, U as UserProfileDisplay } from './CrudiaMarkdownField-
|
|
1
|
+
export { B as BoxScreenType, a as CrudiaAutoGenerate, i as CrudiaAutoGenerateProps, b as CrudiaFileField, j as CrudiaFileFieldProps, c as CrudiaMarkdownField, k as CrudiaMarkdownFieldProps, C as CrudifyLogin, d as CrudifyLoginConfig, e as CrudifyLoginProps, f as CrudifyLoginTranslations, L as LoginComponent, P as Policies, h as PolicyAction, S as SessionStatus, g as UserLoginData, U as UserProfileDisplay } from './CrudiaMarkdownField-C30enyF9.js';
|
|
2
2
|
export { G as GlobalNotificationProvider, a as GlobalNotificationProviderProps, N as Notification, b as NotificationSeverity, u as useGlobalNotification } from './GlobalNotificationProvider-Zq18OkpI.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
package/dist/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHDNGW5H5js = require('./chunk-HDNGW5H5.js');var _chunkIYTXJHKOjs = require('./chunk-IYTXJHKO.js');require('./chunk-YIIUEOXC.js');require('./chunk-GNGIFVA4.js');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function z({showBelowMinutes:f=5,position:m="bottom-right",colorNormal:c="#ed6c02",colorCritical:x="#d32f2f",style:u,className:g}={}){let{isAuthenticated:o,tokens:t}=_chunkIYTXJHKOjs.f.call(void 0, ),[i,y]=_react.useState.call(void 0, 0),[h,C]=_react.useState.call(void 0, 100);if(_react.useEffect.call(void 0, ()=>{if(!o||!t)return;let v=setInterval(()=>{let P=Date.now(),p=t.expiresAt-P,w=900*1e3;y(Math.max(0,p)),C(Math.max(0,p/w*100))},1e3);return()=>clearInterval(v)},[o,t]),!o||i<=0)return null;let e=Math.floor(i/6e4),S=Math.floor(i%6e4/1e3);if(e>=f)return null;let s=e<2,a=s?x:c,b={"top-left":{top:"16px",left:"16px"},"top-right":{top:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"},"bottom-right":{bottom:"16px",right:"16px"}}[m];return _jsxruntime.jsxs.call(void 0, "div",{className:g,style:{position:"fixed",...b,padding:"12px 16px",backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",minWidth:"200px",zIndex:9999,fontFamily:"system-ui, -apple-system, sans-serif",...u},children:[_jsxruntime.jsxs.call(void 0, "div",{style:{marginBottom:"8px"},children:[_jsxruntime.jsx.call(void 0, "div",{style:{fontSize:"12px",fontWeight:600,color:a,marginBottom:"4px"},children:s?"\u26A0\uFE0F Sesi\xF3n expirando":"\u23F0 Sesi\xF3n por expirar"}),_jsxruntime.jsxs.call(void 0, "div",{style:{fontSize:"14px",color:"#333",fontWeight:500},children:[e,":",S.toString().padStart(2,"0")]})]}),_jsxruntime.jsx.call(void 0, "div",{style:{width:"100%",height:"6px",backgroundColor:"#e0e0e0",borderRadius:"3px",overflow:"hidden"},children:_jsxruntime.jsx.call(void 0, "div",{style:{width:`${h}%`,height:"100%",backgroundColor:a,transition:"width 1s linear"}})})]})}exports.CrudiaAutoGenerate = _chunkHDNGW5H5js.o; exports.CrudiaFileField = _chunkHDNGW5H5js.p; exports.CrudiaMarkdownField = _chunkHDNGW5H5js.q; exports.CrudifyLogin = _chunkHDNGW5H5js.h; exports.GlobalNotificationProvider = _chunkIYTXJHKOjs.g; exports.LoginComponent = _chunkHDNGW5H5js.m; exports.Policies = _chunkHDNGW5H5js.l; exports.SessionStatus = _chunkHDNGW5H5js.n; exports.SessionTimeIndicator = z; exports.UserProfileDisplay = _chunkHDNGW5H5js.i; exports.useGlobalNotification = _chunkIYTXJHKOjs.h;
|
package/dist/components.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as N,i as T,l as M,m as k,n as G,o as L,p as A,q as R}from"./chunk-
|
|
1
|
+
import{h as N,i as T,l as M,m as k,n as G,o as L,p as A,q as R}from"./chunk-NZIH26GS.mjs";import{f as d,g as F,h as I}from"./chunk-2G33BADS.mjs";import"./chunk-BJ6PIVZR.mjs";import"./chunk-GCH3QGKL.mjs";import{useEffect as B,useState as l}from"react";import{jsx as r,jsxs as n}from"react/jsx-runtime";function z({showBelowMinutes:f=5,position:m="bottom-right",colorNormal:c="#ed6c02",colorCritical:x="#d32f2f",style:u,className:g}={}){let{isAuthenticated:o,tokens:t}=d(),[i,y]=l(0),[h,C]=l(100);if(B(()=>{if(!o||!t)return;let v=setInterval(()=>{let P=Date.now(),p=t.expiresAt-P,w=900*1e3;y(Math.max(0,p)),C(Math.max(0,p/w*100))},1e3);return()=>clearInterval(v)},[o,t]),!o||i<=0)return null;let e=Math.floor(i/6e4),S=Math.floor(i%6e4/1e3);if(e>=f)return null;let s=e<2,a=s?x:c,b={"top-left":{top:"16px",left:"16px"},"top-right":{top:"16px",right:"16px"},"bottom-left":{bottom:"16px",left:"16px"},"bottom-right":{bottom:"16px",right:"16px"}}[m];return n("div",{className:g,style:{position:"fixed",...b,padding:"12px 16px",backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",minWidth:"200px",zIndex:9999,fontFamily:"system-ui, -apple-system, sans-serif",...u},children:[n("div",{style:{marginBottom:"8px"},children:[r("div",{style:{fontSize:"12px",fontWeight:600,color:a,marginBottom:"4px"},children:s?"\u26A0\uFE0F Sesi\xF3n expirando":"\u23F0 Sesi\xF3n por expirar"}),n("div",{style:{fontSize:"14px",color:"#333",fontWeight:500},children:[e,":",S.toString().padStart(2,"0")]})]}),r("div",{style:{width:"100%",height:"6px",backgroundColor:"#e0e0e0",borderRadius:"3px",overflow:"hidden"},children:r("div",{style:{width:`${h}%`,height:"100%",backgroundColor:a,transition:"width 1s linear"}})})]})}export{L as CrudiaAutoGenerate,A as CrudiaFileField,R as CrudiaMarkdownField,N as CrudifyLogin,F as GlobalNotificationProvider,k as LoginComponent,M as Policies,G as SessionStatus,z as SessionTimeIndicator,T as UserProfileDisplay,I as useGlobalNotification};
|
package/dist/hooks.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { F as FileItem,
|
|
1
|
+
export { F as FileItem, v as FileStatus, d as SessionState, n as UseAuthReturn, p as UseDataReturn, s as UseFileUploadOptions, t as UseFileUploadReturn, U as UseSessionOptions, k as UseUserDataOptions, j as UseUserDataReturn, l as UserData, m as useAuth, w as useCrudifyWithNotifications, o as useData, r as useFileUpload, u as useSession, i as useUserData, q as useUserProfile } from './index-DEnlzdtV.mjs';
|
|
2
2
|
export { A as AutoGenerateConfig, d as UseAutoGenerateOptions, U as UseAutoGenerateReturn, c as useAutoGenerate } from './GlobalNotificationProvider-Zq18OkpI.mjs';
|
|
3
|
-
import './api-
|
|
4
|
-
import '
|
|
3
|
+
import './api-RK-xY1Ah.mjs';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
5
|
import 'react';
|
|
6
|
+
import '@nocios/crudify-browser';
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { F as FileItem,
|
|
1
|
+
export { F as FileItem, v as FileStatus, d as SessionState, n as UseAuthReturn, p as UseDataReturn, s as UseFileUploadOptions, t as UseFileUploadReturn, U as UseSessionOptions, k as UseUserDataOptions, j as UseUserDataReturn, l as UserData, m as useAuth, w as useCrudifyWithNotifications, o as useData, r as useFileUpload, u as useSession, i as useUserData, q as useUserProfile } from './index-pQmuVg3q.js';
|
|
2
2
|
export { A as AutoGenerateConfig, d as UseAutoGenerateOptions, U as UseAutoGenerateReturn, c as useAutoGenerate } from './GlobalNotificationProvider-Zq18OkpI.js';
|
|
3
|
-
import './api-
|
|
4
|
-
import '
|
|
3
|
+
import './api-RK-xY1Ah.js';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
5
|
import 'react';
|
|
6
|
+
import '@nocios/crudify-browser';
|
package/dist/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAEHAZP5Fjs = require('./chunk-AEHAZP5F.js');var _chunkIYTXJHKOjs = require('./chunk-IYTXJHKO.js');require('./chunk-GNGIFVA4.js');exports.useAuth = _chunkAEHAZP5Fjs.b; exports.useAutoGenerate = _chunkIYTXJHKOjs.m; exports.useCrudifyWithNotifications = _chunkAEHAZP5Fjs.d; exports.useData = _chunkAEHAZP5Fjs.c; exports.useFileUpload = _chunkIYTXJHKOjs.p; exports.useSession = _chunkIYTXJHKOjs.f; exports.useUserData = _chunkAEHAZP5Fjs.a; exports.useUserProfile = _chunkIYTXJHKOjs.l;
|
package/dist/hooks.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,b as u,c as a,d as p}from"./chunk-
|
|
1
|
+
import{a as s,b as u,c as a,d as p}from"./chunk-ZKWTILQT.mjs";import{f as e,l as t,m as o,p as r}from"./chunk-2G33BADS.mjs";import"./chunk-GCH3QGKL.mjs";export{u as useAuth,o as useAutoGenerate,p as useCrudifyWithNotifications,a as useData,r as useFileUpload,e as useSession,s as useUserData,t as useUserProfile};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { U as UserProfile, C as CrudifyApiResponse } from './api-
|
|
1
|
+
import { U as UserProfile, d as CrudifyRequestOptions, C as CrudifyApiResponse, e as TransactionInput } from './api-RK-xY1Ah.mjs';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
2
4
|
import { b as NotificationSeverity } from './GlobalNotificationProvider-Zq18OkpI.mjs';
|
|
3
5
|
import { CrudifyResponse } from '@nocios/crudify-browser';
|
|
4
6
|
|
|
@@ -99,12 +101,22 @@ type SessionConfig = {
|
|
|
99
101
|
publicApiKey?: string;
|
|
100
102
|
env?: "dev" | "stg" | "api" | "prod";
|
|
101
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* Response data from a successful login
|
|
106
|
+
*/
|
|
107
|
+
interface LoginResponseData {
|
|
108
|
+
token: string;
|
|
109
|
+
refreshToken: string;
|
|
110
|
+
expiresAt: number;
|
|
111
|
+
refreshExpiresAt: number;
|
|
112
|
+
[key: string]: unknown;
|
|
113
|
+
}
|
|
102
114
|
type LoginResult = {
|
|
103
115
|
success: boolean;
|
|
104
116
|
tokens?: TokenData;
|
|
105
|
-
data?:
|
|
117
|
+
data?: LoginResponseData;
|
|
106
118
|
error?: string;
|
|
107
|
-
rawResponse?:
|
|
119
|
+
rawResponse?: Record<string, unknown>;
|
|
108
120
|
};
|
|
109
121
|
declare class SessionManager {
|
|
110
122
|
private static instance;
|
|
@@ -185,8 +197,9 @@ declare class SessionManager {
|
|
|
185
197
|
*/
|
|
186
198
|
private ensureCrudifyInitialized;
|
|
187
199
|
/**
|
|
188
|
-
|
|
189
|
-
|
|
200
|
+
* ✅ FASE 3.1: Detectar errores de autorización en todos los formatos posibles (mejorado)
|
|
201
|
+
* @param response - API response with dynamic structure that varies by error format
|
|
202
|
+
*/
|
|
190
203
|
private detectAuthorizationError;
|
|
191
204
|
/**
|
|
192
205
|
* ✅ FASE 2: Actualizar timestamp de última actividad del usuario
|
|
@@ -274,11 +287,72 @@ declare function useSession(options?: UseSessionOptions): {
|
|
|
274
287
|
error: string | null;
|
|
275
288
|
};
|
|
276
289
|
|
|
290
|
+
type SessionData = {
|
|
291
|
+
_id: string;
|
|
292
|
+
email: string;
|
|
293
|
+
subscriberKey: string;
|
|
294
|
+
[key: string]: unknown;
|
|
295
|
+
} | null;
|
|
296
|
+
type CrudifyConfig = {
|
|
297
|
+
publicApiKey?: string;
|
|
298
|
+
env?: "dev" | "stg" | "api" | "prod";
|
|
299
|
+
appName?: string;
|
|
300
|
+
loginActions?: string[];
|
|
301
|
+
logo?: string;
|
|
302
|
+
};
|
|
303
|
+
type SessionContextType = {
|
|
304
|
+
isAuthenticated: boolean;
|
|
305
|
+
isLoading: boolean;
|
|
306
|
+
isInitialized: boolean;
|
|
307
|
+
tokens: TokenData | null;
|
|
308
|
+
error: string | null;
|
|
309
|
+
sessionData: SessionData;
|
|
310
|
+
config: CrudifyConfig;
|
|
311
|
+
login: (email: string, password: string) => Promise<LoginResult>;
|
|
312
|
+
logout: () => Promise<void>;
|
|
313
|
+
refreshTokens: () => Promise<boolean>;
|
|
314
|
+
clearError: () => void;
|
|
315
|
+
getTokenInfo: () => ReturnType<typeof useSession>["getTokenInfo"] extends () => infer R ? R : unknown;
|
|
316
|
+
isExpiringSoon: boolean;
|
|
317
|
+
expiresIn: number;
|
|
318
|
+
refreshExpiresIn: number;
|
|
319
|
+
};
|
|
320
|
+
type NotificationOptions = {
|
|
321
|
+
enabled?: boolean;
|
|
322
|
+
maxNotifications?: number;
|
|
323
|
+
defaultAutoHideDuration?: number;
|
|
324
|
+
position?: {
|
|
325
|
+
vertical: "top" | "bottom";
|
|
326
|
+
horizontal: "left" | "center" | "right";
|
|
327
|
+
};
|
|
328
|
+
allowHtml?: boolean;
|
|
329
|
+
};
|
|
330
|
+
type SessionProviderProps = {
|
|
331
|
+
children: ReactNode;
|
|
332
|
+
options?: UseSessionOptions;
|
|
333
|
+
config?: CrudifyConfig;
|
|
334
|
+
showNotifications?: boolean;
|
|
335
|
+
notificationOptions?: NotificationOptions;
|
|
336
|
+
};
|
|
337
|
+
/**
|
|
338
|
+
* Main session provider to wrap the application.
|
|
339
|
+
* Auto-initializes internal CrudifyProvider if config.publicApiKey is provided.
|
|
340
|
+
*/
|
|
341
|
+
declare function SessionProvider(props: SessionProviderProps): react_jsx_runtime.JSX.Element;
|
|
342
|
+
/**
|
|
343
|
+
* Hook para usar el contexto de sesión
|
|
344
|
+
*/
|
|
345
|
+
declare function useSessionContext(): SessionContextType;
|
|
346
|
+
/**
|
|
347
|
+
* Componente para mostrar información de la sesión (debug)
|
|
348
|
+
*/
|
|
349
|
+
declare function SessionDebugInfo(): react_jsx_runtime.JSX.Element;
|
|
350
|
+
|
|
277
351
|
/**
|
|
278
352
|
* Complete user data structure (compatible con legacy)
|
|
279
353
|
*/
|
|
280
354
|
interface UserData {
|
|
281
|
-
session:
|
|
355
|
+
session: Record<string, unknown> | null;
|
|
282
356
|
data: UserProfile | null;
|
|
283
357
|
}
|
|
284
358
|
/**
|
|
@@ -322,16 +396,16 @@ interface UseAuthReturn {
|
|
|
322
396
|
loading: boolean;
|
|
323
397
|
error: string | null;
|
|
324
398
|
token: string | null;
|
|
325
|
-
user:
|
|
399
|
+
user: Record<string, unknown> | null;
|
|
326
400
|
tokenExpiration: Date | null;
|
|
327
401
|
setToken: (token: string | null) => void;
|
|
328
402
|
logout: () => Promise<void>;
|
|
329
403
|
refreshToken: () => Promise<boolean>;
|
|
330
|
-
login: (email: string, password: string) => Promise<
|
|
404
|
+
login: (email: string, password: string) => Promise<LoginResult>;
|
|
331
405
|
isExpiringSoon: boolean;
|
|
332
406
|
expiresIn: number;
|
|
333
407
|
refreshExpiresIn: number;
|
|
334
|
-
getTokenInfo: () =>
|
|
408
|
+
getTokenInfo: () => ReturnType<SessionContextType["getTokenInfo"]>;
|
|
335
409
|
clearError: () => void;
|
|
336
410
|
}
|
|
337
411
|
/**
|
|
@@ -377,12 +451,12 @@ declare const useAuth: () => UseAuthReturn;
|
|
|
377
451
|
* Return type compatible con useCrudifyData legacy
|
|
378
452
|
*/
|
|
379
453
|
interface UseDataReturn {
|
|
380
|
-
readItems: (moduleKey: string, filter?: object, options?:
|
|
381
|
-
readItem: (moduleKey: string, filter: object, options?:
|
|
382
|
-
createItem: (moduleKey: string, data: object, options?:
|
|
383
|
-
updateItem: (moduleKey: string, data: object, options?:
|
|
384
|
-
deleteItem: (moduleKey: string, id: string, options?:
|
|
385
|
-
transaction: (operations:
|
|
454
|
+
readItems: (moduleKey: string, filter?: object, options?: CrudifyRequestOptions) => Promise<CrudifyApiResponse>;
|
|
455
|
+
readItem: (moduleKey: string, filter: object, options?: CrudifyRequestOptions) => Promise<CrudifyApiResponse>;
|
|
456
|
+
createItem: (moduleKey: string, data: object, options?: CrudifyRequestOptions) => Promise<CrudifyApiResponse>;
|
|
457
|
+
updateItem: (moduleKey: string, data: object, options?: CrudifyRequestOptions) => Promise<CrudifyApiResponse>;
|
|
458
|
+
deleteItem: (moduleKey: string, id: string, options?: CrudifyRequestOptions) => Promise<CrudifyApiResponse>;
|
|
459
|
+
transaction: (operations: TransactionInput, options?: CrudifyRequestOptions) => Promise<CrudifyApiResponse>;
|
|
386
460
|
login: (email: string, password: string) => Promise<CrudifyApiResponse>;
|
|
387
461
|
isInitialized: boolean;
|
|
388
462
|
isInitializing: boolean;
|
|
@@ -638,4 +712,4 @@ declare const useCrudifyWithNotifications: (options?: CrudifyWithNotificationsOp
|
|
|
638
712
|
shouldShowNotification: (response: CrudifyResponse) => boolean;
|
|
639
713
|
};
|
|
640
714
|
|
|
641
|
-
export { type FileItem as F, type LoginResult as L, SessionManager as S,
|
|
715
|
+
export { type FileItem as F, type LoginResult as L, type NotificationOptions as N, SessionManager as S, TokenStorage as T, type UseSessionOptions as U, type SessionConfig as a, type TokenData as b, type StorageType as c, type SessionState as d, SessionProvider as e, useSessionContext as f, SessionDebugInfo as g, type SessionProviderProps as h, useUserData as i, type UseUserDataReturn as j, type UseUserDataOptions as k, type UserData as l, useAuth as m, type UseAuthReturn as n, useData as o, type UseDataReturn as p, useUserProfile as q, useFileUpload as r, type UseFileUploadOptions as s, type UseFileUploadReturn as t, useSession as u, type FileStatus as v, useCrudifyWithNotifications as w };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { U as UserProfile, C as CrudifyApiResponse } from './api-
|
|
1
|
+
import { U as UserProfile, d as CrudifyRequestOptions, C as CrudifyApiResponse, e as TransactionInput } from './api-RK-xY1Ah.js';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
2
4
|
import { b as NotificationSeverity } from './GlobalNotificationProvider-Zq18OkpI.js';
|
|
3
5
|
import { CrudifyResponse } from '@nocios/crudify-browser';
|
|
4
6
|
|
|
@@ -99,12 +101,22 @@ type SessionConfig = {
|
|
|
99
101
|
publicApiKey?: string;
|
|
100
102
|
env?: "dev" | "stg" | "api" | "prod";
|
|
101
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* Response data from a successful login
|
|
106
|
+
*/
|
|
107
|
+
interface LoginResponseData {
|
|
108
|
+
token: string;
|
|
109
|
+
refreshToken: string;
|
|
110
|
+
expiresAt: number;
|
|
111
|
+
refreshExpiresAt: number;
|
|
112
|
+
[key: string]: unknown;
|
|
113
|
+
}
|
|
102
114
|
type LoginResult = {
|
|
103
115
|
success: boolean;
|
|
104
116
|
tokens?: TokenData;
|
|
105
|
-
data?:
|
|
117
|
+
data?: LoginResponseData;
|
|
106
118
|
error?: string;
|
|
107
|
-
rawResponse?:
|
|
119
|
+
rawResponse?: Record<string, unknown>;
|
|
108
120
|
};
|
|
109
121
|
declare class SessionManager {
|
|
110
122
|
private static instance;
|
|
@@ -185,8 +197,9 @@ declare class SessionManager {
|
|
|
185
197
|
*/
|
|
186
198
|
private ensureCrudifyInitialized;
|
|
187
199
|
/**
|
|
188
|
-
|
|
189
|
-
|
|
200
|
+
* ✅ FASE 3.1: Detectar errores de autorización en todos los formatos posibles (mejorado)
|
|
201
|
+
* @param response - API response with dynamic structure that varies by error format
|
|
202
|
+
*/
|
|
190
203
|
private detectAuthorizationError;
|
|
191
204
|
/**
|
|
192
205
|
* ✅ FASE 2: Actualizar timestamp de última actividad del usuario
|
|
@@ -274,11 +287,72 @@ declare function useSession(options?: UseSessionOptions): {
|
|
|
274
287
|
error: string | null;
|
|
275
288
|
};
|
|
276
289
|
|
|
290
|
+
type SessionData = {
|
|
291
|
+
_id: string;
|
|
292
|
+
email: string;
|
|
293
|
+
subscriberKey: string;
|
|
294
|
+
[key: string]: unknown;
|
|
295
|
+
} | null;
|
|
296
|
+
type CrudifyConfig = {
|
|
297
|
+
publicApiKey?: string;
|
|
298
|
+
env?: "dev" | "stg" | "api" | "prod";
|
|
299
|
+
appName?: string;
|
|
300
|
+
loginActions?: string[];
|
|
301
|
+
logo?: string;
|
|
302
|
+
};
|
|
303
|
+
type SessionContextType = {
|
|
304
|
+
isAuthenticated: boolean;
|
|
305
|
+
isLoading: boolean;
|
|
306
|
+
isInitialized: boolean;
|
|
307
|
+
tokens: TokenData | null;
|
|
308
|
+
error: string | null;
|
|
309
|
+
sessionData: SessionData;
|
|
310
|
+
config: CrudifyConfig;
|
|
311
|
+
login: (email: string, password: string) => Promise<LoginResult>;
|
|
312
|
+
logout: () => Promise<void>;
|
|
313
|
+
refreshTokens: () => Promise<boolean>;
|
|
314
|
+
clearError: () => void;
|
|
315
|
+
getTokenInfo: () => ReturnType<typeof useSession>["getTokenInfo"] extends () => infer R ? R : unknown;
|
|
316
|
+
isExpiringSoon: boolean;
|
|
317
|
+
expiresIn: number;
|
|
318
|
+
refreshExpiresIn: number;
|
|
319
|
+
};
|
|
320
|
+
type NotificationOptions = {
|
|
321
|
+
enabled?: boolean;
|
|
322
|
+
maxNotifications?: number;
|
|
323
|
+
defaultAutoHideDuration?: number;
|
|
324
|
+
position?: {
|
|
325
|
+
vertical: "top" | "bottom";
|
|
326
|
+
horizontal: "left" | "center" | "right";
|
|
327
|
+
};
|
|
328
|
+
allowHtml?: boolean;
|
|
329
|
+
};
|
|
330
|
+
type SessionProviderProps = {
|
|
331
|
+
children: ReactNode;
|
|
332
|
+
options?: UseSessionOptions;
|
|
333
|
+
config?: CrudifyConfig;
|
|
334
|
+
showNotifications?: boolean;
|
|
335
|
+
notificationOptions?: NotificationOptions;
|
|
336
|
+
};
|
|
337
|
+
/**
|
|
338
|
+
* Main session provider to wrap the application.
|
|
339
|
+
* Auto-initializes internal CrudifyProvider if config.publicApiKey is provided.
|
|
340
|
+
*/
|
|
341
|
+
declare function SessionProvider(props: SessionProviderProps): react_jsx_runtime.JSX.Element;
|
|
342
|
+
/**
|
|
343
|
+
* Hook para usar el contexto de sesión
|
|
344
|
+
*/
|
|
345
|
+
declare function useSessionContext(): SessionContextType;
|
|
346
|
+
/**
|
|
347
|
+
* Componente para mostrar información de la sesión (debug)
|
|
348
|
+
*/
|
|
349
|
+
declare function SessionDebugInfo(): react_jsx_runtime.JSX.Element;
|
|
350
|
+
|
|
277
351
|
/**
|
|
278
352
|
* Complete user data structure (compatible con legacy)
|
|
279
353
|
*/
|
|
280
354
|
interface UserData {
|
|
281
|
-
session:
|
|
355
|
+
session: Record<string, unknown> | null;
|
|
282
356
|
data: UserProfile | null;
|
|
283
357
|
}
|
|
284
358
|
/**
|
|
@@ -322,16 +396,16 @@ interface UseAuthReturn {
|
|
|
322
396
|
loading: boolean;
|
|
323
397
|
error: string | null;
|
|
324
398
|
token: string | null;
|
|
325
|
-
user:
|
|
399
|
+
user: Record<string, unknown> | null;
|
|
326
400
|
tokenExpiration: Date | null;
|
|
327
401
|
setToken: (token: string | null) => void;
|
|
328
402
|
logout: () => Promise<void>;
|
|
329
403
|
refreshToken: () => Promise<boolean>;
|
|
330
|
-
login: (email: string, password: string) => Promise<
|
|
404
|
+
login: (email: string, password: string) => Promise<LoginResult>;
|
|
331
405
|
isExpiringSoon: boolean;
|
|
332
406
|
expiresIn: number;
|
|
333
407
|
refreshExpiresIn: number;
|
|
334
|
-
getTokenInfo: () =>
|
|
408
|
+
getTokenInfo: () => ReturnType<SessionContextType["getTokenInfo"]>;
|
|
335
409
|
clearError: () => void;
|
|
336
410
|
}
|
|
337
411
|
/**
|
|
@@ -377,12 +451,12 @@ declare const useAuth: () => UseAuthReturn;
|
|
|
377
451
|
* Return type compatible con useCrudifyData legacy
|
|
378
452
|
*/
|
|
379
453
|
interface UseDataReturn {
|
|
380
|
-
readItems: (moduleKey: string, filter?: object, options?:
|
|
381
|
-
readItem: (moduleKey: string, filter: object, options?:
|
|
382
|
-
createItem: (moduleKey: string, data: object, options?:
|
|
383
|
-
updateItem: (moduleKey: string, data: object, options?:
|
|
384
|
-
deleteItem: (moduleKey: string, id: string, options?:
|
|
385
|
-
transaction: (operations:
|
|
454
|
+
readItems: (moduleKey: string, filter?: object, options?: CrudifyRequestOptions) => Promise<CrudifyApiResponse>;
|
|
455
|
+
readItem: (moduleKey: string, filter: object, options?: CrudifyRequestOptions) => Promise<CrudifyApiResponse>;
|
|
456
|
+
createItem: (moduleKey: string, data: object, options?: CrudifyRequestOptions) => Promise<CrudifyApiResponse>;
|
|
457
|
+
updateItem: (moduleKey: string, data: object, options?: CrudifyRequestOptions) => Promise<CrudifyApiResponse>;
|
|
458
|
+
deleteItem: (moduleKey: string, id: string, options?: CrudifyRequestOptions) => Promise<CrudifyApiResponse>;
|
|
459
|
+
transaction: (operations: TransactionInput, options?: CrudifyRequestOptions) => Promise<CrudifyApiResponse>;
|
|
386
460
|
login: (email: string, password: string) => Promise<CrudifyApiResponse>;
|
|
387
461
|
isInitialized: boolean;
|
|
388
462
|
isInitializing: boolean;
|
|
@@ -638,4 +712,4 @@ declare const useCrudifyWithNotifications: (options?: CrudifyWithNotificationsOp
|
|
|
638
712
|
shouldShowNotification: (response: CrudifyResponse) => boolean;
|
|
639
713
|
};
|
|
640
714
|
|
|
641
|
-
export { type FileItem as F, type LoginResult as L, SessionManager as S,
|
|
715
|
+
export { type FileItem as F, type LoginResult as L, type NotificationOptions as N, SessionManager as S, TokenStorage as T, type UseSessionOptions as U, type SessionConfig as a, type TokenData as b, type StorageType as c, type SessionState as d, SessionProvider as e, useSessionContext as f, SessionDebugInfo as g, type SessionProviderProps as h, useUserData as i, type UseUserDataReturn as j, type UseUserDataOptions as k, type UserData as l, useAuth as m, type UseAuthReturn as n, useData as o, type UseDataReturn as p, useUserProfile as q, useFileUpload as r, type UseFileUploadOptions as s, type UseFileUploadReturn as t, useSession as u, type FileStatus as v, useCrudifyWithNotifications as w };
|