@nocios/crudify-components 2.0.44 → 2.0.61

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 (74) hide show
  1. package/.github/workflows/ci.yml +70 -0
  2. package/.husky/pre-commit +26 -0
  3. package/.husky/pre-push +30 -0
  4. package/.prettierignore +18 -0
  5. package/.prettierrc +9 -0
  6. package/README.md +44 -36
  7. package/README_DEPTH.md +148 -141
  8. package/coverage/coverage-final.json +83 -83
  9. package/coverage/index.html +175 -175
  10. package/coverage/lcov-report/base.css +224 -0
  11. package/coverage/lcov-report/block-navigation.js +87 -0
  12. package/coverage/lcov-report/favicon.png +0 -0
  13. package/coverage/lcov-report/index.html +686 -0
  14. package/coverage/lcov-report/prettify.css +1 -0
  15. package/coverage/lcov-report/prettify.js +2 -0
  16. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  17. package/coverage/lcov-report/sorter.js +210 -0
  18. package/coverage/lcov.info +22388 -0
  19. package/dist/{CrudiaMarkdownField-CXAuu-v2.d.ts → CrudiaMarkdownField-CkiBwG-U.d.ts} +8 -8
  20. package/dist/{CrudiaMarkdownField-TNyMLb-h.d.mts → CrudiaMarkdownField-D-DqiXMQ.d.mts} +8 -8
  21. package/dist/{GlobalNotificationProvider-Zq18OkpI.d.ts → GlobalNotificationProvider-CdwdNv_8.d.mts} +4 -4
  22. package/dist/{GlobalNotificationProvider-Zq18OkpI.d.mts → GlobalNotificationProvider-CdwdNv_8.d.ts} +4 -4
  23. package/dist/chunk-2WAUZ6KI.js +1 -0
  24. package/dist/chunk-3IGZNZCT.mjs +1 -0
  25. package/dist/chunk-43L2PP77.mjs +1 -0
  26. package/dist/chunk-6VS5OT3A.mjs +1 -0
  27. package/dist/chunk-BWJTTMKS.js +1 -0
  28. package/dist/chunk-EMPPCCVU.js +1 -0
  29. package/dist/chunk-J43UPGBE.js +1 -0
  30. package/dist/chunk-K6ZRXOJ7.mjs +1 -0
  31. package/dist/chunk-RYQQZTEP.js +1 -0
  32. package/dist/chunk-VTMSOK4V.mjs +1 -0
  33. package/dist/components.d.mts +3 -3
  34. package/dist/components.d.ts +3 -3
  35. package/dist/components.js +1 -1
  36. package/dist/components.mjs +1 -1
  37. package/dist/{errorTranslation-D-Y7uNN_.d.mts → errorTranslation-BcX8AaK7.d.mts} +5 -5
  38. package/dist/{errorTranslation-DDlAXpMl.d.ts → errorTranslation-CF-5JClP.d.ts} +5 -5
  39. package/dist/hooks.d.mts +3 -3
  40. package/dist/hooks.d.ts +3 -3
  41. package/dist/hooks.js +1 -1
  42. package/dist/hooks.mjs +1 -1
  43. package/dist/{index-U--xRr8A.d.mts → index-D06kTP0C.d.mts} +18 -18
  44. package/dist/{index-dXVRVcEB.d.ts → index-DEDnmsdO.d.ts} +18 -18
  45. package/dist/index.d.mts +361 -361
  46. package/dist/index.d.ts +361 -361
  47. package/dist/index.js +2 -2
  48. package/dist/index.mjs +2 -2
  49. package/dist/{tenantConfig-DqJqQkoR.d.mts → tenantConfig-CYnS9TPV.d.mts} +14 -8
  50. package/dist/{tenantConfig-DqJqQkoR.d.ts → tenantConfig-CYnS9TPV.d.ts} +14 -8
  51. package/dist/utils.d.mts +3 -3
  52. package/dist/utils.d.ts +3 -3
  53. package/dist/utils.js +1 -1
  54. package/dist/utils.mjs +1 -1
  55. package/eslint.config.mjs +140 -0
  56. package/package.json +34 -5
  57. package/scripts/bump-version.cjs +23 -0
  58. package/sonar-project.properties +23 -0
  59. package/tests/helpers/testUtils.tsx +89 -0
  60. package/tests/hooks/useSession/testUtils.tsx +212 -0
  61. package/tests/setup.ts +139 -0
  62. package/tests/vitest.d.ts +1 -0
  63. package/vitest.config.ts +20 -9
  64. package/.github/workflows/test.yml +0 -59
  65. package/dist/chunk-2IOB6HHT.js +0 -1
  66. package/dist/chunk-2WHCDP7V.mjs +0 -1
  67. package/dist/chunk-37WOWEJG.js +0 -1
  68. package/dist/chunk-44VU4TSP.mjs +0 -1
  69. package/dist/chunk-4LMFQECS.js +0 -1
  70. package/dist/chunk-BXFEQ6KP.js +0 -1
  71. package/dist/chunk-MFQKGZI4.js +0 -1
  72. package/dist/chunk-NJERBWND.mjs +0 -1
  73. package/dist/chunk-WMLIOPUC.mjs +0 -1
  74. package/dist/chunk-XMEZUDF6.mjs +0 -1
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk2IOB6HHTjs = require('./chunk-2IOB6HHT.js');var _chunk37WOWEJGjs = require('./chunk-37WOWEJG.js');var _chunkMFQKGZI4js = require('./chunk-MFQKGZI4.js');var _chunkBXFEQ6KPjs = require('./chunk-BXFEQ6KP.js');var _chunk4LMFQECSjs = require('./chunk-4LMFQECS.js');var _crudifysdk = require('@nocios/crudify-sdk'); _createStarExport(_crudifysdk);var _react = require('react');var _material = require('@mui/material');var _jsxruntime = require('react/jsx-runtime');var sr=(e={})=>{try{let r=_chunk4LMFQECSjs.b.call(void 0, );if(r.configSource!=="none"&&r.theme)return{...e,...r.theme}}catch(r){_chunk4LMFQECSjs.a.warn("Error reading theme from config",r instanceof Error?{errorMessage:r.message}:{message:String(r)})}return e};function ar({children:e,defaultTheme:r={},disableCssBaseline:t=!1}){let o=_react.useMemo.call(void 0, ()=>{let a=sr(r);return _material.createTheme.call(void 0, a)},[r]);return _jsxruntime.jsxs.call(void 0, _material.ThemeProvider,{theme:o,children:[!t&&_jsxruntime.jsx.call(void 0, _material.CssBaseline,{}),e]})}var _reactrouterdom = require('react-router-dom');var lr={border:"5px solid rgba(0, 0, 0, 0.1)",borderTopColor:"#3B82F6",borderRadius:"50%",width:"50px",height:"50px",animation:"spin 1s linear infinite"},cr=()=>_jsxruntime.jsx.call(void 0, "style",{children:`
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk2WAUZ6KIjs = require('./chunk-2WAUZ6KI.js');var _chunkEMPPCCVUjs = require('./chunk-EMPPCCVU.js');var _chunkRYQQZTEPjs = require('./chunk-RYQQZTEP.js');var _chunkJ43UPGBEjs = require('./chunk-J43UPGBE.js');var _chunkBWJTTMKSjs = require('./chunk-BWJTTMKS.js');var _crudifysdk = require('@nocios/crudify-sdk'); _createStarExport(_crudifysdk);var _react = require('react');var _material = require('@mui/material');var _jsxruntime = require('react/jsx-runtime');var sr=(e={})=>{try{let r=_chunkBWJTTMKSjs.b.call(void 0, );if(r.configSource!=="none"&&r.theme)return{...e,...r.theme}}catch(r){_chunkBWJTTMKSjs.a.warn("Error reading theme from config",r instanceof Error?{errorMessage:r.message}:{message:String(r)})}return e};function ar({children:e,defaultTheme:r={},disableCssBaseline:t=!1}){let o=_react.useMemo.call(void 0, ()=>{let a=sr(r);return _material.createTheme.call(void 0, a)},[r]);return _jsxruntime.jsxs.call(void 0, _material.ThemeProvider,{theme:o,children:[!t&&_jsxruntime.jsx.call(void 0, _material.CssBaseline,{}),e]})}var _reactrouterdom = require('react-router-dom');var lr={border:"5px solid rgba(0, 0, 0, 0.1)",borderTopColor:"#3B82F6",borderRadius:"50%",width:"50px",height:"50px",animation:"spin 1s linear infinite"},cr=()=>_jsxruntime.jsx.call(void 0, "style",{children:`
2
2
  @keyframes spin {
3
3
  0% { transform: rotate(0deg); }
4
4
  100% { transform: rotate(360deg); }
5
5
  }
6
- `});function g({stage:e="loading",message:r}){let o=r||{initializing:"Initializing application...","validating-session":"Validating session...",loading:"Loading..."}[e];return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, cr,{}),_jsxruntime.jsxs.call(void 0, "div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100vw",backgroundColor:"#f0f2f5",fontFamily:'"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',color:"#333",textAlign:"center",boxSizing:"border-box",padding:"20px",background:"#fff"},children:[_jsxruntime.jsx.call(void 0, "div",{style:lr}),_jsxruntime.jsx.call(void 0, "p",{style:{fontSize:"1.25em",fontWeight:"500",marginTop:"24px",color:"#1f2937"},children:o})]})]})}function _({children:e,loadingComponent:r,loginPath:t="/login"}){let{isAuthenticated:o,isLoading:a,isLoggingOut:s,isInitialized:y,tokens:l,error:f}=_chunkMFQKGZI4js.l.call(void 0, ),u=_reactrouterdom.useLocation.call(void 0, );if(!y||a&&!s)return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:r||_jsxruntime.jsx.call(void 0, g,{stage:"validating-session"})});let c=o&&_optionalChain([l, 'optionalAccess', _2 => _2.accessToken])&&l.accessToken.length>0;if(f||!o||!c){if(s)return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:t,replace:!0});let C=u.pathname+u.search;if(u.pathname===t||u.pathname.startsWith(t))return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:t,replace:!0});let T=_chunk2IOB6HHTjs.h.call(void 0, C),k=encodeURIComponent(T);return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:`${t}?redirect=${k}`,replace:!0})}return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e})}var L="crudify_tokens",mr="crudify_enc_key";function B(){try{let e=localStorage.getItem(L);return e?e.startsWith("v2:")&&e.length>50:!1}catch (e2){return!1}}function W(){try{let e=localStorage.getItem(mr);return e!==null&&e.length>=32}catch (e3){return!1}}function U(){return B()&&W()}function H(){try{let e=localStorage.getItem(L);return e?!e.startsWith("v2:")||e.length<50:!1}catch (e4){return!1}}function gr(){try{H()&&localStorage.removeItem(L)}catch (e5){}}function Y({children:e,redirectTo:r="/",loadingComponent:t,initTimeout:o=3e3}){let{isAuthenticated:a,isInitialized:s}=_chunkMFQKGZI4js.l.call(void 0, ),y=_reactrouterdom.useLocation.call(void 0, ),[l]=_react.useState.call(void 0, ()=>U()),[f,u]=_react.useState.call(void 0, !1);if(_react.useEffect.call(void 0, ()=>{if(!s&&l){let c=setTimeout(()=>{u(!0)},o);return()=>clearTimeout(c)}},[s,l,o]),s&&a){let c=new URLSearchParams(y.search),C=_chunk2IOB6HHTjs.j.call(void 0, c,r);return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:C,replace:!0})}return s&&!a?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e}):l&&!f?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:t||_jsxruntime.jsx.call(void 0, g,{stage:"validating-session"})}):_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e})}function J({children:e,behavior:r="redirect-if-authenticated",redirectTo:t="/",loadingComponent:o}){let{isAuthenticated:a,isInitialized:s}=_chunkMFQKGZI4js.l.call(void 0, );return s?r==="allow-all"?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e}):a?_jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:t,replace:!0}):_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e}):_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:o||_jsxruntime.jsx.call(void 0, g,{stage:"validating-session"})})}var X=_react.createContext.call(void 0, void 0),hr= exports.CrudifyInitializer =({config:e,children:r,fallback:t=null,onInitialized:o,onError:a})=>{let[s,y]=_react.useState.call(void 0, !1),[l,f]=_react.useState.call(void 0, !1),[u,c]=_react.useState.call(void 0, null),C=_react.useRef.call(void 0, !1),T=_react.useRef.call(void 0, !1);_react.useEffect.call(void 0, ()=>{C.current||(_chunkMFQKGZI4js.q.registerHighPriorityInitializer(),C.current=!0),T.current||(T.current=!0,(async()=>{f(!0),c(null);try{let d=_chunk4LMFQECSjs.d.call(void 0, {publicApiKey:_optionalChain([e, 'optionalAccess', _3 => _3.publicApiKey]),env:_optionalChain([e, 'optionalAccess', _4 => _4.env]),enableDebug:_optionalChain([e, 'optionalAccess', _5 => _5.enableLogging])});if(!d.publicApiKey)throw new Error("Crudify configuration missing. Please provide publicApiKey via props or ensure cookies are set by Lambda.");let v=d.env||"prod";_chunk4LMFQECSjs.a.setEnvironment(v),await _chunkMFQKGZI4js.q.initialize({priority:"HIGH",publicApiKey:d.publicApiKey,env:d.env||"prod",enableLogging:_optionalChain([e, 'optionalAccess', _6 => _6.enableLogging]),requestedBy:"CrudifyInitializer"}),y(!0),f(!1),o&&o()}catch(d){let v=d instanceof Error?d:new Error(String(d));c(v),f(!1),a&&a(v)}})())},[_optionalChain([e, 'optionalAccess', _7 => _7.publicApiKey]),_optionalChain([e, 'optionalAccess', _8 => _8.env]),_optionalChain([e, 'optionalAccess', _9 => _9.enableLogging]),o,a]);let k={isInitialized:s,isInitializing:l,error:u};return l&&t?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:t}):(u&&_chunk4LMFQECSjs.a.error("[CrudifyInitializer] Initialization failed",u),_jsxruntime.jsx.call(void 0, X.Provider,{value:k,children:r}))},Tr= exports.useCrudifyInitializer =()=>{let e=_react.useContext.call(void 0, X);if(!e)throw new Error("useCrudifyInitializer must be used within CrudifyInitializer");return e};var _crudifyadminsdk = require('@nocios/crudify-admin-sdk'); var _crudifyadminsdk2 = _interopRequireDefault(_crudifyadminsdk);var Z=!1,I=null,h=null;async function Sr(){let r=await _chunkMFQKGZI4js.d.getInstance().getTokenInfo(),t=_optionalChain([r, 'optionalAccess', _10 => _10.apiEndpointAdmin]),o=_optionalChain([r, 'optionalAccess', _11 => _11.apiKeyEndpointAdmin]);return t&&o?{apiUrl:t,apiKey:o}:_chunkMFQKGZI4js.h.waitForCredentials()}async function Er(){if(!Z)return I||(I=(async()=>{try{let e=_chunkMFQKGZI4js.d.getInstance(),{apiUrl:r,apiKey:t}=await Sr();h=await _asyncOptionalChain([(await e.getTokenInfo()), 'optionalAccess', async _12 => _12.crudifyTokens, 'optionalAccess', async _13 => _13.accessToken])||null,_crudifyadminsdk2.default.init({url:r,apiKey:t,getAdditionalHeaders:()=>h?{Authorization:`Bearer ${h}`}:{}}),Z=!0}catch(e){throw I=null,_chunk4LMFQECSjs.a.error("[crudifyAdminWrapper] Initialization failed",e instanceof Error?e:{message:String(e)}),e}})(),I)}async function n(e){try{await Er();let r=_chunkMFQKGZI4js.d.getInstance();h=await _asyncOptionalChain([(await r.getTokenInfo()), 'optionalAccess', async _14 => _14.crudifyTokens, 'optionalAccess', async _15 => _15.accessToken])||null;let o=await e(),a=o.errors&&(typeof o.errors=="string"&&o.errors.includes("401")||Array.isArray(o.errors)&&o.errors.some(s=>typeof s=="string"&&s.includes("401")));return!o.success&&a?await r.refreshTokens()?(h=await _asyncOptionalChain([(await r.getTokenInfo()), 'optionalAccess', async _16 => _16.crudifyTokens, 'optionalAccess', async _17 => _17.accessToken])||null,await e()):(_chunk4LMFQECSjs.a.error("[crudifyAdmin] Token refresh failed"),typeof window<"u"&&(window.location.href="/login"),o):o}catch(r){return _chunk4LMFQECSjs.a.error("[crudifyAdmin] Operation error",r instanceof Error?r:{message:String(r)}),{success:!1,errors:r instanceof Error?r.message:"Unknown error"}}}var kr={listModules:()=>n(()=>_crudifyadminsdk2.default.listModules()),getModule:e=>n(()=>_crudifyadminsdk2.default.getModule(e)),createModule:e=>n(()=>_crudifyadminsdk2.default.createModule(e)),editModule:(e,r)=>n(()=>_crudifyadminsdk2.default.editModule(e,r)),deleteModule:e=>n(()=>_crudifyadminsdk2.default.deleteModule(e)),activateModule:e=>n(()=>_crudifyadminsdk2.default.activateModule(e)),deactivateModule:e=>n(()=>_crudifyadminsdk2.default.deactivateModule(e)),getModuleVersions:e=>n(()=>_crudifyadminsdk2.default.getModuleVersions(e)),listActions:e=>n(()=>_crudifyadminsdk2.default.listActions(e)),getAction:e=>n(()=>_crudifyadminsdk2.default.getAction(e)),createAction:e=>n(()=>_crudifyadminsdk2.default.createAction(e)),editAction:(e,r)=>n(()=>_crudifyadminsdk2.default.editAction(e,r)),deleteAction:e=>n(()=>_crudifyadminsdk2.default.deleteAction(e)),activateAction:e=>n(()=>_crudifyadminsdk2.default.activateAction(e)),deactivateAction:e=>n(()=>_crudifyadminsdk2.default.deactivateAction(e)),getActionVersions:e=>n(()=>_crudifyadminsdk2.default.getActionVersions(e)),getActionsByProfile:e=>n(()=>_crudifyadminsdk2.default.getActionsByProfile(e)),updateActionsProfiles:e=>n(()=>_crudifyadminsdk2.default.updateActionsProfiles(e)),calculatePermissions:e=>n(()=>_crudifyadminsdk2.default.calculatePermissions(e))};exports.AuthRoute = Y; exports.CRITICAL_TRANSLATIONS = _chunk2IOB6HHTjs.a; exports.CrossTabSyncManager = _chunkMFQKGZI4js.b; exports.CrudiaAutoGenerate = _chunk2IOB6HHTjs.v; exports.CrudiaFileField = _chunk2IOB6HHTjs.w; exports.CrudiaMarkdownField = _chunk2IOB6HHTjs.x; exports.CrudifyInitializationManager = _chunkMFQKGZI4js.p; exports.CrudifyInitializer = hr; exports.CrudifyInstance = _crudifysdk.CrudifyInstance; exports.CrudifyLogin = _chunk2IOB6HHTjs.o; exports.CrudifyProvider = _chunkMFQKGZI4js.i; exports.CrudifyThemeProvider = ar; exports.DEFAULT_PASSWORD_RULES = _chunk2IOB6HHTjs.n; exports.ERROR_CODES = _chunk4LMFQECSjs.u; exports.ERROR_SEVERITY_MAP = _chunk4LMFQECSjs.v; exports.GlobalNotificationProvider = _chunkMFQKGZI4js.f; exports.GuestRoute = J; exports.LoginComponent = _chunk2IOB6HHTjs.t; exports.POLICY_ACTIONS = _chunk2IOB6HHTjs.q; exports.PREFERRED_POLICY_ORDER = _chunk2IOB6HHTjs.r; exports.PasswordRequirements = _chunk2IOB6HHTjs.k; exports.Policies = _chunk2IOB6HHTjs.s; exports.ProtectedRoute = _; exports.SessionDebugInfo = _chunkMFQKGZI4js.m; exports.SessionLoadingScreen = g; exports.SessionManager = _chunkMFQKGZI4js.d; exports.SessionProvider = _chunkMFQKGZI4js.k; exports.SessionStatus = _chunk2IOB6HHTjs.u; exports.TokenStorage = _chunkMFQKGZI4js.a; exports.TranslationService = _chunk2IOB6HHTjs.d; exports.TranslationsProvider = _chunk2IOB6HHTjs.f; exports.UserProfileDisplay = _chunk2IOB6HHTjs.p; exports.allPasswordRulesPassed = _chunk2IOB6HHTjs.m; exports.clearCorruptedTokens = gr; exports.createErrorTranslator = _chunk4LMFQECSjs.p; exports.crossTabSync = _chunkMFQKGZI4js.c; exports.crudifyAdmin = kr; exports.crudifyInitManager = _chunkMFQKGZI4js.q; exports.decodeJwtSafely = _chunk4LMFQECSjs.r; exports.evaluatePasswordRules = _chunk2IOB6HHTjs.l; exports.extractSafeRedirectFromUrl = _chunk2IOB6HHTjs.j; exports.getCriticalLanguages = _chunk2IOB6HHTjs.b; exports.getCriticalTranslations = _chunk2IOB6HHTjs.c; exports.getCurrentUserEmail = _chunk4LMFQECSjs.s; exports.getErrorMessage = _chunk4LMFQECSjs.y; exports.handleCrudifyError = _chunk4LMFQECSjs.A; exports.hasCorruptedTokens = H; exports.hasEncryptionKeyHash = W; exports.hasStoredTokens = B; exports.isTokenExpired = _chunk4LMFQECSjs.t; exports.logger = _chunk4LMFQECSjs.a; exports.parseApiError = _chunk4LMFQECSjs.w; exports.parseJavaScriptError = _chunk4LMFQECSjs.z; exports.parseTransactionError = _chunk4LMFQECSjs.x; exports.resolveTenantConfig = _chunk4LMFQECSjs.b; exports.secureLocalStorage = _chunkBXFEQ6KPjs.b; exports.secureSessionStorage = _chunkBXFEQ6KPjs.a; exports.shouldWaitForInitialization = U; exports.translateError = _chunk4LMFQECSjs.o; exports.translateErrorCode = _chunk4LMFQECSjs.m; exports.translateErrorCodes = _chunk4LMFQECSjs.n; exports.translationService = _chunk2IOB6HHTjs.e; exports.useAuth = _chunk37WOWEJGjs.b; exports.useAutoGenerate = _chunkMFQKGZI4js.o; exports.useCrudify = _chunkMFQKGZI4js.j; exports.useCrudifyInitializer = Tr; exports.useCrudifyWithNotifications = _chunk37WOWEJGjs.d; exports.useData = _chunk37WOWEJGjs.c; exports.useFileUpload = _chunkMFQKGZI4js.r; exports.useGlobalNotification = _chunkMFQKGZI4js.g; exports.useSession = _chunkMFQKGZI4js.e; exports.useSessionContext = _chunkMFQKGZI4js.l; exports.useTenantConfig = _chunk4LMFQECSjs.c; exports.useTranslations = _chunk2IOB6HHTjs.g; exports.useUserData = _chunk37WOWEJGjs.a; exports.useUserProfile = _chunkMFQKGZI4js.n; exports.validateInternalRedirect = _chunk2IOB6HHTjs.h; exports.validateTrustedRedirect = _chunk2IOB6HHTjs.i;
6
+ `});function g({stage:e="loading",message:r}){let o=r||{initializing:"Initializing application...","validating-session":"Validating session...",loading:"Loading..."}[e];return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, cr,{}),_jsxruntime.jsxs.call(void 0, "div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100vw",backgroundColor:"#f0f2f5",fontFamily:'"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',color:"#333",textAlign:"center",boxSizing:"border-box",padding:"20px",background:"#fff"},children:[_jsxruntime.jsx.call(void 0, "div",{style:lr}),_jsxruntime.jsx.call(void 0, "p",{style:{fontSize:"1.25em",fontWeight:"500",marginTop:"24px",color:"#1f2937"},children:o})]})]})}function _({children:e,loadingComponent:r,loginPath:t="/login"}){let{isAuthenticated:o,isLoading:a,isLoggingOut:s,isInitialized:y,tokens:l,error:f}=_chunkRYQQZTEPjs.l.call(void 0, ),u=_reactrouterdom.useLocation.call(void 0, );if(!y||a&&!s)return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:r||_jsxruntime.jsx.call(void 0, g,{stage:"validating-session"})});let c=o&&_optionalChain([l, 'optionalAccess', _2 => _2.accessToken])&&l.accessToken.length>0;if(f||!o||!c){if(s)return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:t,replace:!0});let C=u.pathname+u.search;if(u.pathname===t||u.pathname.startsWith(t))return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:t,replace:!0});let T=_chunk2WAUZ6KIjs.h.call(void 0, C),k=encodeURIComponent(T);return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:`${t}?redirect=${k}`,replace:!0})}return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e})}var L="crudify_tokens",mr="crudify_enc_key";function B(){try{let e=localStorage.getItem(L);return e?e.startsWith("v2:")&&e.length>50:!1}catch (e2){return!1}}function W(){try{let e=localStorage.getItem(mr);return e!==null&&e.length>=32}catch (e3){return!1}}function U(){return B()&&W()}function H(){try{let e=localStorage.getItem(L);return e?!e.startsWith("v2:")||e.length<50:!1}catch (e4){return!1}}function gr(){try{H()&&localStorage.removeItem(L)}catch (e5){}}function Y({children:e,redirectTo:r="/",loadingComponent:t,initTimeout:o=3e3}){let{isAuthenticated:a,isInitialized:s}=_chunkRYQQZTEPjs.l.call(void 0, ),y=_reactrouterdom.useLocation.call(void 0, ),[l]=_react.useState.call(void 0, ()=>U()),[f,u]=_react.useState.call(void 0, !1);if(_react.useEffect.call(void 0, ()=>{if(!s&&l){let c=setTimeout(()=>{u(!0)},o);return()=>clearTimeout(c)}},[s,l,o]),s&&a){let c=new URLSearchParams(y.search),C=_chunk2WAUZ6KIjs.j.call(void 0, c,r);return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:C,replace:!0})}return s&&!a?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e}):l&&!f?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:t||_jsxruntime.jsx.call(void 0, g,{stage:"validating-session"})}):_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e})}function J({children:e,behavior:r="redirect-if-authenticated",redirectTo:t="/",loadingComponent:o}){let{isAuthenticated:a,isInitialized:s}=_chunkRYQQZTEPjs.l.call(void 0, );return s?r==="allow-all"?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e}):a?_jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:t,replace:!0}):_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e}):_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:o||_jsxruntime.jsx.call(void 0, g,{stage:"validating-session"})})}var X=_react.createContext.call(void 0, void 0),hr= exports.CrudifyInitializer =({config:e,children:r,fallback:t=null,onInitialized:o,onError:a})=>{let[s,y]=_react.useState.call(void 0, !1),[l,f]=_react.useState.call(void 0, !1),[u,c]=_react.useState.call(void 0, null),C=_react.useRef.call(void 0, !1),T=_react.useRef.call(void 0, !1);_react.useEffect.call(void 0, ()=>{C.current||(_chunkRYQQZTEPjs.q.registerHighPriorityInitializer(),C.current=!0),T.current||(T.current=!0,(async()=>{f(!0),c(null);try{let d=_chunkBWJTTMKSjs.d.call(void 0, {publicApiKey:_optionalChain([e, 'optionalAccess', _3 => _3.publicApiKey]),env:_optionalChain([e, 'optionalAccess', _4 => _4.env]),enableDebug:_optionalChain([e, 'optionalAccess', _5 => _5.enableLogging])});if(!d.publicApiKey)throw new Error("Crudify configuration missing. Please provide publicApiKey via props or ensure cookies are set by Lambda.");let v=d.env||"prod";_chunkBWJTTMKSjs.a.setEnvironment(v),await _chunkRYQQZTEPjs.q.initialize({priority:"HIGH",publicApiKey:d.publicApiKey,env:d.env||"prod",enableLogging:_optionalChain([e, 'optionalAccess', _6 => _6.enableLogging]),requestedBy:"CrudifyInitializer"}),y(!0),f(!1),o&&o()}catch(d){let v=d instanceof Error?d:new Error(String(d));c(v),f(!1),a&&a(v)}})())},[_optionalChain([e, 'optionalAccess', _7 => _7.publicApiKey]),_optionalChain([e, 'optionalAccess', _8 => _8.env]),_optionalChain([e, 'optionalAccess', _9 => _9.enableLogging]),o,a]);let k={isInitialized:s,isInitializing:l,error:u};return l&&t?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:t}):(u&&_chunkBWJTTMKSjs.a.error("[CrudifyInitializer] Initialization failed",u),_jsxruntime.jsx.call(void 0, X.Provider,{value:k,children:r}))},Tr= exports.useCrudifyInitializer =()=>{let e=_react.useContext.call(void 0, X);if(!e)throw new Error("useCrudifyInitializer must be used within CrudifyInitializer");return e};var _crudifyadminsdk = require('@nocios/crudify-admin-sdk');var Z=!1,I=null,h=null;async function Sr(){let r=await _chunkRYQQZTEPjs.d.getInstance().getTokenInfo(),t=_optionalChain([r, 'optionalAccess', _10 => _10.apiEndpointAdmin]),o=_optionalChain([r, 'optionalAccess', _11 => _11.apiKeyEndpointAdmin]);return t&&o?{apiUrl:t,apiKey:o}:_chunkRYQQZTEPjs.h.waitForCredentials()}async function Er(){if(!Z)return I||(I=(async()=>{try{let e=_chunkRYQQZTEPjs.d.getInstance(),{apiUrl:r,apiKey:t}=await Sr();h=await _asyncOptionalChain([(await e.getTokenInfo()), 'optionalAccess', async _12 => _12.crudifyTokens, 'optionalAccess', async _13 => _13.accessToken])||null,_crudifyadminsdk.CrudifyAdminInstance.init({url:r,apiKey:t,getAdditionalHeaders:()=>h?{Authorization:`Bearer ${h}`}:{}}),Z=!0}catch(e){throw I=null,_chunkBWJTTMKSjs.a.error("[crudifyAdminWrapper] Initialization failed",e instanceof Error?e:{message:String(e)}),e}})(),I)}async function n(e){try{await Er();let r=_chunkRYQQZTEPjs.d.getInstance();h=await _asyncOptionalChain([(await r.getTokenInfo()), 'optionalAccess', async _14 => _14.crudifyTokens, 'optionalAccess', async _15 => _15.accessToken])||null;let o=await e(),a=o.errors&&(typeof o.errors=="string"&&o.errors.includes("401")||Array.isArray(o.errors)&&o.errors.some(s=>typeof s=="string"&&s.includes("401")));return!o.success&&a?await r.refreshTokens()?(h=await _asyncOptionalChain([(await r.getTokenInfo()), 'optionalAccess', async _16 => _16.crudifyTokens, 'optionalAccess', async _17 => _17.accessToken])||null,await e()):(_chunkBWJTTMKSjs.a.error("[crudifyAdmin] Token refresh failed"),globalThis.window!==void 0&&(globalThis.window.location.href="/login"),o):o}catch(r){return _chunkBWJTTMKSjs.a.error("[crudifyAdmin] Operation error",r instanceof Error?r:{message:String(r)}),{success:!1,errors:r instanceof Error?r.message:"Unknown error"}}}var kr={listModules:()=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.listModules()),getModule:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.getModule(e)),createModule:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.createModule(e)),editModule:(e,r)=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.editModule(e,r)),deleteModule:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.deleteModule(e)),activateModule:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.activateModule(e)),deactivateModule:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.deactivateModule(e)),getModuleVersions:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.getModuleVersions(e)),listActions:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.listActions(e)),getAction:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.getAction(e)),createAction:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.createAction(e)),editAction:(e,r)=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.editAction(e,r)),deleteAction:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.deleteAction(e)),activateAction:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.activateAction(e)),deactivateAction:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.deactivateAction(e)),getActionVersions:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.getActionVersions(e)),getActionsByProfile:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.getActionsByProfile(e)),updateActionsProfiles:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.updateActionsProfiles(e)),calculatePermissions:e=>n(()=>_crudifyadminsdk.CrudifyAdminInstance.calculatePermissions(e))};exports.AuthRoute = Y; exports.CRITICAL_TRANSLATIONS = _chunk2WAUZ6KIjs.a; exports.CrossTabSyncManager = _chunkRYQQZTEPjs.b; exports.CrudiaAutoGenerate = _chunk2WAUZ6KIjs.v; exports.CrudiaFileField = _chunk2WAUZ6KIjs.w; exports.CrudiaMarkdownField = _chunk2WAUZ6KIjs.x; exports.CrudifyInitializationManager = _chunkRYQQZTEPjs.p; exports.CrudifyInitializer = hr; exports.CrudifyInstance = _crudifysdk.CrudifyInstance; exports.CrudifyLogin = _chunk2WAUZ6KIjs.o; exports.CrudifyProvider = _chunkRYQQZTEPjs.i; exports.CrudifyThemeProvider = ar; exports.DEFAULT_PASSWORD_RULES = _chunk2WAUZ6KIjs.n; exports.ERROR_CODES = _chunkBWJTTMKSjs.u; exports.ERROR_SEVERITY_MAP = _chunkBWJTTMKSjs.v; exports.GlobalNotificationProvider = _chunkRYQQZTEPjs.f; exports.GuestRoute = J; exports.LoginComponent = _chunk2WAUZ6KIjs.t; exports.POLICY_ACTIONS = _chunk2WAUZ6KIjs.q; exports.PREFERRED_POLICY_ORDER = _chunk2WAUZ6KIjs.r; exports.PasswordRequirements = _chunk2WAUZ6KIjs.k; exports.Policies = _chunk2WAUZ6KIjs.s; exports.ProtectedRoute = _; exports.SessionDebugInfo = _chunkRYQQZTEPjs.m; exports.SessionLoadingScreen = g; exports.SessionManager = _chunkRYQQZTEPjs.d; exports.SessionProvider = _chunkRYQQZTEPjs.k; exports.SessionStatus = _chunk2WAUZ6KIjs.u; exports.TokenStorage = _chunkRYQQZTEPjs.a; exports.TranslationService = _chunk2WAUZ6KIjs.d; exports.TranslationsProvider = _chunk2WAUZ6KIjs.f; exports.UserProfileDisplay = _chunk2WAUZ6KIjs.p; exports.allPasswordRulesPassed = _chunk2WAUZ6KIjs.m; exports.clearCorruptedTokens = gr; exports.createErrorTranslator = _chunkBWJTTMKSjs.p; exports.crossTabSync = _chunkRYQQZTEPjs.c; exports.crudifyAdmin = kr; exports.crudifyInitManager = _chunkRYQQZTEPjs.q; exports.decodeJwtSafely = _chunkBWJTTMKSjs.r; exports.evaluatePasswordRules = _chunk2WAUZ6KIjs.l; exports.extractSafeRedirectFromUrl = _chunk2WAUZ6KIjs.j; exports.getCriticalLanguages = _chunk2WAUZ6KIjs.b; exports.getCriticalTranslations = _chunk2WAUZ6KIjs.c; exports.getCurrentUserEmail = _chunkBWJTTMKSjs.s; exports.getErrorMessage = _chunkBWJTTMKSjs.y; exports.handleCrudifyError = _chunkBWJTTMKSjs.A; exports.hasCorruptedTokens = H; exports.hasEncryptionKeyHash = W; exports.hasStoredTokens = B; exports.isTokenExpired = _chunkBWJTTMKSjs.t; exports.logger = _chunkBWJTTMKSjs.a; exports.parseApiError = _chunkBWJTTMKSjs.w; exports.parseJavaScriptError = _chunkBWJTTMKSjs.z; exports.parseTransactionError = _chunkBWJTTMKSjs.x; exports.resolveTenantConfig = _chunkBWJTTMKSjs.b; exports.secureLocalStorage = _chunkJ43UPGBEjs.b; exports.secureSessionStorage = _chunkJ43UPGBEjs.a; exports.shouldWaitForInitialization = U; exports.translateError = _chunkBWJTTMKSjs.o; exports.translateErrorCode = _chunkBWJTTMKSjs.m; exports.translateErrorCodes = _chunkBWJTTMKSjs.n; exports.translationService = _chunk2WAUZ6KIjs.e; exports.useAuth = _chunkEMPPCCVUjs.b; exports.useAutoGenerate = _chunkRYQQZTEPjs.o; exports.useCrudify = _chunkRYQQZTEPjs.j; exports.useCrudifyInitializer = Tr; exports.useCrudifyWithNotifications = _chunkEMPPCCVUjs.d; exports.useData = _chunkEMPPCCVUjs.c; exports.useFileUpload = _chunkRYQQZTEPjs.r; exports.useGlobalNotification = _chunkRYQQZTEPjs.g; exports.useSession = _chunkRYQQZTEPjs.e; exports.useSessionContext = _chunkRYQQZTEPjs.l; exports.useTenantConfig = _chunkBWJTTMKSjs.c; exports.useTranslations = _chunk2WAUZ6KIjs.g; exports.useUserData = _chunkEMPPCCVUjs.a; exports.useUserProfile = _chunkRYQQZTEPjs.n; exports.validateInternalRedirect = _chunk2WAUZ6KIjs.h; exports.validateTrustedRedirect = _chunk2WAUZ6KIjs.i;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import{a as j,b as ee,c as re,d as oe,e as te,f as ne,g as se,h as z,i as be,j as b,k as we,l as Le,m as Ue,n as Fe,o as Oe,p as Ge,q as De,r as Ke,s as Ve,t as _e,u as Be,v as He,w as Je,x as $e}from"./chunk-XMEZUDF6.mjs";import{a as Qe,b as Xe,c as Ze,d as rr}from"./chunk-NJERBWND.mjs";import{a as ae,b as de,c as fe,d as x,e as me,f as Re,g as xe,h as D,i as Pe,j as Ae,k as Ie,l as m,m as he,n as Ne,o as We,p as qe,q as S,r as Ye}from"./chunk-2WHCDP7V.mjs";import{a as je,b as er}from"./chunk-WMLIOPUC.mjs";import{A as ze,a as p,b as M,c as ie,d as G,m as ue,n as pe,o as le,p as ce,r as ge,s as ye,t as Ce,u as Te,v as ve,w as Se,x as Ee,y as ke,z as Me}from"./chunk-44VU4TSP.mjs";import{CrudifyInstance as vo}from"@nocios/crudify-sdk";export*from"@nocios/crudify-sdk";import{useMemo as or}from"react";import{ThemeProvider as tr,createTheme as ir,CssBaseline as nr}from"@mui/material";import{jsx as ur,jsxs as pr}from"react/jsx-runtime";var sr=(e={})=>{try{let r=M();if(r.configSource!=="none"&&r.theme)return{...e,...r.theme}}catch(r){p.warn("Error reading theme from config",r instanceof Error?{errorMessage:r.message}:{message:String(r)})}return e};function ar({children:e,defaultTheme:r={},disableCssBaseline:t=!1}){let o=or(()=>{let a=sr(r);return ir(a)},[r]);return pr(tr,{theme:o,children:[!t&&ur(nr,{}),e]})}import{Navigate as w,useLocation as fr}from"react-router-dom";import{Fragment as dr,jsx as E,jsxs as K}from"react/jsx-runtime";var lr={border:"5px solid rgba(0, 0, 0, 0.1)",borderTopColor:"#3B82F6",borderRadius:"50%",width:"50px",height:"50px",animation:"spin 1s linear infinite"},cr=()=>E("style",{children:`
1
+ import{a as j,b as ee,c as re,d as oe,e as te,f as ne,g as se,h as b,i as ze,j as z,k as we,l as Le,m as Ue,n as Fe,o as Oe,p as Ge,q as De,r as Ke,s as Ve,t as _e,u as Be,v as He,w as Je,x as $e}from"./chunk-3IGZNZCT.mjs";import{a as Qe,b as Xe,c as Ze,d as rr}from"./chunk-43L2PP77.mjs";import{a as ae,b as de,c as fe,d as x,e as me,f as Re,g as xe,h as D,i as Pe,j as Ae,k as Ie,l as m,m as he,n as Ne,o as We,p as qe,q as S,r as Ye}from"./chunk-K6ZRXOJ7.mjs";import{a as je,b as er}from"./chunk-6VS5OT3A.mjs";import{A as be,a as p,b as M,c as ie,d as G,m as ue,n as pe,o as le,p as ce,r as ge,s as ye,t as Ce,u as Te,v as ve,w as Se,x as Ee,y as ke,z as Me}from"./chunk-VTMSOK4V.mjs";import{CrudifyInstance as vo}from"@nocios/crudify-sdk";export*from"@nocios/crudify-sdk";import{useMemo as or}from"react";import{ThemeProvider as tr,createTheme as ir,CssBaseline as nr}from"@mui/material";import{jsx as ur,jsxs as pr}from"react/jsx-runtime";var sr=(e={})=>{try{let r=M();if(r.configSource!=="none"&&r.theme)return{...e,...r.theme}}catch(r){p.warn("Error reading theme from config",r instanceof Error?{errorMessage:r.message}:{message:String(r)})}return e};function ar({children:e,defaultTheme:r={},disableCssBaseline:t=!1}){let o=or(()=>{let a=sr(r);return ir(a)},[r]);return pr(tr,{theme:o,children:[!t&&ur(nr,{}),e]})}import{Navigate as w,useLocation as fr}from"react-router-dom";import{Fragment as dr,jsx as E,jsxs as K}from"react/jsx-runtime";var lr={border:"5px solid rgba(0, 0, 0, 0.1)",borderTopColor:"#3B82F6",borderRadius:"50%",width:"50px",height:"50px",animation:"spin 1s linear infinite"},cr=()=>E("style",{children:`
2
2
  @keyframes spin {
3
3
  0% { transform: rotate(0deg); }
4
4
  100% { transform: rotate(360deg); }
5
5
  }
6
- `});function g({stage:e="loading",message:r}){let o=r||{initializing:"Initializing application...","validating-session":"Validating session...",loading:"Loading..."}[e];return K(dr,{children:[E(cr,{}),K("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100vw",backgroundColor:"#f0f2f5",fontFamily:'"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',color:"#333",textAlign:"center",boxSizing:"border-box",padding:"20px",background:"#fff"},children:[E("div",{style:lr}),E("p",{style:{fontSize:"1.25em",fontWeight:"500",marginTop:"24px",color:"#1f2937"},children:o})]})]})}import{Fragment as V,jsx as R}from"react/jsx-runtime";function _({children:e,loadingComponent:r,loginPath:t="/login"}){let{isAuthenticated:o,isLoading:a,isLoggingOut:s,isInitialized:y,tokens:l,error:f}=m(),u=fr();if(!y||a&&!s)return R(V,{children:r||R(g,{stage:"validating-session"})});let c=o&&l?.accessToken&&l.accessToken.length>0;if(f||!o||!c){if(s)return R(w,{to:t,replace:!0});let C=u.pathname+u.search;if(u.pathname===t||u.pathname.startsWith(t))return R(w,{to:t,replace:!0});let T=z(C),k=encodeURIComponent(T);return R(w,{to:`${t}?redirect=${k}`,replace:!0})}return R(V,{children:e})}import{useState as q,useEffect as yr}from"react";import{Navigate as Cr,useLocation as Rr}from"react-router-dom";var L="crudify_tokens",mr="crudify_enc_key";function B(){try{let e=localStorage.getItem(L);return e?e.startsWith("v2:")&&e.length>50:!1}catch{return!1}}function W(){try{let e=localStorage.getItem(mr);return e!==null&&e.length>=32}catch{return!1}}function U(){return B()&&W()}function H(){try{let e=localStorage.getItem(L);return e?!e.startsWith("v2:")||e.length<50:!1}catch{return!1}}function gr(){try{H()&&localStorage.removeItem(L)}catch{}}import{Fragment as F,jsx as P}from"react/jsx-runtime";function Y({children:e,redirectTo:r="/",loadingComponent:t,initTimeout:o=3e3}){let{isAuthenticated:a,isInitialized:s}=m(),y=Rr(),[l]=q(()=>U()),[f,u]=q(!1);if(yr(()=>{if(!s&&l){let c=setTimeout(()=>{u(!0)},o);return()=>clearTimeout(c)}},[s,l,o]),s&&a){let c=new URLSearchParams(y.search),C=b(c,r);return P(Cr,{to:C,replace:!0})}return s&&!a?P(F,{children:e}):l&&!f?P(F,{children:t||P(g,{stage:"validating-session"})}):P(F,{children:e})}import{Navigate as xr}from"react-router-dom";import{Fragment as O,jsx as A}from"react/jsx-runtime";function J({children:e,behavior:r="redirect-if-authenticated",redirectTo:t="/",loadingComponent:o}){let{isAuthenticated:a,isInitialized:s}=m();return s?r==="allow-all"?A(O,{children:e}):a?A(xr,{to:t,replace:!0}):A(O,{children:e}):A(O,{children:o||A(g,{stage:"validating-session"})})}import{createContext as Pr,useContext as Ar,useEffect as Ir,useRef as $,useState as N}from"react";import{Fragment as vr,jsx as Q}from"react/jsx-runtime";var X=Pr(void 0),hr=({config:e,children:r,fallback:t=null,onInitialized:o,onError:a})=>{let[s,y]=N(!1),[l,f]=N(!1),[u,c]=N(null),C=$(!1),T=$(!1);Ir(()=>{C.current||(S.registerHighPriorityInitializer(),C.current=!0),T.current||(T.current=!0,(async()=>{f(!0),c(null);try{let d=G({publicApiKey:e?.publicApiKey,env:e?.env,enableDebug:e?.enableLogging});if(!d.publicApiKey)throw new Error("Crudify configuration missing. Please provide publicApiKey via props or ensure cookies are set by Lambda.");let v=d.env||"prod";p.setEnvironment(v),await S.initialize({priority:"HIGH",publicApiKey:d.publicApiKey,env:d.env||"prod",enableLogging:e?.enableLogging,requestedBy:"CrudifyInitializer"}),y(!0),f(!1),o&&o()}catch(d){let v=d instanceof Error?d:new Error(String(d));c(v),f(!1),a&&a(v)}})())},[e?.publicApiKey,e?.env,e?.enableLogging,o,a]);let k={isInitialized:s,isInitializing:l,error:u};return l&&t?Q(vr,{children:t}):(u&&p.error("[CrudifyInitializer] Initialization failed",u),Q(X.Provider,{value:k,children:r}))},Tr=()=>{let e=Ar(X);if(!e)throw new Error("useCrudifyInitializer must be used within CrudifyInitializer");return e};import i from"@nocios/crudify-admin-sdk";var Z=!1,I=null,h=null;async function Sr(){let r=await x.getInstance().getTokenInfo(),t=r?.apiEndpointAdmin,o=r?.apiKeyEndpointAdmin;return t&&o?{apiUrl:t,apiKey:o}:D.waitForCredentials()}async function Er(){if(!Z)return I||(I=(async()=>{try{let e=x.getInstance(),{apiUrl:r,apiKey:t}=await Sr();h=(await e.getTokenInfo())?.crudifyTokens?.accessToken||null,i.init({url:r,apiKey:t,getAdditionalHeaders:()=>h?{Authorization:`Bearer ${h}`}:{}}),Z=!0}catch(e){throw I=null,p.error("[crudifyAdminWrapper] Initialization failed",e instanceof Error?e:{message:String(e)}),e}})(),I)}async function n(e){try{await Er();let r=x.getInstance();h=(await r.getTokenInfo())?.crudifyTokens?.accessToken||null;let o=await e(),a=o.errors&&(typeof o.errors=="string"&&o.errors.includes("401")||Array.isArray(o.errors)&&o.errors.some(s=>typeof s=="string"&&s.includes("401")));return!o.success&&a?await r.refreshTokens()?(h=(await r.getTokenInfo())?.crudifyTokens?.accessToken||null,await e()):(p.error("[crudifyAdmin] Token refresh failed"),typeof window<"u"&&(window.location.href="/login"),o):o}catch(r){return p.error("[crudifyAdmin] Operation error",r instanceof Error?r:{message:String(r)}),{success:!1,errors:r instanceof Error?r.message:"Unknown error"}}}var kr={listModules:()=>n(()=>i.listModules()),getModule:e=>n(()=>i.getModule(e)),createModule:e=>n(()=>i.createModule(e)),editModule:(e,r)=>n(()=>i.editModule(e,r)),deleteModule:e=>n(()=>i.deleteModule(e)),activateModule:e=>n(()=>i.activateModule(e)),deactivateModule:e=>n(()=>i.deactivateModule(e)),getModuleVersions:e=>n(()=>i.getModuleVersions(e)),listActions:e=>n(()=>i.listActions(e)),getAction:e=>n(()=>i.getAction(e)),createAction:e=>n(()=>i.createAction(e)),editAction:(e,r)=>n(()=>i.editAction(e,r)),deleteAction:e=>n(()=>i.deleteAction(e)),activateAction:e=>n(()=>i.activateAction(e)),deactivateAction:e=>n(()=>i.deactivateAction(e)),getActionVersions:e=>n(()=>i.getActionVersions(e)),getActionsByProfile:e=>n(()=>i.getActionsByProfile(e)),updateActionsProfiles:e=>n(()=>i.updateActionsProfiles(e)),calculatePermissions:e=>n(()=>i.calculatePermissions(e))};export{Y as AuthRoute,j as CRITICAL_TRANSLATIONS,de as CrossTabSyncManager,He as CrudiaAutoGenerate,Je as CrudiaFileField,$e as CrudiaMarkdownField,qe as CrudifyInitializationManager,hr as CrudifyInitializer,vo as CrudifyInstance,Oe as CrudifyLogin,Pe as CrudifyProvider,ar as CrudifyThemeProvider,Fe as DEFAULT_PASSWORD_RULES,Te as ERROR_CODES,ve as ERROR_SEVERITY_MAP,Re as GlobalNotificationProvider,J as GuestRoute,_e as LoginComponent,De as POLICY_ACTIONS,Ke as PREFERRED_POLICY_ORDER,we as PasswordRequirements,Ve as Policies,_ as ProtectedRoute,he as SessionDebugInfo,g as SessionLoadingScreen,x as SessionManager,Ie as SessionProvider,Be as SessionStatus,ae as TokenStorage,oe as TranslationService,ne as TranslationsProvider,Ge as UserProfileDisplay,Ue as allPasswordRulesPassed,gr as clearCorruptedTokens,ce as createErrorTranslator,fe as crossTabSync,kr as crudifyAdmin,S as crudifyInitManager,ge as decodeJwtSafely,Le as evaluatePasswordRules,b as extractSafeRedirectFromUrl,ee as getCriticalLanguages,re as getCriticalTranslations,ye as getCurrentUserEmail,ke as getErrorMessage,ze as handleCrudifyError,H as hasCorruptedTokens,W as hasEncryptionKeyHash,B as hasStoredTokens,Ce as isTokenExpired,p as logger,Se as parseApiError,Me as parseJavaScriptError,Ee as parseTransactionError,M as resolveTenantConfig,er as secureLocalStorage,je as secureSessionStorage,U as shouldWaitForInitialization,le as translateError,ue as translateErrorCode,pe as translateErrorCodes,te as translationService,Xe as useAuth,We as useAutoGenerate,Ae as useCrudify,Tr as useCrudifyInitializer,rr as useCrudifyWithNotifications,Ze as useData,Ye as useFileUpload,xe as useGlobalNotification,me as useSession,m as useSessionContext,ie as useTenantConfig,se as useTranslations,Qe as useUserData,Ne as useUserProfile,z as validateInternalRedirect,be as validateTrustedRedirect};
6
+ `});function g({stage:e="loading",message:r}){let o=r||{initializing:"Initializing application...","validating-session":"Validating session...",loading:"Loading..."}[e];return K(dr,{children:[E(cr,{}),K("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100vw",backgroundColor:"#f0f2f5",fontFamily:'"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',color:"#333",textAlign:"center",boxSizing:"border-box",padding:"20px",background:"#fff"},children:[E("div",{style:lr}),E("p",{style:{fontSize:"1.25em",fontWeight:"500",marginTop:"24px",color:"#1f2937"},children:o})]})]})}import{Fragment as V,jsx as R}from"react/jsx-runtime";function _({children:e,loadingComponent:r,loginPath:t="/login"}){let{isAuthenticated:o,isLoading:a,isLoggingOut:s,isInitialized:y,tokens:l,error:f}=m(),u=fr();if(!y||a&&!s)return R(V,{children:r||R(g,{stage:"validating-session"})});let c=o&&l?.accessToken&&l.accessToken.length>0;if(f||!o||!c){if(s)return R(w,{to:t,replace:!0});let C=u.pathname+u.search;if(u.pathname===t||u.pathname.startsWith(t))return R(w,{to:t,replace:!0});let T=b(C),k=encodeURIComponent(T);return R(w,{to:`${t}?redirect=${k}`,replace:!0})}return R(V,{children:e})}import{useState as q,useEffect as yr}from"react";import{Navigate as Cr,useLocation as Rr}from"react-router-dom";var L="crudify_tokens",mr="crudify_enc_key";function B(){try{let e=localStorage.getItem(L);return e?e.startsWith("v2:")&&e.length>50:!1}catch{return!1}}function W(){try{let e=localStorage.getItem(mr);return e!==null&&e.length>=32}catch{return!1}}function U(){return B()&&W()}function H(){try{let e=localStorage.getItem(L);return e?!e.startsWith("v2:")||e.length<50:!1}catch{return!1}}function gr(){try{H()&&localStorage.removeItem(L)}catch{}}import{Fragment as F,jsx as P}from"react/jsx-runtime";function Y({children:e,redirectTo:r="/",loadingComponent:t,initTimeout:o=3e3}){let{isAuthenticated:a,isInitialized:s}=m(),y=Rr(),[l]=q(()=>U()),[f,u]=q(!1);if(yr(()=>{if(!s&&l){let c=setTimeout(()=>{u(!0)},o);return()=>clearTimeout(c)}},[s,l,o]),s&&a){let c=new URLSearchParams(y.search),C=z(c,r);return P(Cr,{to:C,replace:!0})}return s&&!a?P(F,{children:e}):l&&!f?P(F,{children:t||P(g,{stage:"validating-session"})}):P(F,{children:e})}import{Navigate as xr}from"react-router-dom";import{Fragment as O,jsx as A}from"react/jsx-runtime";function J({children:e,behavior:r="redirect-if-authenticated",redirectTo:t="/",loadingComponent:o}){let{isAuthenticated:a,isInitialized:s}=m();return s?r==="allow-all"?A(O,{children:e}):a?A(xr,{to:t,replace:!0}):A(O,{children:e}):A(O,{children:o||A(g,{stage:"validating-session"})})}import{createContext as Pr,useContext as Ar,useEffect as Ir,useRef as $,useState as N}from"react";import{Fragment as vr,jsx as Q}from"react/jsx-runtime";var X=Pr(void 0),hr=({config:e,children:r,fallback:t=null,onInitialized:o,onError:a})=>{let[s,y]=N(!1),[l,f]=N(!1),[u,c]=N(null),C=$(!1),T=$(!1);Ir(()=>{C.current||(S.registerHighPriorityInitializer(),C.current=!0),T.current||(T.current=!0,(async()=>{f(!0),c(null);try{let d=G({publicApiKey:e?.publicApiKey,env:e?.env,enableDebug:e?.enableLogging});if(!d.publicApiKey)throw new Error("Crudify configuration missing. Please provide publicApiKey via props or ensure cookies are set by Lambda.");let v=d.env||"prod";p.setEnvironment(v),await S.initialize({priority:"HIGH",publicApiKey:d.publicApiKey,env:d.env||"prod",enableLogging:e?.enableLogging,requestedBy:"CrudifyInitializer"}),y(!0),f(!1),o&&o()}catch(d){let v=d instanceof Error?d:new Error(String(d));c(v),f(!1),a&&a(v)}})())},[e?.publicApiKey,e?.env,e?.enableLogging,o,a]);let k={isInitialized:s,isInitializing:l,error:u};return l&&t?Q(vr,{children:t}):(u&&p.error("[CrudifyInitializer] Initialization failed",u),Q(X.Provider,{value:k,children:r}))},Tr=()=>{let e=Ar(X);if(!e)throw new Error("useCrudifyInitializer must be used within CrudifyInitializer");return e};import{CrudifyAdminInstance as i}from"@nocios/crudify-admin-sdk";var Z=!1,I=null,h=null;async function Sr(){let r=await x.getInstance().getTokenInfo(),t=r?.apiEndpointAdmin,o=r?.apiKeyEndpointAdmin;return t&&o?{apiUrl:t,apiKey:o}:D.waitForCredentials()}async function Er(){if(!Z)return I||(I=(async()=>{try{let e=x.getInstance(),{apiUrl:r,apiKey:t}=await Sr();h=(await e.getTokenInfo())?.crudifyTokens?.accessToken||null,i.init({url:r,apiKey:t,getAdditionalHeaders:()=>h?{Authorization:`Bearer ${h}`}:{}}),Z=!0}catch(e){throw I=null,p.error("[crudifyAdminWrapper] Initialization failed",e instanceof Error?e:{message:String(e)}),e}})(),I)}async function n(e){try{await Er();let r=x.getInstance();h=(await r.getTokenInfo())?.crudifyTokens?.accessToken||null;let o=await e(),a=o.errors&&(typeof o.errors=="string"&&o.errors.includes("401")||Array.isArray(o.errors)&&o.errors.some(s=>typeof s=="string"&&s.includes("401")));return!o.success&&a?await r.refreshTokens()?(h=(await r.getTokenInfo())?.crudifyTokens?.accessToken||null,await e()):(p.error("[crudifyAdmin] Token refresh failed"),globalThis.window!==void 0&&(globalThis.window.location.href="/login"),o):o}catch(r){return p.error("[crudifyAdmin] Operation error",r instanceof Error?r:{message:String(r)}),{success:!1,errors:r instanceof Error?r.message:"Unknown error"}}}var kr={listModules:()=>n(()=>i.listModules()),getModule:e=>n(()=>i.getModule(e)),createModule:e=>n(()=>i.createModule(e)),editModule:(e,r)=>n(()=>i.editModule(e,r)),deleteModule:e=>n(()=>i.deleteModule(e)),activateModule:e=>n(()=>i.activateModule(e)),deactivateModule:e=>n(()=>i.deactivateModule(e)),getModuleVersions:e=>n(()=>i.getModuleVersions(e)),listActions:e=>n(()=>i.listActions(e)),getAction:e=>n(()=>i.getAction(e)),createAction:e=>n(()=>i.createAction(e)),editAction:(e,r)=>n(()=>i.editAction(e,r)),deleteAction:e=>n(()=>i.deleteAction(e)),activateAction:e=>n(()=>i.activateAction(e)),deactivateAction:e=>n(()=>i.deactivateAction(e)),getActionVersions:e=>n(()=>i.getActionVersions(e)),getActionsByProfile:e=>n(()=>i.getActionsByProfile(e)),updateActionsProfiles:e=>n(()=>i.updateActionsProfiles(e)),calculatePermissions:e=>n(()=>i.calculatePermissions(e))};export{Y as AuthRoute,j as CRITICAL_TRANSLATIONS,de as CrossTabSyncManager,He as CrudiaAutoGenerate,Je as CrudiaFileField,$e as CrudiaMarkdownField,qe as CrudifyInitializationManager,hr as CrudifyInitializer,vo as CrudifyInstance,Oe as CrudifyLogin,Pe as CrudifyProvider,ar as CrudifyThemeProvider,Fe as DEFAULT_PASSWORD_RULES,Te as ERROR_CODES,ve as ERROR_SEVERITY_MAP,Re as GlobalNotificationProvider,J as GuestRoute,_e as LoginComponent,De as POLICY_ACTIONS,Ke as PREFERRED_POLICY_ORDER,we as PasswordRequirements,Ve as Policies,_ as ProtectedRoute,he as SessionDebugInfo,g as SessionLoadingScreen,x as SessionManager,Ie as SessionProvider,Be as SessionStatus,ae as TokenStorage,oe as TranslationService,ne as TranslationsProvider,Ge as UserProfileDisplay,Ue as allPasswordRulesPassed,gr as clearCorruptedTokens,ce as createErrorTranslator,fe as crossTabSync,kr as crudifyAdmin,S as crudifyInitManager,ge as decodeJwtSafely,Le as evaluatePasswordRules,z as extractSafeRedirectFromUrl,ee as getCriticalLanguages,re as getCriticalTranslations,ye as getCurrentUserEmail,ke as getErrorMessage,be as handleCrudifyError,H as hasCorruptedTokens,W as hasEncryptionKeyHash,B as hasStoredTokens,Ce as isTokenExpired,p as logger,Se as parseApiError,Me as parseJavaScriptError,Ee as parseTransactionError,M as resolveTenantConfig,er as secureLocalStorage,je as secureSessionStorage,U as shouldWaitForInitialization,le as translateError,ue as translateErrorCode,pe as translateErrorCodes,te as translationService,Xe as useAuth,We as useAutoGenerate,Ae as useCrudify,Tr as useCrudifyInitializer,rr as useCrudifyWithNotifications,Ze as useData,Ye as useFileUpload,xe as useGlobalNotification,me as useSession,m as useSessionContext,ie as useTenantConfig,se as useTranslations,Qe as useUserData,Ne as useUserProfile,b as validateInternalRedirect,ze as validateTrustedRedirect};
@@ -104,7 +104,7 @@ interface CrudifyRequestOptions {
104
104
  * Represents a single operation within a transaction.
105
105
  */
106
106
  interface TransactionOperation {
107
- operation: "create" | "update" | "delete" | string;
107
+ operation: 'create' | 'update' | 'delete' | string;
108
108
  moduleKey?: string;
109
109
  data?: Record<string, unknown>;
110
110
  _id?: string;
@@ -135,7 +135,7 @@ interface ResolvedConfig {
135
135
  loginActions?: string[];
136
136
  featureKeys?: string[];
137
137
  theme?: Record<string, unknown>;
138
- configSource: "props" | "cookies" | "none";
138
+ configSource: 'props' | 'cookies' | 'none';
139
139
  }
140
140
  interface ConfigResolverOptions {
141
141
  publicApiKey?: string;
@@ -195,7 +195,7 @@ declare function useResolvedConfig(options?: ConfigResolverOptions): ResolvedCon
195
195
  */
196
196
  interface TenantConfig {
197
197
  publicApiKey: string;
198
- environment: "dev" | "stg" | "api" | "prod";
198
+ environment: 'dev' | 'stg' | 'api' | 'prod';
199
199
  appName?: string;
200
200
  logo?: string;
201
201
  loginActions?: string[];
@@ -216,11 +216,17 @@ declare global {
216
216
 
217
217
  // i18next integration (optional, used when auto-syncing translations)
218
218
  i18next?: {
219
- addResourceBundle: (lang: string, ns: string, resources: Record<string, string>, deep?: boolean, overwrite?: boolean) => void;
219
+ addResourceBundle: (
220
+ lang: string,
221
+ ns: string,
222
+ resources: Record<string, string>,
223
+ deep?: boolean,
224
+ overwrite?: boolean
225
+ ) => void;
220
226
  language?: string;
221
227
  changeLanguage: (lang: string) => void;
222
228
  };
223
- i18n?: Window["i18next"];
229
+ i18n?: Window['i18next'];
224
230
  }
225
231
  }
226
232
 
@@ -240,7 +246,7 @@ declare global {
240
246
  * where cookies from Set-Cookie headers are not immediately available
241
247
  * to JavaScript on the first page load.
242
248
  */
243
- type CrudifyEnvironment = "dev" | "stg" | "api" | "prod";
249
+ type CrudifyEnvironment = 'dev' | 'stg' | 'api' | 'prod';
244
250
  interface ResolvedTenantConfig {
245
251
  publicApiKey?: string;
246
252
  environment?: CrudifyEnvironment;
@@ -250,7 +256,7 @@ interface ResolvedTenantConfig {
250
256
  featureKeys?: string[];
251
257
  theme?: Record<string, unknown>;
252
258
  enabledServices?: string[];
253
- configSource: "injected" | "props" | "none";
259
+ configSource: 'injected' | 'props' | 'none';
254
260
  }
255
261
  interface TenantConfigOptions {
256
262
  publicApiKey?: string;
@@ -309,4 +315,4 @@ declare function resolveTenantConfig(options?: TenantConfigOptions): ResolvedTen
309
315
  */
310
316
  declare function useTenantConfig(options?: TenantConfigOptions): ResolvedTenantConfig;
311
317
 
312
- export { type ApiError as A, type ConfigResolverOptions as C, type ForgotPasswordRequest as F, type JwtPayload as J, type LoginResponse as L, type ResolvedTenantConfig as R, type TenantConfig as T, type UserProfile as U, type ValidateCodeRequest as V, type TenantConfigOptions as a, resolveConfig as b, useResolvedConfig as c, type ResolvedConfig as d, type CrudifyEnvironment as e, type CrudifyApiResponse as f, type CrudifyTransactionResponse as g, type TransactionResponseData as h, type LoginRequest as i, type ResetPasswordRequest as j, type ValidationError as k, type CrudifyOperationOptions as l, type CrudifyRequestOptions as m, type TransactionOperation as n, type TransactionInput as o, resolveTenantConfig as r, useTenantConfig as u };
318
+ export { type ApiError as A, type ConfigResolverOptions as C, type ForgotPasswordRequest as F, type JwtPayload as J, type LoginRequest as L, type ResolvedConfig as R, type TenantConfig as T, type UserProfile as U, type ValidateCodeRequest as V, type CrudifyEnvironment as a, type ResolvedTenantConfig as b, type TenantConfigOptions as c, resolveTenantConfig as d, useTenantConfig as e, type CrudifyApiResponse as f, type CrudifyOperationOptions as g, type CrudifyRequestOptions as h, type CrudifyTransactionResponse as i, type LoginResponse as j, type ResetPasswordRequest as k, type TransactionInput as l, type TransactionOperation as m, type TransactionResponseData as n, type ValidationError as o, resolveConfig as r, useResolvedConfig as u };
@@ -104,7 +104,7 @@ interface CrudifyRequestOptions {
104
104
  * Represents a single operation within a transaction.
105
105
  */
106
106
  interface TransactionOperation {
107
- operation: "create" | "update" | "delete" | string;
107
+ operation: 'create' | 'update' | 'delete' | string;
108
108
  moduleKey?: string;
109
109
  data?: Record<string, unknown>;
110
110
  _id?: string;
@@ -135,7 +135,7 @@ interface ResolvedConfig {
135
135
  loginActions?: string[];
136
136
  featureKeys?: string[];
137
137
  theme?: Record<string, unknown>;
138
- configSource: "props" | "cookies" | "none";
138
+ configSource: 'props' | 'cookies' | 'none';
139
139
  }
140
140
  interface ConfigResolverOptions {
141
141
  publicApiKey?: string;
@@ -195,7 +195,7 @@ declare function useResolvedConfig(options?: ConfigResolverOptions): ResolvedCon
195
195
  */
196
196
  interface TenantConfig {
197
197
  publicApiKey: string;
198
- environment: "dev" | "stg" | "api" | "prod";
198
+ environment: 'dev' | 'stg' | 'api' | 'prod';
199
199
  appName?: string;
200
200
  logo?: string;
201
201
  loginActions?: string[];
@@ -216,11 +216,17 @@ declare global {
216
216
 
217
217
  // i18next integration (optional, used when auto-syncing translations)
218
218
  i18next?: {
219
- addResourceBundle: (lang: string, ns: string, resources: Record<string, string>, deep?: boolean, overwrite?: boolean) => void;
219
+ addResourceBundle: (
220
+ lang: string,
221
+ ns: string,
222
+ resources: Record<string, string>,
223
+ deep?: boolean,
224
+ overwrite?: boolean
225
+ ) => void;
220
226
  language?: string;
221
227
  changeLanguage: (lang: string) => void;
222
228
  };
223
- i18n?: Window["i18next"];
229
+ i18n?: Window['i18next'];
224
230
  }
225
231
  }
226
232
 
@@ -240,7 +246,7 @@ declare global {
240
246
  * where cookies from Set-Cookie headers are not immediately available
241
247
  * to JavaScript on the first page load.
242
248
  */
243
- type CrudifyEnvironment = "dev" | "stg" | "api" | "prod";
249
+ type CrudifyEnvironment = 'dev' | 'stg' | 'api' | 'prod';
244
250
  interface ResolvedTenantConfig {
245
251
  publicApiKey?: string;
246
252
  environment?: CrudifyEnvironment;
@@ -250,7 +256,7 @@ interface ResolvedTenantConfig {
250
256
  featureKeys?: string[];
251
257
  theme?: Record<string, unknown>;
252
258
  enabledServices?: string[];
253
- configSource: "injected" | "props" | "none";
259
+ configSource: 'injected' | 'props' | 'none';
254
260
  }
255
261
  interface TenantConfigOptions {
256
262
  publicApiKey?: string;
@@ -309,4 +315,4 @@ declare function resolveTenantConfig(options?: TenantConfigOptions): ResolvedTen
309
315
  */
310
316
  declare function useTenantConfig(options?: TenantConfigOptions): ResolvedTenantConfig;
311
317
 
312
- export { type ApiError as A, type ConfigResolverOptions as C, type ForgotPasswordRequest as F, type JwtPayload as J, type LoginResponse as L, type ResolvedTenantConfig as R, type TenantConfig as T, type UserProfile as U, type ValidateCodeRequest as V, type TenantConfigOptions as a, resolveConfig as b, useResolvedConfig as c, type ResolvedConfig as d, type CrudifyEnvironment as e, type CrudifyApiResponse as f, type CrudifyTransactionResponse as g, type TransactionResponseData as h, type LoginRequest as i, type ResetPasswordRequest as j, type ValidationError as k, type CrudifyOperationOptions as l, type CrudifyRequestOptions as m, type TransactionOperation as n, type TransactionInput as o, resolveTenantConfig as r, useTenantConfig as u };
318
+ export { type ApiError as A, type ConfigResolverOptions as C, type ForgotPasswordRequest as F, type JwtPayload as J, type LoginRequest as L, type ResolvedConfig as R, type TenantConfig as T, type UserProfile as U, type ValidateCodeRequest as V, type CrudifyEnvironment as a, type ResolvedTenantConfig as b, type TenantConfigOptions as c, resolveTenantConfig as d, useTenantConfig as e, type CrudifyApiResponse as f, type CrudifyOperationOptions as g, type CrudifyRequestOptions as h, type CrudifyTransactionResponse as i, type LoginResponse as j, type ResetPasswordRequest as k, type TransactionInput as l, type TransactionOperation as m, type TransactionResponseData as n, type ValidationError as o, resolveConfig as r, useResolvedConfig as u };
package/dist/utils.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- export { E as ERROR_CODES, f as ERROR_SEVERITY_MAP, m as ErrorCode, n as ErrorSeverity, o as ErrorTranslationConfig, P as ParsedError, l as createErrorTranslator, d as decodeJwtSafely, g as getCurrentUserEmail, e as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, c as parseJavaScriptError, b as parseTransactionError, a as secureLocalStorage, s as secureSessionStorage, k as translateError, t as translateErrorCode, j as translateErrorCodes } from './errorTranslation-D-Y7uNN_.mjs';
2
- export { C as ConfigResolverOptions, e as CrudifyEnvironment, d as ResolvedConfig, R as ResolvedTenantConfig, T as TenantConfig, a as TenantConfigOptions, b as resolveConfig, r as resolveTenantConfig, c as useResolvedConfig, u as useTenantConfig } from './tenantConfig-DqJqQkoR.mjs';
1
+ export { E as ERROR_CODES, a as ERROR_SEVERITY_MAP, b as ErrorCode, c as ErrorSeverity, d as ErrorTranslationConfig, P as ParsedError, e as createErrorTranslator, f as decodeJwtSafely, g as getCurrentUserEmail, h as getErrorMessage, i as handleCrudifyError, j as isTokenExpired, p as parseApiError, k as parseJavaScriptError, l as parseTransactionError, s as secureLocalStorage, m as secureSessionStorage, t as translateError, n as translateErrorCode, o as translateErrorCodes } from './errorTranslation-BcX8AaK7.mjs';
2
+ export { C as ConfigResolverOptions, a as CrudifyEnvironment, R as ResolvedConfig, b as ResolvedTenantConfig, T as TenantConfig, c as TenantConfigOptions, r as resolveConfig, d as resolveTenantConfig, u as useResolvedConfig, e as useTenantConfig } from './tenantConfig-CYnS9TPV.mjs';
3
3
 
4
4
  /**
5
5
  * Event Bus para coordinar acciones de autenticación
@@ -10,7 +10,7 @@ export { C as ConfigResolverOptions, e as CrudifyEnvironment, d as ResolvedConfi
10
10
  * - Suscribirse para recibir notificaciones de eventos
11
11
  * - Debounce automático para evitar múltiples disparos
12
12
  */
13
- type AuthEventType = "SESSION_EXPIRED" | "TOKEN_REFRESH_FAILED" | "UNAUTHORIZED" | "TOKEN_EXPIRED" | "LOGOUT";
13
+ type AuthEventType = 'SESSION_EXPIRED' | 'TOKEN_REFRESH_FAILED' | 'UNAUTHORIZED' | 'TOKEN_EXPIRED' | 'LOGOUT';
14
14
  type AuthEventDetails = {
15
15
  message?: string;
16
16
  error?: unknown;
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { E as ERROR_CODES, f as ERROR_SEVERITY_MAP, m as ErrorCode, n as ErrorSeverity, o as ErrorTranslationConfig, P as ParsedError, l as createErrorTranslator, d as decodeJwtSafely, g as getCurrentUserEmail, e as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, c as parseJavaScriptError, b as parseTransactionError, a as secureLocalStorage, s as secureSessionStorage, k as translateError, t as translateErrorCode, j as translateErrorCodes } from './errorTranslation-DDlAXpMl.js';
2
- export { C as ConfigResolverOptions, e as CrudifyEnvironment, d as ResolvedConfig, R as ResolvedTenantConfig, T as TenantConfig, a as TenantConfigOptions, b as resolveConfig, r as resolveTenantConfig, c as useResolvedConfig, u as useTenantConfig } from './tenantConfig-DqJqQkoR.js';
1
+ export { E as ERROR_CODES, a as ERROR_SEVERITY_MAP, b as ErrorCode, c as ErrorSeverity, d as ErrorTranslationConfig, P as ParsedError, e as createErrorTranslator, f as decodeJwtSafely, g as getCurrentUserEmail, h as getErrorMessage, i as handleCrudifyError, j as isTokenExpired, p as parseApiError, k as parseJavaScriptError, l as parseTransactionError, s as secureLocalStorage, m as secureSessionStorage, t as translateError, n as translateErrorCode, o as translateErrorCodes } from './errorTranslation-CF-5JClP.js';
2
+ export { C as ConfigResolverOptions, a as CrudifyEnvironment, R as ResolvedConfig, b as ResolvedTenantConfig, T as TenantConfig, c as TenantConfigOptions, r as resolveConfig, d as resolveTenantConfig, u as useResolvedConfig, e as useTenantConfig } from './tenantConfig-CYnS9TPV.js';
3
3
 
4
4
  /**
5
5
  * Event Bus para coordinar acciones de autenticación
@@ -10,7 +10,7 @@ export { C as ConfigResolverOptions, e as CrudifyEnvironment, d as ResolvedConfi
10
10
  * - Suscribirse para recibir notificaciones de eventos
11
11
  * - Debounce automático para evitar múltiples disparos
12
12
  */
13
- type AuthEventType = "SESSION_EXPIRED" | "TOKEN_REFRESH_FAILED" | "UNAUTHORIZED" | "TOKEN_EXPIRED" | "LOGOUT";
13
+ type AuthEventType = 'SESSION_EXPIRED' | 'TOKEN_REFRESH_FAILED' | 'UNAUTHORIZED' | 'TOKEN_EXPIRED' | 'LOGOUT';
14
14
  type AuthEventDetails = {
15
15
  message?: string;
16
16
  error?: unknown;
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBXFEQ6KPjs = require('./chunk-BXFEQ6KP.js');var _chunk4LMFQECSjs = require('./chunk-4LMFQECS.js');exports.ERROR_CODES = _chunk4LMFQECSjs.u; exports.ERROR_SEVERITY_MAP = _chunk4LMFQECSjs.v; exports.NavigationTracker = _chunk4LMFQECSjs.q; exports.authEventBus = _chunk4LMFQECSjs.f; exports.createErrorTranslator = _chunk4LMFQECSjs.p; exports.decodeJwtSafely = _chunk4LMFQECSjs.r; exports.getCurrentUserEmail = _chunk4LMFQECSjs.s; exports.getErrorMessage = _chunk4LMFQECSjs.y; exports.handleCrudifyError = _chunk4LMFQECSjs.A; exports.isTokenExpired = _chunk4LMFQECSjs.t; exports.parseApiError = _chunk4LMFQECSjs.w; exports.parseJavaScriptError = _chunk4LMFQECSjs.z; exports.parseTransactionError = _chunk4LMFQECSjs.x; exports.resolveConfig = _chunk4LMFQECSjs.d; exports.resolveTenantConfig = _chunk4LMFQECSjs.b; exports.secureLocalStorage = _chunkBXFEQ6KPjs.b; exports.secureSessionStorage = _chunkBXFEQ6KPjs.a; exports.translateError = _chunk4LMFQECSjs.o; exports.translateErrorCode = _chunk4LMFQECSjs.m; exports.translateErrorCodes = _chunk4LMFQECSjs.n; exports.useResolvedConfig = _chunk4LMFQECSjs.e; exports.useTenantConfig = _chunk4LMFQECSjs.c;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJ43UPGBEjs = require('./chunk-J43UPGBE.js');var _chunkBWJTTMKSjs = require('./chunk-BWJTTMKS.js');exports.ERROR_CODES = _chunkBWJTTMKSjs.u; exports.ERROR_SEVERITY_MAP = _chunkBWJTTMKSjs.v; exports.NavigationTracker = _chunkBWJTTMKSjs.q; exports.authEventBus = _chunkBWJTTMKSjs.f; exports.createErrorTranslator = _chunkBWJTTMKSjs.p; exports.decodeJwtSafely = _chunkBWJTTMKSjs.r; exports.getCurrentUserEmail = _chunkBWJTTMKSjs.s; exports.getErrorMessage = _chunkBWJTTMKSjs.y; exports.handleCrudifyError = _chunkBWJTTMKSjs.A; exports.isTokenExpired = _chunkBWJTTMKSjs.t; exports.parseApiError = _chunkBWJTTMKSjs.w; exports.parseJavaScriptError = _chunkBWJTTMKSjs.z; exports.parseTransactionError = _chunkBWJTTMKSjs.x; exports.resolveConfig = _chunkBWJTTMKSjs.d; exports.resolveTenantConfig = _chunkBWJTTMKSjs.b; exports.secureLocalStorage = _chunkJ43UPGBEjs.b; exports.secureSessionStorage = _chunkJ43UPGBEjs.a; exports.translateError = _chunkBWJTTMKSjs.o; exports.translateErrorCode = _chunkBWJTTMKSjs.m; exports.translateErrorCodes = _chunkBWJTTMKSjs.n; exports.useResolvedConfig = _chunkBWJTTMKSjs.e; exports.useTenantConfig = _chunkBWJTTMKSjs.c;
package/dist/utils.mjs CHANGED
@@ -1 +1 @@
1
- import{a as R,b as y}from"./chunk-WMLIOPUC.mjs";import{A as T,b as r,c as e,d as o,e as t,f as n,m as a,n as s,o as i,p as f,q as p,r as E,s as l,t as g,u as C,v,w as m,x as d,y as u,z as x}from"./chunk-44VU4TSP.mjs";export{C as ERROR_CODES,v as ERROR_SEVERITY_MAP,p as NavigationTracker,n as authEventBus,f as createErrorTranslator,E as decodeJwtSafely,l as getCurrentUserEmail,u as getErrorMessage,T as handleCrudifyError,g as isTokenExpired,m as parseApiError,x as parseJavaScriptError,d as parseTransactionError,o as resolveConfig,r as resolveTenantConfig,y as secureLocalStorage,R as secureSessionStorage,i as translateError,a as translateErrorCode,s as translateErrorCodes,t as useResolvedConfig,e as useTenantConfig};
1
+ import{a as R,b as y}from"./chunk-6VS5OT3A.mjs";import{A as T,b as r,c as e,d as o,e as t,f as n,m as a,n as s,o as i,p as f,q as p,r as E,s as l,t as g,u as C,v,w as m,x as d,y as u,z as x}from"./chunk-VTMSOK4V.mjs";export{C as ERROR_CODES,v as ERROR_SEVERITY_MAP,p as NavigationTracker,n as authEventBus,f as createErrorTranslator,E as decodeJwtSafely,l as getCurrentUserEmail,u as getErrorMessage,T as handleCrudifyError,g as isTokenExpired,m as parseApiError,x as parseJavaScriptError,d as parseTransactionError,o as resolveConfig,r as resolveTenantConfig,y as secureLocalStorage,R as secureSessionStorage,i as translateError,a as translateErrorCode,s as translateErrorCodes,t as useResolvedConfig,e as useTenantConfig};
@@ -0,0 +1,140 @@
1
+ import tseslint from '@typescript-eslint/eslint-plugin';
2
+ import tsparser from '@typescript-eslint/parser';
3
+ import react from 'eslint-plugin-react';
4
+ import reactHooks from 'eslint-plugin-react-hooks';
5
+
6
+ export default [
7
+ {
8
+ ignores: ['dist/**', 'node_modules/**', 'coverage/**'],
9
+ },
10
+ // Configuracion para archivos TypeScript (.ts)
11
+ {
12
+ files: ['src/**/*.ts'],
13
+ languageOptions: {
14
+ parser: tsparser,
15
+ parserOptions: {
16
+ ecmaVersion: 'latest',
17
+ sourceType: 'module',
18
+ },
19
+ },
20
+ plugins: {
21
+ '@typescript-eslint': tseslint,
22
+ },
23
+ rules: {
24
+ ...tseslint.configs.recommended.rules,
25
+ '@typescript-eslint/no-unused-vars': [
26
+ 'error',
27
+ { argsIgnorePattern: '^_', varsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' },
28
+ ],
29
+ '@typescript-eslint/no-explicit-any': 'warn',
30
+ '@typescript-eslint/explicit-function-return-type': 'off',
31
+ '@typescript-eslint/no-non-null-assertion': 'warn',
32
+ 'curly': ['error', 'all'],
33
+ 'brace-style': ['error', '1tbs', { allowSingleLine: false }],
34
+ 'no-console': 'warn',
35
+ 'no-restricted-syntax': [
36
+ 'error',
37
+ {
38
+ selector: 'ExportDefaultDeclaration',
39
+ message: 'Prefer named exports instead of default exports',
40
+ },
41
+ ],
42
+ },
43
+ },
44
+ // Configuracion para archivos React (.tsx)
45
+ {
46
+ files: ['src/**/*.tsx'],
47
+ languageOptions: {
48
+ parser: tsparser,
49
+ parserOptions: {
50
+ ecmaVersion: 'latest',
51
+ sourceType: 'module',
52
+ ecmaFeatures: {
53
+ jsx: true,
54
+ },
55
+ },
56
+ },
57
+ plugins: {
58
+ '@typescript-eslint': tseslint,
59
+ react: react,
60
+ 'react-hooks': reactHooks,
61
+ },
62
+ settings: {
63
+ react: {
64
+ version: 'detect',
65
+ },
66
+ },
67
+ rules: {
68
+ ...tseslint.configs.recommended.rules,
69
+ ...react.configs.recommended.rules,
70
+ ...reactHooks.configs.recommended.rules,
71
+ '@typescript-eslint/no-unused-vars': [
72
+ 'error',
73
+ { argsIgnorePattern: '^_', varsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' },
74
+ ],
75
+ '@typescript-eslint/no-explicit-any': 'warn',
76
+ '@typescript-eslint/explicit-function-return-type': 'off',
77
+ '@typescript-eslint/no-non-null-assertion': 'warn',
78
+ 'curly': ['error', 'all'],
79
+ 'brace-style': ['error', '1tbs', { allowSingleLine: false }],
80
+ 'no-console': 'warn',
81
+ // React 17+ no requiere importar React
82
+ 'react/react-in-jsx-scope': 'off',
83
+ // Props spreading es comun en componentes UI
84
+ 'react/jsx-props-no-spreading': 'off',
85
+ // Usamos TypeScript para validar props, no necesitamos prop-types
86
+ 'react/prop-types': 'off',
87
+ // Para componentes, permitir default exports (warn en lugar de error)
88
+ 'no-restricted-syntax': [
89
+ 'warn',
90
+ {
91
+ selector: 'ExportDefaultDeclaration',
92
+ message: 'Consider using named exports instead of default exports',
93
+ },
94
+ ],
95
+ },
96
+ },
97
+ // Configuracion mas permisiva para archivos de test
98
+ {
99
+ files: [
100
+ 'src/**/*.test.ts',
101
+ 'src/**/*.test.tsx',
102
+ 'src/**/*.spec.ts',
103
+ 'src/**/*.spec.tsx',
104
+ 'src/__tests__/**/*.ts',
105
+ 'src/__tests__/**/*.tsx',
106
+ ],
107
+ rules: {
108
+ '@typescript-eslint/no-unused-vars': 'warn',
109
+ '@typescript-eslint/no-explicit-any': 'off',
110
+ '@typescript-eslint/no-unsafe-function-type': 'off',
111
+ '@typescript-eslint/no-non-null-assertion': 'off',
112
+ '@typescript-eslint/ban-ts-comment': 'off',
113
+ 'no-console': 'off',
114
+ },
115
+ },
116
+ // Configuracion para hooks .ts (agregar react-hooks y permitir default exports con warning)
117
+ {
118
+ files: ['src/**/hooks/**/*.ts', 'src/hooks/**/*.ts'],
119
+ plugins: {
120
+ 'react-hooks': reactHooks,
121
+ },
122
+ rules: {
123
+ ...reactHooks.configs.recommended.rules,
124
+ 'no-restricted-syntax': [
125
+ 'warn',
126
+ {
127
+ selector: 'ExportDefaultDeclaration',
128
+ message: 'Consider using named exports instead of default exports',
129
+ },
130
+ ],
131
+ },
132
+ },
133
+ // Configuracion para archivos de declaracion (.d.ts) - permiten default exports para CSS modules
134
+ {
135
+ files: ['src/**/*.d.ts'],
136
+ rules: {
137
+ 'no-restricted-syntax': 'off',
138
+ },
139
+ },
140
+ ];
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@nocios/crudify-components",
3
- "version": "2.0.44",
3
+ "version": "2.0.61",
4
+ "packageManager": "pnpm@10.28.2",
4
5
  "engines": {
5
6
  "node": ">=24.12.0"
6
7
  },
@@ -35,15 +36,26 @@
35
36
  "scripts": {
36
37
  "build": "tsup",
37
38
  "build:analyze": "tsup --metafile",
39
+ "clean": "rm -rf dist",
40
+ "prebuild": "pnpm run clean",
38
41
  "start": "vite src/example",
39
- "test": "vitest --coverage",
42
+ "test": "vitest run --coverage",
43
+ "test:watch": "vitest",
40
44
  "test:ui": "vitest --ui",
41
- "prepublishOnly": "npm run build"
45
+ "test:coverage": "vitest run --coverage",
46
+ "lint": "eslint src/",
47
+ "lint:fix": "eslint src/ --fix",
48
+ "typecheck": "tsc --noEmit",
49
+ "validate": "pnpm run typecheck && pnpm run lint && pnpm run test",
50
+ "ci": "pnpm run validate",
51
+ "sonar": "pnpm test && npx sonarqube-scanner -Dsonar.host.url=http://localhost:9000",
52
+ "prepare": "husky",
53
+ "prepublishOnly": "pnpm run build"
42
54
  },
43
55
  "dependencies": {
44
56
  "@mdxeditor/editor": "^3.52.0",
45
- "@nocios/crudify-admin-sdk": "^1.0.0",
46
- "@nocios/crudify-sdk": "^1.0.2",
57
+ "@nocios/crudify-admin-sdk": "^1.0.6",
58
+ "@nocios/crudify-sdk": "^1.0.12",
47
59
  "dompurify": "^3.2.7",
48
60
  "uuid": "^13.0.0"
49
61
  },
@@ -71,11 +83,19 @@
71
83
  "@testing-library/user-event": "^14.5.1",
72
84
  "@types/react": "^19.0.3",
73
85
  "@types/react-dom": "^19.0.1",
86
+ "@typescript-eslint/eslint-plugin": "^8.54.0",
87
+ "@typescript-eslint/parser": "^8.54.0",
74
88
  "@vitest/coverage-v8": "^1.1.0",
75
89
  "@vitest/ui": "^1.1.0",
90
+ "eslint": "^9.39.2",
91
+ "eslint-plugin-react": "^7.37.5",
92
+ "eslint-plugin-react-hooks": "^7.0.1",
93
+ "husky": "^9.1.7",
76
94
  "i18next-browser-languagedetector": "^8.2.0",
77
95
  "i18next-http-backend": "^3.0.2",
78
96
  "jsdom": "^23.0.1",
97
+ "lint-staged": "^16.2.7",
98
+ "prettier": "^3.8.1",
79
99
  "react-i18next": "^16.0.0",
80
100
  "react-router-dom": "^7.9.3",
81
101
  "tsup": "^8.4.0",
@@ -84,5 +104,14 @@
84
104
  },
85
105
  "publishConfig": {
86
106
  "access": "public"
107
+ },
108
+ "lint-staged": {
109
+ "*.{js,jsx,ts,tsx}": [
110
+ "eslint --fix",
111
+ "prettier --write"
112
+ ],
113
+ "*.{json,css,scss,md}": [
114
+ "prettier --write"
115
+ ]
87
116
  }
88
117
  }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Auto-increment patch version in package.json
3
+ *
4
+ * This script increments the patch version (e.g., 2.0.44 -> 2.0.45)
5
+ * and writes it back to package.json
6
+ */
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+
10
+ const packagePath = path.join(__dirname, '../package.json');
11
+ const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
12
+
13
+ // Parse current version
14
+ const [major, minor, patch] = pkg.version.split('.').map(Number);
15
+
16
+ // Increment patch version
17
+ const newVersion = `${major}.${minor}.${patch + 1}`;
18
+
19
+ // Update package.json
20
+ pkg.version = newVersion;
21
+ fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2) + '\n');
22
+
23
+ console.log(`✓ Version bumped: ${major}.${minor}.${patch} → ${newVersion}`);
@@ -0,0 +1,23 @@
1
+ # Identificacion del proyecto
2
+ sonar.projectKey=nocios_crudify-components
3
+ sonar.projectName=crudify-components
4
+ sonar.projectVersion=2.0.44
5
+
6
+ # Configuracion de fuentes
7
+ sonar.sources=src
8
+ sonar.tests=tests
9
+ sonar.sourceEncoding=UTF-8
10
+
11
+ # Reporte de cobertura
12
+ sonar.typescript.lcov.reportPaths=coverage/lcov.info
13
+ sonar.javascript.lcov.reportPaths=coverage/lcov.info
14
+
15
+ # Exclusiones
16
+ sonar.exclusions=**/node_modules/**,**/dist/**,**/*.test.ts,**/*.spec.ts,**/*.test.tsx,**/*.spec.tsx,**/example/**
17
+ sonar.coverage.exclusions=**/index.ts,**/types.ts,**/types.d.ts,**/*.d.ts
18
+
19
+ # Inclusiones de tests
20
+ sonar.test.inclusions=tests/**/*.test.ts,tests/**/*.spec.ts,tests/**/*.test.tsx,tests/**/*.spec.tsx
21
+
22
+ # Quality Gate
23
+ sonar.qualitygate.wait=true