@nocios/crudify-components 2.0.1 → 2.0.6

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/index.d.mts CHANGED
@@ -9,7 +9,7 @@ export { F as FileItem, v as FileStatus, L as LoginResult, N as NotificationOpti
9
9
  import * as react_jsx_runtime from 'react/jsx-runtime';
10
10
  import { ThemeOptions } from '@mui/material';
11
11
  export { A as AutoGenerateConfig, G as GlobalNotificationProvider, a as GlobalNotificationProviderProps, N as Notification, b as NotificationSeverity, d as UseAutoGenerateOptions, U as UseAutoGenerateReturn, c as useAutoGenerate, u as useGlobalNotification } from './GlobalNotificationProvider-Zq18OkpI.mjs';
12
- export { E as ERROR_CODES, j as ERROR_SEVERITY_MAP, n as ErrorCode, o as ErrorSeverity, q as ErrorTranslationConfig, P as ParsedError, m as createErrorTranslator, d as decodeJwtSafely, a as getCookie, g as getCurrentUserEmail, f as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, e as parseJavaScriptError, c as parseTransactionError, b as secureLocalStorage, s as secureSessionStorage, l as translateError, t as translateErrorCode, k as translateErrorCodes } from './errorTranslation-qwwQTvCO.mjs';
12
+ export { h as CrudifyEnvironment, E as ERROR_CODES, n as ERROR_SEVERITY_MAP, w as ErrorCode, x as ErrorSeverity, y as ErrorTranslationConfig, P as ParsedError, R as ResolvedTenantConfig, T as TenantConfig, b as TenantConfigOptions, v as createErrorTranslator, d as decodeJwtSafely, g as getCurrentUserEmail, m as getErrorMessage, j as handleCrudifyError, i as isTokenExpired, p as parseApiError, l as parseJavaScriptError, k as parseTransactionError, r as resolveTenantConfig, a as secureLocalStorage, s as secureSessionStorage, q as translateError, t as translateErrorCode, o as translateErrorCodes, u as useTenantConfig } from './errorTranslation-DeeDj7Vt.mjs';
13
13
  import { ApiResponse, IModule, ModuleCreateInput, ModuleEditInput, ActionListFilters, IAction, ActionCreateInput, ActionEditInput, UpdateActionsProfilesInput, UpdateActionsProfilesResponse, CalculatePermissionsInput, CalculatePermissionsResponse } from '@nocios/crudify-admin-sdk';
14
14
  export { ActionCreateInput, ActionEditInput, ActionListFilters, ApiResponse, IAction, IModule, ModuleCreateInput, ModuleEditInput, UpdateActionsProfilesInput, UpdateActionsProfilesResponse } from '@nocios/crudify-admin-sdk';
15
15
 
@@ -120,44 +120,6 @@ declare class CrossTabSyncManager {
120
120
  */
121
121
  declare const crossTabSync: CrossTabSyncManager;
122
122
 
123
- /**
124
- * CookieManager - Manages cross-subdomain cookies for authentication
125
- *
126
- * Cookie Configuration:
127
- * - Name: crudify_auth
128
- * - Domain: .nocios.link (STG) or .crudia.com (PROD)
129
- * - Secure: true (HTTPS only)
130
- * - SameSite: Lax (allows cross-subdomain, prevents CSRF)
131
- * - Path: /
132
- * - Max-Age: 7 days (matching token refresh cycle)
133
- *
134
- * This enables authentication to work across subdomains:
135
- * - munisanjusto.nocios.link (sets cookie)
136
- * - files.nocios.link (reads cookie via Lambda@Edge)
137
- */
138
- declare const CookieManager: {
139
- /**
140
- * Set auth token cookie for cross-subdomain authentication
141
- * @param token JWT access token
142
- */
143
- setToken(token: string): void;
144
- /**
145
- * Get auth token from cookie
146
- * @returns JWT token string or null if not found
147
- */
148
- getToken(): string | null;
149
- /**
150
- * Remove auth token cookie (on logout)
151
- */
152
- removeToken(): void;
153
- /**
154
- * Sync cookie with localStorage token
155
- * Call this on app initialization to ensure cookie is in sync
156
- * @param accessToken Current access token from localStorage, or null if not authenticated
157
- */
158
- syncWithLocalStorage(accessToken: string | null): void;
159
- };
160
-
161
123
  type CrudifyThemeProviderProps = {
162
124
  children: ReactNode;
163
125
  defaultTheme?: ThemeOptions;
@@ -165,7 +127,8 @@ type CrudifyThemeProviderProps = {
165
127
  };
166
128
  /**
167
129
  * Provider de tema para aplicaciones Crudify
168
- * Lee automáticamente la cookie "theme" y aplica el tema a Material-UI
130
+ * Lee automáticamente el theme desde window.__TENANT_CONFIG__ (inyectado por Lambda@Edge)
131
+ * y aplica el tema a Material-UI
169
132
  *
170
133
  * @example
171
134
  * ```tsx
@@ -218,11 +181,11 @@ declare function allPasswordRulesPassed(evaluated: EvaluatedPasswordRule[]): boo
218
181
  * - dev/stg: All logs (error, warn, info, debug)
219
182
  * - prod: Only errors (default)
220
183
  *
221
- * AUTO-DETECTION:
184
+ * AUTO-DETECTION (v2.0.0 - No longer uses cookies):
222
185
  * The logger will automatically detect the environment from:
223
186
  * 1. Explicit setEnvironment() call (highest priority)
224
- * 2. Cookie named 'environment' (for production with Lambda@Edge)
225
- * 3. window.__CRUDIFY_ENV__ global variable
187
+ * 2. window.__TENANT_CONFIG__.environment (production with Lambda@Edge)
188
+ * 3. window.__CRUDIFY_ENV__ global variable (legacy/fallback)
226
189
  * 4. Default to "prod" for safety
227
190
  *
228
191
  * Usage:
@@ -231,7 +194,7 @@ declare function allPasswordRulesPassed(evaluated: EvaluatedPasswordRule[]): boo
231
194
  * // Option 1: Explicit configuration (recommended for apps)
232
195
  * logger.setEnvironment('dev'); // or 'stg', 'prod'
233
196
  *
234
- * // Option 2: Auto-detection (reads cookie or global)
197
+ * // Option 2: Auto-detection (reads from window.__TENANT_CONFIG__)
235
198
  * // Just use the logger - it will auto-detect
236
199
  *
237
200
  * logger.error('Something failed', { userId: '123' });
@@ -1309,4 +1272,4 @@ declare const crudifyAdmin: {
1309
1272
  calculatePermissions: (data: CalculatePermissionsInput) => Promise<ApiResponse<CalculatePermissionsResponse>>;
1310
1273
  };
1311
1274
 
1312
- export { AuthRoute, type AuthRouteProps, CRITICAL_TRANSLATIONS, CookieManager, type CriticalTranslationKey, type CrossTabListener, type CrossTabMessage, type CrossTabMessageType, CrossTabSyncManager, CrudifyInitializationManager, CrudifyInitializer, type CrudifyInitializerConfig, type CrudifyInitializerProps, CrudifyLoginConfig, CrudifyProvider, CrudifyThemeProvider, type CrudifyThemeProviderProps, EvaluatedPasswordRule, type FetchTranslationsOptions, GuestRoute, type GuestRouteBehavior, type GuestRouteProps, type InitializationPriority, type InitializationRequest, type InitializationStatus, type LogContext, type LogLevel, PasswordRequirements, type PasswordRequirementsProps, PasswordRule, ProtectedRoute, type ProtectedRouteProps, SessionLoadingScreen, type SessionLoadingScreenProps, type SupportedLanguage, type TranslationResponse, TranslationService, type TranslationsContextValue, TranslationsProvider, type TranslationsProviderProps, allPasswordRulesPassed, clearCorruptedTokens, crossTabSync, crudifyAdmin, crudifyInitManager, evaluatePasswordRules, extractSafeRedirectFromUrl, getCriticalLanguages, getCriticalTranslations, hasCorruptedTokens, hasEncryptionKeyHash, hasStoredTokens, logger, shouldWaitForInitialization, translationService, useCrudify, useCrudifyInitializer, useTranslations, validateInternalRedirect };
1275
+ export { AuthRoute, type AuthRouteProps, CRITICAL_TRANSLATIONS, type CriticalTranslationKey, type CrossTabListener, type CrossTabMessage, type CrossTabMessageType, CrossTabSyncManager, CrudifyInitializationManager, CrudifyInitializer, type CrudifyInitializerConfig, type CrudifyInitializerProps, CrudifyLoginConfig, CrudifyProvider, CrudifyThemeProvider, type CrudifyThemeProviderProps, EvaluatedPasswordRule, type FetchTranslationsOptions, GuestRoute, type GuestRouteBehavior, type GuestRouteProps, type InitializationPriority, type InitializationRequest, type InitializationStatus, type LogContext, type LogLevel, PasswordRequirements, type PasswordRequirementsProps, PasswordRule, ProtectedRoute, type ProtectedRouteProps, SessionLoadingScreen, type SessionLoadingScreenProps, type SupportedLanguage, type TranslationResponse, TranslationService, type TranslationsContextValue, TranslationsProvider, type TranslationsProviderProps, allPasswordRulesPassed, clearCorruptedTokens, crossTabSync, crudifyAdmin, crudifyInitManager, evaluatePasswordRules, extractSafeRedirectFromUrl, getCriticalLanguages, getCriticalTranslations, hasCorruptedTokens, hasEncryptionKeyHash, hasStoredTokens, logger, shouldWaitForInitialization, translationService, useCrudify, useCrudifyInitializer, useTranslations, validateInternalRedirect };
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export { F as FileItem, v as FileStatus, L as LoginResult, N as NotificationOpti
9
9
  import * as react_jsx_runtime from 'react/jsx-runtime';
10
10
  import { ThemeOptions } from '@mui/material';
11
11
  export { A as AutoGenerateConfig, G as GlobalNotificationProvider, a as GlobalNotificationProviderProps, N as Notification, b as NotificationSeverity, d as UseAutoGenerateOptions, U as UseAutoGenerateReturn, c as useAutoGenerate, u as useGlobalNotification } from './GlobalNotificationProvider-Zq18OkpI.js';
12
- export { E as ERROR_CODES, j as ERROR_SEVERITY_MAP, n as ErrorCode, o as ErrorSeverity, q as ErrorTranslationConfig, P as ParsedError, m as createErrorTranslator, d as decodeJwtSafely, a as getCookie, g as getCurrentUserEmail, f as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, e as parseJavaScriptError, c as parseTransactionError, b as secureLocalStorage, s as secureSessionStorage, l as translateError, t as translateErrorCode, k as translateErrorCodes } from './errorTranslation-DGdrMidg.js';
12
+ export { h as CrudifyEnvironment, E as ERROR_CODES, n as ERROR_SEVERITY_MAP, w as ErrorCode, x as ErrorSeverity, y as ErrorTranslationConfig, P as ParsedError, R as ResolvedTenantConfig, T as TenantConfig, b as TenantConfigOptions, v as createErrorTranslator, d as decodeJwtSafely, g as getCurrentUserEmail, m as getErrorMessage, j as handleCrudifyError, i as isTokenExpired, p as parseApiError, l as parseJavaScriptError, k as parseTransactionError, r as resolveTenantConfig, a as secureLocalStorage, s as secureSessionStorage, q as translateError, t as translateErrorCode, o as translateErrorCodes, u as useTenantConfig } from './errorTranslation-By5Av0tL.js';
13
13
  import { ApiResponse, IModule, ModuleCreateInput, ModuleEditInput, ActionListFilters, IAction, ActionCreateInput, ActionEditInput, UpdateActionsProfilesInput, UpdateActionsProfilesResponse, CalculatePermissionsInput, CalculatePermissionsResponse } from '@nocios/crudify-admin-sdk';
14
14
  export { ActionCreateInput, ActionEditInput, ActionListFilters, ApiResponse, IAction, IModule, ModuleCreateInput, ModuleEditInput, UpdateActionsProfilesInput, UpdateActionsProfilesResponse } from '@nocios/crudify-admin-sdk';
15
15
 
@@ -120,44 +120,6 @@ declare class CrossTabSyncManager {
120
120
  */
121
121
  declare const crossTabSync: CrossTabSyncManager;
122
122
 
123
- /**
124
- * CookieManager - Manages cross-subdomain cookies for authentication
125
- *
126
- * Cookie Configuration:
127
- * - Name: crudify_auth
128
- * - Domain: .nocios.link (STG) or .crudia.com (PROD)
129
- * - Secure: true (HTTPS only)
130
- * - SameSite: Lax (allows cross-subdomain, prevents CSRF)
131
- * - Path: /
132
- * - Max-Age: 7 days (matching token refresh cycle)
133
- *
134
- * This enables authentication to work across subdomains:
135
- * - munisanjusto.nocios.link (sets cookie)
136
- * - files.nocios.link (reads cookie via Lambda@Edge)
137
- */
138
- declare const CookieManager: {
139
- /**
140
- * Set auth token cookie for cross-subdomain authentication
141
- * @param token JWT access token
142
- */
143
- setToken(token: string): void;
144
- /**
145
- * Get auth token from cookie
146
- * @returns JWT token string or null if not found
147
- */
148
- getToken(): string | null;
149
- /**
150
- * Remove auth token cookie (on logout)
151
- */
152
- removeToken(): void;
153
- /**
154
- * Sync cookie with localStorage token
155
- * Call this on app initialization to ensure cookie is in sync
156
- * @param accessToken Current access token from localStorage, or null if not authenticated
157
- */
158
- syncWithLocalStorage(accessToken: string | null): void;
159
- };
160
-
161
123
  type CrudifyThemeProviderProps = {
162
124
  children: ReactNode;
163
125
  defaultTheme?: ThemeOptions;
@@ -165,7 +127,8 @@ type CrudifyThemeProviderProps = {
165
127
  };
166
128
  /**
167
129
  * Provider de tema para aplicaciones Crudify
168
- * Lee automáticamente la cookie "theme" y aplica el tema a Material-UI
130
+ * Lee automáticamente el theme desde window.__TENANT_CONFIG__ (inyectado por Lambda@Edge)
131
+ * y aplica el tema a Material-UI
169
132
  *
170
133
  * @example
171
134
  * ```tsx
@@ -218,11 +181,11 @@ declare function allPasswordRulesPassed(evaluated: EvaluatedPasswordRule[]): boo
218
181
  * - dev/stg: All logs (error, warn, info, debug)
219
182
  * - prod: Only errors (default)
220
183
  *
221
- * AUTO-DETECTION:
184
+ * AUTO-DETECTION (v2.0.0 - No longer uses cookies):
222
185
  * The logger will automatically detect the environment from:
223
186
  * 1. Explicit setEnvironment() call (highest priority)
224
- * 2. Cookie named 'environment' (for production with Lambda@Edge)
225
- * 3. window.__CRUDIFY_ENV__ global variable
187
+ * 2. window.__TENANT_CONFIG__.environment (production with Lambda@Edge)
188
+ * 3. window.__CRUDIFY_ENV__ global variable (legacy/fallback)
226
189
  * 4. Default to "prod" for safety
227
190
  *
228
191
  * Usage:
@@ -231,7 +194,7 @@ declare function allPasswordRulesPassed(evaluated: EvaluatedPasswordRule[]): boo
231
194
  * // Option 1: Explicit configuration (recommended for apps)
232
195
  * logger.setEnvironment('dev'); // or 'stg', 'prod'
233
196
  *
234
- * // Option 2: Auto-detection (reads cookie or global)
197
+ * // Option 2: Auto-detection (reads from window.__TENANT_CONFIG__)
235
198
  * // Just use the logger - it will auto-detect
236
199
  *
237
200
  * logger.error('Something failed', { userId: '123' });
@@ -1309,4 +1272,4 @@ declare const crudifyAdmin: {
1309
1272
  calculatePermissions: (data: CalculatePermissionsInput) => Promise<ApiResponse<CalculatePermissionsResponse>>;
1310
1273
  };
1311
1274
 
1312
- export { AuthRoute, type AuthRouteProps, CRITICAL_TRANSLATIONS, CookieManager, type CriticalTranslationKey, type CrossTabListener, type CrossTabMessage, type CrossTabMessageType, CrossTabSyncManager, CrudifyInitializationManager, CrudifyInitializer, type CrudifyInitializerConfig, type CrudifyInitializerProps, CrudifyLoginConfig, CrudifyProvider, CrudifyThemeProvider, type CrudifyThemeProviderProps, EvaluatedPasswordRule, type FetchTranslationsOptions, GuestRoute, type GuestRouteBehavior, type GuestRouteProps, type InitializationPriority, type InitializationRequest, type InitializationStatus, type LogContext, type LogLevel, PasswordRequirements, type PasswordRequirementsProps, PasswordRule, ProtectedRoute, type ProtectedRouteProps, SessionLoadingScreen, type SessionLoadingScreenProps, type SupportedLanguage, type TranslationResponse, TranslationService, type TranslationsContextValue, TranslationsProvider, type TranslationsProviderProps, allPasswordRulesPassed, clearCorruptedTokens, crossTabSync, crudifyAdmin, crudifyInitManager, evaluatePasswordRules, extractSafeRedirectFromUrl, getCriticalLanguages, getCriticalTranslations, hasCorruptedTokens, hasEncryptionKeyHash, hasStoredTokens, logger, shouldWaitForInitialization, translationService, useCrudify, useCrudifyInitializer, useTranslations, validateInternalRedirect };
1275
+ export { AuthRoute, type AuthRouteProps, CRITICAL_TRANSLATIONS, type CriticalTranslationKey, type CrossTabListener, type CrossTabMessage, type CrossTabMessageType, CrossTabSyncManager, CrudifyInitializationManager, CrudifyInitializer, type CrudifyInitializerConfig, type CrudifyInitializerProps, CrudifyLoginConfig, CrudifyProvider, CrudifyThemeProvider, type CrudifyThemeProviderProps, EvaluatedPasswordRule, type FetchTranslationsOptions, GuestRoute, type GuestRouteBehavior, type GuestRouteProps, type InitializationPriority, type InitializationRequest, type InitializationStatus, type LogContext, type LogLevel, PasswordRequirements, type PasswordRequirementsProps, PasswordRule, ProtectedRoute, type ProtectedRouteProps, SessionLoadingScreen, type SessionLoadingScreenProps, type SupportedLanguage, type TranslationResponse, TranslationService, type TranslationsContextValue, TranslationsProvider, type TranslationsProviderProps, allPasswordRulesPassed, clearCorruptedTokens, crossTabSync, crudifyAdmin, crudifyInitManager, evaluatePasswordRules, extractSafeRedirectFromUrl, getCriticalLanguages, getCriticalTranslations, hasCorruptedTokens, hasEncryptionKeyHash, hasStoredTokens, logger, shouldWaitForInitialization, translationService, useCrudify, useCrudifyInitializer, useTranslations, validateInternalRedirect };
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 _chunkQXKVRWT3js = require('./chunk-QXKVRWT3.js');var _chunkU5NSADERjs = require('./chunk-U5NSADER.js');var _chunk47SM45CVjs = require('./chunk-47SM45CV.js');var _chunk5HFI5CZ5js = require('./chunk-5HFI5CZ5.js');var _chunkNSV6ECYOjs = require('./chunk-NSV6ECYO.js');var _chunkMFYHD6S5js = require('./chunk-MFYHD6S5.js');var _crudifysdk = require('@nocios/crudify-sdk'); var _crudifysdk2 = _interopRequireDefault(_crudifysdk); _createStarExport(_crudifysdk);var _react = require('react');var _material = require('@mui/material');var _jsxruntime = require('react/jsx-runtime');var nr=(e={})=>{try{let r=_chunkMFYHD6S5js.b.call(void 0, "theme");if(r){let t=JSON.parse(decodeURIComponent(r));return{...e,...t}}}catch(r){_chunkMFYHD6S5js.a.warn("Error parsing theme from cookie",r instanceof Error?{errorMessage:r.message}:{message:String(r)})}return e};function sr({children:e,defaultTheme:r={},disableCssBaseline:t=!1}){let o=_react.useMemo.call(void 0, ()=>{let n=nr(r);return _material.createTheme.call(void 0, n)},[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 ur={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 _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 _chunkAOPB3KXBjs = require('./chunk-AOPB3KXB.js');var _chunkRORGWKHPjs = require('./chunk-RORGWKHP.js');var _chunkLK6QVSG4js = require('./chunk-LK6QVSG4.js');var _chunk4VN5YRYZjs = require('./chunk-4VN5YRYZ.js');var _chunkNSV6ECYOjs = require('./chunk-NSV6ECYO.js');var _chunkCR5KJUSTjs = require('./chunk-CR5KJUST.js');var _crudifysdk = require('@nocios/crudify-sdk'); var _crudifysdk2 = _interopRequireDefault(_crudifysdk); _createStarExport(_crudifysdk);var _react = require('react');var _material = require('@mui/material');var _jsxruntime = require('react/jsx-runtime');var nr=(e={})=>{try{let r=_chunkCR5KJUSTjs.b.call(void 0, );if(r.configSource!=="none"&&r.theme)return{...e,...r.theme}}catch(r){_chunkCR5KJUSTjs.a.warn("Error reading theme from config",r instanceof Error?{errorMessage:r.message}:{message:String(r)})}return e};function sr({children:e,defaultTheme:r={},disableCssBaseline:t=!1}){let o=_react.useMemo.call(void 0, ()=>{let n=nr(r);return _material.createTheme.call(void 0, n)},[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 ur={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:ur}),_jsxruntime.jsx.call(void 0, "p",{style:{fontSize:"1.25em",fontWeight:"500",marginTop:"24px",color:"#1f2937"},children:o})]})]})}var dr=/^[a-zA-Z0-9\-_./\?=&%#]+$/,fr=[/^https?:\/\//i,/^ftp:\/\//i,/^\/\//,/javascript:/i,/data:/i,/vbscript:/i,/about:/i,/\.\.\//,/\.\.\\/,/%2e%2e%2f/i,/%2e%2e%5c/i,/%2f%2f/i,/%5c%5c/i,/[\x00-\x1f\x7f-\x9f]/,/\\/],E= exports.validateInternalRedirect =(e,r="/")=>{if(!e||typeof e!="string")return r;let t=e.trim();if(!t)return r;if(!t.startsWith("/"))return _chunkMFYHD6S5js.a.warn("Open redirect blocked (relative path)",{path:e}),r;if(!dr.test(t))return _chunkMFYHD6S5js.a.warn("Open redirect blocked (invalid characters)",{path:e}),r;let o=t.toLowerCase();for(let i of fr)if(i.test(o))return _chunkMFYHD6S5js.a.warn("Open redirect blocked (dangerous pattern)",{path:e}),r;let n=t.split("?")[0].split("/").filter(Boolean);if(n.length===0)return t;for(let i of n)if(i===".."||i.includes(":")||i.length>100)return _chunkMFYHD6S5js.a.warn("Open redirect blocked (suspicious path part)",{part:i}),r;return t},M= exports.extractSafeRedirectFromUrl =(e,r="/")=>{try{let o=(typeof e=="string"?new URLSearchParams(e):e).get("redirect");if(!o)return r;let n=decodeURIComponent(o);return E(n,r)}catch(t){return _chunkMFYHD6S5js.a.warn("Error parsing redirect parameter",t instanceof Error?{errorMessage:t.message}:{message:String(t)}),r}};function V({children:e,loadingComponent:r,loginPath:t="/login"}){let{isAuthenticated:o,isLoading:n,isLoggingOut:i,isInitialized:y,tokens:c,error:f}=_chunk47SM45CVjs.m.call(void 0, ),u=_reactrouterdom.useLocation.call(void 0, );if(!y||n&&!i)return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:r||_jsxruntime.jsx.call(void 0, g,{stage:"validating-session"})});let l=o&&_optionalChain([c, 'optionalAccess', _2 => _2.accessToken])&&c.accessToken.length>0;if(f||!o||!l){if(i)return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:t,replace:!0});let R=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 S=E(R),w=encodeURIComponent(S);return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:`${t}?redirect=${w}`,replace:!0})}return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e})}var L="crudify_tokens",gr="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(gr);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 yr(){try{H()&&localStorage.removeItem(L)}catch (e5){}}function Y({children:e,redirectTo:r="/",loadingComponent:t,initTimeout:o=3e3}){let{isAuthenticated:n,isInitialized:i}=_chunk47SM45CVjs.m.call(void 0, ),y=_reactrouterdom.useLocation.call(void 0, ),[c]=_react.useState.call(void 0, ()=>U()),[f,u]=_react.useState.call(void 0, !1);if(_react.useEffect.call(void 0, ()=>{if(!i&&c){let l=setTimeout(()=>{u(!0)},o);return()=>clearTimeout(l)}},[i,c,o]),i&&n){let l=new URLSearchParams(y.search),R=M(l,r);return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:R,replace:!0})}return i&&!n?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e}):c&&!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:n,isInitialized:i}=_chunk47SM45CVjs.m.call(void 0, );return i?r==="allow-all"?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e}):n?_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 Q=_react.createContext.call(void 0, void 0),Sr= exports.CrudifyInitializer =({config:e,children:r,fallback:t=null,onInitialized:o,onError:n})=>{let[i,y]=_react.useState.call(void 0, !1),[c,f]=_react.useState.call(void 0, !1),[u,l]=_react.useState.call(void 0, null),R=_react.useRef.call(void 0, !1),S=_react.useRef.call(void 0, !1);_react.useEffect.call(void 0, ()=>{R.current||(_chunk47SM45CVjs.r.registerHighPriorityInitializer(),R.current=!0),S.current||(S.current=!0,(async()=>{f(!0),l(null);try{let d=_chunkMFYHD6S5js.c.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";_chunkMFYHD6S5js.a.setEnvironment(v),await _chunk47SM45CVjs.r.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));l(v),f(!1),n&&n(v)}})())},[_optionalChain([e, 'optionalAccess', _7 => _7.publicApiKey]),_optionalChain([e, 'optionalAccess', _8 => _8.env]),_optionalChain([e, 'optionalAccess', _9 => _9.enableLogging]),o,n]);let w={isInitialized:i,isInitializing:c,error:u};return c&&t?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:t}):(u&&_chunkMFYHD6S5js.a.error("[CrudifyInitializer] Initialization failed",u),_jsxruntime.jsx.call(void 0, Q.Provider,{value:w,children:r}))},vr= exports.useCrudifyInitializer =()=>{let e=_react.useContext.call(void 0, Q);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 X=!1,I=null,h=null;async function kr(){let r=await _chunk47SM45CVjs.e.getInstance().getTokenInfo(),t=_optionalChain([r, 'optionalAccess', _10 => _10.apiEndpointAdmin]),o=_optionalChain([r, 'optionalAccess', _11 => _11.apiKeyEndpointAdmin]);return t&&o?{apiUrl:t,apiKey:o}:_chunk47SM45CVjs.i.waitForCredentials()}async function Er(){if(!X)return I||(I=(async()=>{try{let e=_chunk47SM45CVjs.e.getInstance(),{apiUrl:r,apiKey:t}=await kr();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}`}:{}}),X=!0}catch(e){throw I=null,_chunkMFYHD6S5js.a.error("[crudifyAdminWrapper] Initialization failed",e instanceof Error?e:{message:String(e)}),e}})(),I)}async function a(e){try{await Er();let r=_chunk47SM45CVjs.e.getInstance();h=await _asyncOptionalChain([(await r.getTokenInfo()), 'optionalAccess', async _14 => _14.crudifyTokens, 'optionalAccess', async _15 => _15.accessToken])||null;let o=await e(),n=o.errors&&(typeof o.errors=="string"&&o.errors.includes("401")||Array.isArray(o.errors)&&o.errors.some(i=>typeof i=="string"&&i.includes("401")));return!o.success&&n?await r.refreshTokens()?(h=await _asyncOptionalChain([(await r.getTokenInfo()), 'optionalAccess', async _16 => _16.crudifyTokens, 'optionalAccess', async _17 => _17.accessToken])||null,await e()):(_chunkMFYHD6S5js.a.error("[crudifyAdmin] Token refresh failed"),typeof window<"u"&&(window.location.href="/login"),o):o}catch(r){return _chunkMFYHD6S5js.a.error("[crudifyAdmin] Operation error",r instanceof Error?r:{message:String(r)}),{success:!1,errors:r instanceof Error?r.message:"Unknown error"}}}var wr={listModules:()=>a(()=>_crudifyadminsdk2.default.listModules()),getModule:e=>a(()=>_crudifyadminsdk2.default.getModule(e)),createModule:e=>a(()=>_crudifyadminsdk2.default.createModule(e)),editModule:(e,r)=>a(()=>_crudifyadminsdk2.default.editModule(e,r)),deleteModule:e=>a(()=>_crudifyadminsdk2.default.deleteModule(e)),activateModule:e=>a(()=>_crudifyadminsdk2.default.activateModule(e)),deactivateModule:e=>a(()=>_crudifyadminsdk2.default.deactivateModule(e)),getModuleVersions:e=>a(()=>_crudifyadminsdk2.default.getModuleVersions(e)),listActions:e=>a(()=>_crudifyadminsdk2.default.listActions(e)),getAction:e=>a(()=>_crudifyadminsdk2.default.getAction(e)),createAction:e=>a(()=>_crudifyadminsdk2.default.createAction(e)),editAction:(e,r)=>a(()=>_crudifyadminsdk2.default.editAction(e,r)),deleteAction:e=>a(()=>_crudifyadminsdk2.default.deleteAction(e)),activateAction:e=>a(()=>_crudifyadminsdk2.default.activateAction(e)),deactivateAction:e=>a(()=>_crudifyadminsdk2.default.deactivateAction(e)),getActionVersions:e=>a(()=>_crudifyadminsdk2.default.getActionVersions(e)),getActionsByProfile:e=>a(()=>_crudifyadminsdk2.default.getActionsByProfile(e)),updateActionsProfiles:e=>a(()=>_crudifyadminsdk2.default.updateActionsProfiles(e)),calculatePermissions:e=>a(()=>_crudifyadminsdk2.default.calculatePermissions(e))};exports.AuthRoute = Y; exports.CRITICAL_TRANSLATIONS = _chunkQXKVRWT3js.a; exports.CookieManager = _chunk47SM45CVjs.d; exports.CrossTabSyncManager = _chunk47SM45CVjs.b; exports.CrudiaAutoGenerate = _chunkQXKVRWT3js.s; exports.CrudiaFileField = _chunkQXKVRWT3js.t; exports.CrudiaMarkdownField = _chunkQXKVRWT3js.u; exports.CrudifyInitializationManager = _chunk47SM45CVjs.q; exports.CrudifyInitializer = Sr; exports.CrudifyLogin = _chunkQXKVRWT3js.l; exports.CrudifyProvider = _chunk47SM45CVjs.j; exports.CrudifyThemeProvider = sr; exports.DEFAULT_PASSWORD_RULES = _chunkQXKVRWT3js.k; exports.ERROR_CODES = _chunkNSV6ECYOjs.a; exports.ERROR_SEVERITY_MAP = _chunkNSV6ECYOjs.b; exports.GlobalNotificationProvider = _chunk47SM45CVjs.g; exports.GuestRoute = J; exports.LoginComponent = _chunkQXKVRWT3js.q; exports.POLICY_ACTIONS = _chunkQXKVRWT3js.n; exports.PREFERRED_POLICY_ORDER = _chunkQXKVRWT3js.o; exports.PasswordRequirements = _chunkQXKVRWT3js.h; exports.Policies = _chunkQXKVRWT3js.p; exports.ProtectedRoute = V; exports.SessionDebugInfo = _chunk47SM45CVjs.n; exports.SessionLoadingScreen = g; exports.SessionManager = _chunk47SM45CVjs.e; exports.SessionProvider = _chunk47SM45CVjs.l; exports.SessionStatus = _chunkQXKVRWT3js.r; exports.TokenStorage = _chunk47SM45CVjs.a; exports.TranslationService = _chunkQXKVRWT3js.d; exports.TranslationsProvider = _chunkQXKVRWT3js.f; exports.UserProfileDisplay = _chunkQXKVRWT3js.m; exports.allPasswordRulesPassed = _chunkQXKVRWT3js.j; exports.clearCorruptedTokens = yr; exports.createErrorTranslator = _chunkMFYHD6S5js.o; exports.crossTabSync = _chunk47SM45CVjs.c; exports.crudify = _crudifysdk2.default; exports.crudifyAdmin = wr; exports.crudifyInitManager = _chunk47SM45CVjs.r; exports.decodeJwtSafely = _chunkMFYHD6S5js.q; exports.evaluatePasswordRules = _chunkQXKVRWT3js.i; exports.extractSafeRedirectFromUrl = M; exports.getCookie = _chunkMFYHD6S5js.b; exports.getCriticalLanguages = _chunkQXKVRWT3js.b; exports.getCriticalTranslations = _chunkQXKVRWT3js.c; exports.getCurrentUserEmail = _chunkMFYHD6S5js.r; exports.getErrorMessage = _chunkNSV6ECYOjs.e; exports.handleCrudifyError = _chunkNSV6ECYOjs.g; exports.hasCorruptedTokens = H; exports.hasEncryptionKeyHash = W; exports.hasStoredTokens = B; exports.isTokenExpired = _chunkMFYHD6S5js.s; exports.logger = _chunkMFYHD6S5js.a; exports.parseApiError = _chunkNSV6ECYOjs.c; exports.parseJavaScriptError = _chunkNSV6ECYOjs.f; exports.parseTransactionError = _chunkNSV6ECYOjs.d; exports.secureLocalStorage = _chunk5HFI5CZ5js.b; exports.secureSessionStorage = _chunk5HFI5CZ5js.a; exports.shouldWaitForInitialization = U; exports.translateError = _chunkMFYHD6S5js.n; exports.translateErrorCode = _chunkMFYHD6S5js.l; exports.translateErrorCodes = _chunkMFYHD6S5js.m; exports.translationService = _chunkQXKVRWT3js.e; exports.useAuth = _chunkU5NSADERjs.b; exports.useAutoGenerate = _chunk47SM45CVjs.p; exports.useCrudify = _chunk47SM45CVjs.k; exports.useCrudifyInitializer = vr; exports.useCrudifyWithNotifications = _chunkU5NSADERjs.d; exports.useData = _chunkU5NSADERjs.c; exports.useFileUpload = _chunk47SM45CVjs.s; exports.useGlobalNotification = _chunk47SM45CVjs.h; exports.useSession = _chunk47SM45CVjs.f; exports.useSessionContext = _chunk47SM45CVjs.m; exports.useTranslations = _chunkQXKVRWT3js.g; exports.useUserData = _chunkU5NSADERjs.a; exports.useUserProfile = _chunk47SM45CVjs.o; exports.validateInternalRedirect = E;
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:ur}),_jsxruntime.jsx.call(void 0, "p",{style:{fontSize:"1.25em",fontWeight:"500",marginTop:"24px",color:"#1f2937"},children:o})]})]})}var dr=/^[a-zA-Z0-9\-_./\?=&%#]+$/,fr=[/^https?:\/\//i,/^ftp:\/\//i,/^\/\//,/javascript:/i,/data:/i,/vbscript:/i,/about:/i,/\.\.\//,/\.\.\\/,/%2e%2e%2f/i,/%2e%2e%5c/i,/%2f%2f/i,/%5c%5c/i,/[\x00-\x1f\x7f-\x9f]/,/\\/],k= exports.validateInternalRedirect =(e,r="/")=>{if(!e||typeof e!="string")return r;let t=e.trim();if(!t)return r;if(!t.startsWith("/"))return _chunkCR5KJUSTjs.a.warn("Open redirect blocked (relative path)",{path:e}),r;if(!dr.test(t))return _chunkCR5KJUSTjs.a.warn("Open redirect blocked (invalid characters)",{path:e}),r;let o=t.toLowerCase();for(let i of fr)if(i.test(o))return _chunkCR5KJUSTjs.a.warn("Open redirect blocked (dangerous pattern)",{path:e}),r;let n=t.split("?")[0].split("/").filter(Boolean);if(n.length===0)return t;for(let i of n)if(i===".."||i.includes(":")||i.length>100)return _chunkCR5KJUSTjs.a.warn("Open redirect blocked (suspicious path part)",{part:i}),r;return t},M= exports.extractSafeRedirectFromUrl =(e,r="/")=>{try{let o=(typeof e=="string"?new URLSearchParams(e):e).get("redirect");if(!o)return r;let n=decodeURIComponent(o);return k(n,r)}catch(t){return _chunkCR5KJUSTjs.a.warn("Error parsing redirect parameter",t instanceof Error?{errorMessage:t.message}:{message:String(t)}),r}};function V({children:e,loadingComponent:r,loginPath:t="/login"}){let{isAuthenticated:o,isLoading:n,isLoggingOut:i,isInitialized:y,tokens:c,error:f}=_chunkLK6QVSG4js.l.call(void 0, ),u=_reactrouterdom.useLocation.call(void 0, );if(!y||n&&!i)return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:r||_jsxruntime.jsx.call(void 0, g,{stage:"validating-session"})});let l=o&&_optionalChain([c, 'optionalAccess', _2 => _2.accessToken])&&c.accessToken.length>0;if(f||!o||!l){if(i)return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:t,replace:!0});let R=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 S=k(R),w=encodeURIComponent(S);return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:`${t}?redirect=${w}`,replace:!0})}return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e})}var L="crudify_tokens",gr="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(gr);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 yr(){try{H()&&localStorage.removeItem(L)}catch (e5){}}function Y({children:e,redirectTo:r="/",loadingComponent:t,initTimeout:o=3e3}){let{isAuthenticated:n,isInitialized:i}=_chunkLK6QVSG4js.l.call(void 0, ),y=_reactrouterdom.useLocation.call(void 0, ),[c]=_react.useState.call(void 0, ()=>U()),[f,u]=_react.useState.call(void 0, !1);if(_react.useEffect.call(void 0, ()=>{if(!i&&c){let l=setTimeout(()=>{u(!0)},o);return()=>clearTimeout(l)}},[i,c,o]),i&&n){let l=new URLSearchParams(y.search),R=M(l,r);return _jsxruntime.jsx.call(void 0, _reactrouterdom.Navigate,{to:R,replace:!0})}return i&&!n?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e}):c&&!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 $({children:e,behavior:r="redirect-if-authenticated",redirectTo:t="/",loadingComponent:o}){let{isAuthenticated:n,isInitialized:i}=_chunkLK6QVSG4js.l.call(void 0, );return i?r==="allow-all"?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e}):n?_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 Q=_react.createContext.call(void 0, void 0),Sr= exports.CrudifyInitializer =({config:e,children:r,fallback:t=null,onInitialized:o,onError:n})=>{let[i,y]=_react.useState.call(void 0, !1),[c,f]=_react.useState.call(void 0, !1),[u,l]=_react.useState.call(void 0, null),R=_react.useRef.call(void 0, !1),S=_react.useRef.call(void 0, !1);_react.useEffect.call(void 0, ()=>{R.current||(_chunkLK6QVSG4js.q.registerHighPriorityInitializer(),R.current=!0),S.current||(S.current=!0,(async()=>{f(!0),l(null);try{let d=_chunkCR5KJUSTjs.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";_chunkCR5KJUSTjs.a.setEnvironment(v),await _chunkLK6QVSG4js.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));l(v),f(!1),n&&n(v)}})())},[_optionalChain([e, 'optionalAccess', _7 => _7.publicApiKey]),_optionalChain([e, 'optionalAccess', _8 => _8.env]),_optionalChain([e, 'optionalAccess', _9 => _9.enableLogging]),o,n]);let w={isInitialized:i,isInitializing:c,error:u};return c&&t?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:t}):(u&&_chunkCR5KJUSTjs.a.error("[CrudifyInitializer] Initialization failed",u),_jsxruntime.jsx.call(void 0, Q.Provider,{value:w,children:r}))},vr= exports.useCrudifyInitializer =()=>{let e=_react.useContext.call(void 0, Q);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 X=!1,I=null,h=null;async function Er(){let r=await _chunkLK6QVSG4js.d.getInstance().getTokenInfo(),t=_optionalChain([r, 'optionalAccess', _10 => _10.apiEndpointAdmin]),o=_optionalChain([r, 'optionalAccess', _11 => _11.apiKeyEndpointAdmin]);return t&&o?{apiUrl:t,apiKey:o}:_chunkLK6QVSG4js.h.waitForCredentials()}async function kr(){if(!X)return I||(I=(async()=>{try{let e=_chunkLK6QVSG4js.d.getInstance(),{apiUrl:r,apiKey:t}=await Er();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}`}:{}}),X=!0}catch(e){throw I=null,_chunkCR5KJUSTjs.a.error("[crudifyAdminWrapper] Initialization failed",e instanceof Error?e:{message:String(e)}),e}})(),I)}async function a(e){try{await kr();let r=_chunkLK6QVSG4js.d.getInstance();h=await _asyncOptionalChain([(await r.getTokenInfo()), 'optionalAccess', async _14 => _14.crudifyTokens, 'optionalAccess', async _15 => _15.accessToken])||null;let o=await e(),n=o.errors&&(typeof o.errors=="string"&&o.errors.includes("401")||Array.isArray(o.errors)&&o.errors.some(i=>typeof i=="string"&&i.includes("401")));return!o.success&&n?await r.refreshTokens()?(h=await _asyncOptionalChain([(await r.getTokenInfo()), 'optionalAccess', async _16 => _16.crudifyTokens, 'optionalAccess', async _17 => _17.accessToken])||null,await e()):(_chunkCR5KJUSTjs.a.error("[crudifyAdmin] Token refresh failed"),typeof window<"u"&&(window.location.href="/login"),o):o}catch(r){return _chunkCR5KJUSTjs.a.error("[crudifyAdmin] Operation error",r instanceof Error?r:{message:String(r)}),{success:!1,errors:r instanceof Error?r.message:"Unknown error"}}}var wr={listModules:()=>a(()=>_crudifyadminsdk2.default.listModules()),getModule:e=>a(()=>_crudifyadminsdk2.default.getModule(e)),createModule:e=>a(()=>_crudifyadminsdk2.default.createModule(e)),editModule:(e,r)=>a(()=>_crudifyadminsdk2.default.editModule(e,r)),deleteModule:e=>a(()=>_crudifyadminsdk2.default.deleteModule(e)),activateModule:e=>a(()=>_crudifyadminsdk2.default.activateModule(e)),deactivateModule:e=>a(()=>_crudifyadminsdk2.default.deactivateModule(e)),getModuleVersions:e=>a(()=>_crudifyadminsdk2.default.getModuleVersions(e)),listActions:e=>a(()=>_crudifyadminsdk2.default.listActions(e)),getAction:e=>a(()=>_crudifyadminsdk2.default.getAction(e)),createAction:e=>a(()=>_crudifyadminsdk2.default.createAction(e)),editAction:(e,r)=>a(()=>_crudifyadminsdk2.default.editAction(e,r)),deleteAction:e=>a(()=>_crudifyadminsdk2.default.deleteAction(e)),activateAction:e=>a(()=>_crudifyadminsdk2.default.activateAction(e)),deactivateAction:e=>a(()=>_crudifyadminsdk2.default.deactivateAction(e)),getActionVersions:e=>a(()=>_crudifyadminsdk2.default.getActionVersions(e)),getActionsByProfile:e=>a(()=>_crudifyadminsdk2.default.getActionsByProfile(e)),updateActionsProfiles:e=>a(()=>_crudifyadminsdk2.default.updateActionsProfiles(e)),calculatePermissions:e=>a(()=>_crudifyadminsdk2.default.calculatePermissions(e))};exports.AuthRoute = Y; exports.CRITICAL_TRANSLATIONS = _chunkAOPB3KXBjs.a; exports.CrossTabSyncManager = _chunkLK6QVSG4js.b; exports.CrudiaAutoGenerate = _chunkAOPB3KXBjs.s; exports.CrudiaFileField = _chunkAOPB3KXBjs.t; exports.CrudiaMarkdownField = _chunkAOPB3KXBjs.u; exports.CrudifyInitializationManager = _chunkLK6QVSG4js.p; exports.CrudifyInitializer = Sr; exports.CrudifyLogin = _chunkAOPB3KXBjs.l; exports.CrudifyProvider = _chunkLK6QVSG4js.i; exports.CrudifyThemeProvider = sr; exports.DEFAULT_PASSWORD_RULES = _chunkAOPB3KXBjs.k; exports.ERROR_CODES = _chunkNSV6ECYOjs.a; exports.ERROR_SEVERITY_MAP = _chunkNSV6ECYOjs.b; exports.GlobalNotificationProvider = _chunkLK6QVSG4js.f; exports.GuestRoute = $; exports.LoginComponent = _chunkAOPB3KXBjs.q; exports.POLICY_ACTIONS = _chunkAOPB3KXBjs.n; exports.PREFERRED_POLICY_ORDER = _chunkAOPB3KXBjs.o; exports.PasswordRequirements = _chunkAOPB3KXBjs.h; exports.Policies = _chunkAOPB3KXBjs.p; exports.ProtectedRoute = V; exports.SessionDebugInfo = _chunkLK6QVSG4js.m; exports.SessionLoadingScreen = g; exports.SessionManager = _chunkLK6QVSG4js.d; exports.SessionProvider = _chunkLK6QVSG4js.k; exports.SessionStatus = _chunkAOPB3KXBjs.r; exports.TokenStorage = _chunkLK6QVSG4js.a; exports.TranslationService = _chunkAOPB3KXBjs.d; exports.TranslationsProvider = _chunkAOPB3KXBjs.f; exports.UserProfileDisplay = _chunkAOPB3KXBjs.m; exports.allPasswordRulesPassed = _chunkAOPB3KXBjs.j; exports.clearCorruptedTokens = yr; exports.createErrorTranslator = _chunkCR5KJUSTjs.p; exports.crossTabSync = _chunkLK6QVSG4js.c; exports.crudify = _crudifysdk2.default; exports.crudifyAdmin = wr; exports.crudifyInitManager = _chunkLK6QVSG4js.q; exports.decodeJwtSafely = _chunkCR5KJUSTjs.r; exports.evaluatePasswordRules = _chunkAOPB3KXBjs.i; exports.extractSafeRedirectFromUrl = M; exports.getCriticalLanguages = _chunkAOPB3KXBjs.b; exports.getCriticalTranslations = _chunkAOPB3KXBjs.c; exports.getCurrentUserEmail = _chunkCR5KJUSTjs.s; exports.getErrorMessage = _chunkNSV6ECYOjs.e; exports.handleCrudifyError = _chunkNSV6ECYOjs.g; exports.hasCorruptedTokens = H; exports.hasEncryptionKeyHash = W; exports.hasStoredTokens = B; exports.isTokenExpired = _chunkCR5KJUSTjs.t; exports.logger = _chunkCR5KJUSTjs.a; exports.parseApiError = _chunkNSV6ECYOjs.c; exports.parseJavaScriptError = _chunkNSV6ECYOjs.f; exports.parseTransactionError = _chunkNSV6ECYOjs.d; exports.resolveTenantConfig = _chunkCR5KJUSTjs.b; exports.secureLocalStorage = _chunk4VN5YRYZjs.b; exports.secureSessionStorage = _chunk4VN5YRYZjs.a; exports.shouldWaitForInitialization = U; exports.translateError = _chunkCR5KJUSTjs.o; exports.translateErrorCode = _chunkCR5KJUSTjs.m; exports.translateErrorCodes = _chunkCR5KJUSTjs.n; exports.translationService = _chunkAOPB3KXBjs.e; exports.useAuth = _chunkRORGWKHPjs.b; exports.useAutoGenerate = _chunkLK6QVSG4js.o; exports.useCrudify = _chunkLK6QVSG4js.j; exports.useCrudifyInitializer = vr; exports.useCrudifyWithNotifications = _chunkRORGWKHPjs.d; exports.useData = _chunkRORGWKHPjs.c; exports.useFileUpload = _chunkLK6QVSG4js.r; exports.useGlobalNotification = _chunkLK6QVSG4js.g; exports.useSession = _chunkLK6QVSG4js.e; exports.useSessionContext = _chunkLK6QVSG4js.l; exports.useTenantConfig = _chunkCR5KJUSTjs.c; exports.useTranslations = _chunkAOPB3KXBjs.g; exports.useUserData = _chunkRORGWKHPjs.a; exports.useUserProfile = _chunkLK6QVSG4js.n; exports.validateInternalRedirect = k;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import{a as j,b as ee,c as re,d as te,e as oe,f as ie,g as ne,h as Me,i as ze,j as Le,k as Ue,l as Oe,m as Ne,n as Ge,o as De,p as Ke,q as _e,r as Ve,s as We,t as Ye,u as Je}from"./chunk-ISEMM6ZR.mjs";import{a as $e,b as Ze,c as Qe,d as er}from"./chunk-C35OZ7PU.mjs";import{a as se,b as le,c as de,d as fe,e as C,f as me,g as xe,h as Ce,i as D,j as Ae,k as Pe,l as Ie,m,n as he,o as Fe,p as Be,q as He,r as T,s as qe}from"./chunk-72CJ7DHU.mjs";import{a as Xe,b as je}from"./chunk-JNEWPO2J.mjs";import{a as Se,b as ve,c as Te,d as ke,e as Ee,f as we,g as be}from"./chunk-JAPL7EZJ.mjs";import{a as p,b,c as G,l as ae,m as pe,n as ue,o as ce,q as ge,r as ye,s as Re}from"./chunk-MGJZTOEM.mjs";import{default as kt}from"@nocios/crudify-sdk";export*from"@nocios/crudify-sdk";import{useMemo as rr}from"react";import{ThemeProvider as tr,createTheme as or,CssBaseline as ir}from"@mui/material";import{jsx as ar,jsxs as pr}from"react/jsx-runtime";var nr=(e={})=>{try{let r=b("theme");if(r){let t=JSON.parse(decodeURIComponent(r));return{...e,...t}}}catch(r){p.warn("Error parsing theme from cookie",r instanceof Error?{errorMessage:r.message}:{message:String(r)})}return e};function sr({children:e,defaultTheme:r={},disableCssBaseline:t=!1}){let o=rr(()=>{let n=nr(r);return or(n)},[r]);return pr(tr,{theme:o,children:[!t&&ar(ir,{}),e]})}import{Navigate as z,useLocation as mr}from"react-router-dom";import{Fragment as lr,jsx as k,jsxs as K}from"react/jsx-runtime";var ur={border:"5px solid rgba(0, 0, 0, 0.1)",borderTopColor:"#3B82F6",borderRadius:"50%",width:"50px",height:"50px",animation:"spin 1s linear infinite"},cr=()=>k("style",{children:`
1
+ import{a as j,b as ee,c as re,d as te,e as oe,f as ne,g as se,h as Me,i as ze,j as Le,k as Ue,l as Oe,m as Ne,n as Ge,o as De,p as Ke,q as _e,r as Ve,s as We,t as Ye,u as $e}from"./chunk-7ORHVSWL.mjs";import{a as Je,b as Ze,c as Qe,d as er}from"./chunk-XZ6OGRJR.mjs";import{a as ae,b as de,c as fe,d as x,e as me,f as Ce,g as xe,h as D,i as Ae,j as Pe,k as Ie,l as m,m as he,n as Fe,o as Be,p as He,q as T,r as qe}from"./chunk-GT7B57S5.mjs";import{a as Xe,b as je}from"./chunk-RJBX4MWF.mjs";import{a as Se,b as ve,c as Te,d as Ee,e as ke,f as we,g as be}from"./chunk-JAPL7EZJ.mjs";import{a as p,b,c as ie,d as G,m as pe,n as ue,o as ce,p as le,r as ge,s as ye,t as Re}from"./chunk-4ILUXVPW.mjs";import{default as Et}from"@nocios/crudify-sdk";export*from"@nocios/crudify-sdk";import{useMemo as rr}from"react";import{ThemeProvider as tr,createTheme as or,CssBaseline as ir}from"@mui/material";import{jsx as ar,jsxs as pr}from"react/jsx-runtime";var nr=(e={})=>{try{let r=b();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 sr({children:e,defaultTheme:r={},disableCssBaseline:t=!1}){let o=rr(()=>{let n=nr(r);return or(n)},[r]);return pr(tr,{theme:o,children:[!t&&ar(ir,{}),e]})}import{Navigate as z,useLocation as mr}from"react-router-dom";import{Fragment as lr,jsx as E,jsxs as K}from"react/jsx-runtime";var ur={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(lr,{children:[k(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:[k("div",{style:ur}),k("p",{style:{fontSize:"1.25em",fontWeight:"500",marginTop:"24px",color:"#1f2937"},children:o})]})]})}var dr=/^[a-zA-Z0-9\-_./\?=&%#]+$/,fr=[/^https?:\/\//i,/^ftp:\/\//i,/^\/\//,/javascript:/i,/data:/i,/vbscript:/i,/about:/i,/\.\.\//,/\.\.\\/,/%2e%2e%2f/i,/%2e%2e%5c/i,/%2f%2f/i,/%5c%5c/i,/[\x00-\x1f\x7f-\x9f]/,/\\/],E=(e,r="/")=>{if(!e||typeof e!="string")return r;let t=e.trim();if(!t)return r;if(!t.startsWith("/"))return p.warn("Open redirect blocked (relative path)",{path:e}),r;if(!dr.test(t))return p.warn("Open redirect blocked (invalid characters)",{path:e}),r;let o=t.toLowerCase();for(let i of fr)if(i.test(o))return p.warn("Open redirect blocked (dangerous pattern)",{path:e}),r;let n=t.split("?")[0].split("/").filter(Boolean);if(n.length===0)return t;for(let i of n)if(i===".."||i.includes(":")||i.length>100)return p.warn("Open redirect blocked (suspicious path part)",{part:i}),r;return t},M=(e,r="/")=>{try{let o=(typeof e=="string"?new URLSearchParams(e):e).get("redirect");if(!o)return r;let n=decodeURIComponent(o);return E(n,r)}catch(t){return p.warn("Error parsing redirect parameter",t instanceof Error?{errorMessage:t.message}:{message:String(t)}),r}};import{Fragment as _,jsx as x}from"react/jsx-runtime";function V({children:e,loadingComponent:r,loginPath:t="/login"}){let{isAuthenticated:o,isLoading:n,isLoggingOut:i,isInitialized:y,tokens:c,error:f}=m(),u=mr();if(!y||n&&!i)return x(_,{children:r||x(g,{stage:"validating-session"})});let l=o&&c?.accessToken&&c.accessToken.length>0;if(f||!o||!l){if(i)return x(z,{to:t,replace:!0});let R=u.pathname+u.search;if(u.pathname===t||u.pathname.startsWith(t))return x(z,{to:t,replace:!0});let S=E(R),w=encodeURIComponent(S);return x(z,{to:`${t}?redirect=${w}`,replace:!0})}return x(_,{children:e})}import{useState as q,useEffect as Rr}from"react";import{Navigate as xr,useLocation as Cr}from"react-router-dom";var L="crudify_tokens",gr="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(gr);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 yr(){try{H()&&localStorage.removeItem(L)}catch{}}import{Fragment as O,jsx as A}from"react/jsx-runtime";function Y({children:e,redirectTo:r="/",loadingComponent:t,initTimeout:o=3e3}){let{isAuthenticated:n,isInitialized:i}=m(),y=Cr(),[c]=q(()=>U()),[f,u]=q(!1);if(Rr(()=>{if(!i&&c){let l=setTimeout(()=>{u(!0)},o);return()=>clearTimeout(l)}},[i,c,o]),i&&n){let l=new URLSearchParams(y.search),R=M(l,r);return A(xr,{to:R,replace:!0})}return i&&!n?A(O,{children:e}):c&&!f?A(O,{children:t||A(g,{stage:"validating-session"})}):A(O,{children:e})}import{Navigate as Ar}from"react-router-dom";import{Fragment as F,jsx as P}from"react/jsx-runtime";function J({children:e,behavior:r="redirect-if-authenticated",redirectTo:t="/",loadingComponent:o}){let{isAuthenticated:n,isInitialized:i}=m();return i?r==="allow-all"?P(F,{children:e}):n?P(Ar,{to:t,replace:!0}):P(F,{children:e}):P(F,{children:o||P(g,{stage:"validating-session"})})}import{createContext as Pr,useContext as Ir,useEffect as hr,useRef as $,useState as N}from"react";import{Fragment as Tr,jsx as Z}from"react/jsx-runtime";var Q=Pr(void 0),Sr=({config:e,children:r,fallback:t=null,onInitialized:o,onError:n})=>{let[i,y]=N(!1),[c,f]=N(!1),[u,l]=N(null),R=$(!1),S=$(!1);hr(()=>{R.current||(T.registerHighPriorityInitializer(),R.current=!0),S.current||(S.current=!0,(async()=>{f(!0),l(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 T.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));l(v),f(!1),n&&n(v)}})())},[e?.publicApiKey,e?.env,e?.enableLogging,o,n]);let w={isInitialized:i,isInitializing:c,error:u};return c&&t?Z(Tr,{children:t}):(u&&p.error("[CrudifyInitializer] Initialization failed",u),Z(Q.Provider,{value:w,children:r}))},vr=()=>{let e=Ir(Q);if(!e)throw new Error("useCrudifyInitializer must be used within CrudifyInitializer");return e};import s from"@nocios/crudify-admin-sdk";var X=!1,I=null,h=null;async function kr(){let r=await C.getInstance().getTokenInfo(),t=r?.apiEndpointAdmin,o=r?.apiKeyEndpointAdmin;return t&&o?{apiUrl:t,apiKey:o}:D.waitForCredentials()}async function Er(){if(!X)return I||(I=(async()=>{try{let e=C.getInstance(),{apiUrl:r,apiKey:t}=await kr();h=(await e.getTokenInfo())?.crudifyTokens?.accessToken||null,s.init({url:r,apiKey:t,getAdditionalHeaders:()=>h?{Authorization:`Bearer ${h}`}:{}}),X=!0}catch(e){throw I=null,p.error("[crudifyAdminWrapper] Initialization failed",e instanceof Error?e:{message:String(e)}),e}})(),I)}async function a(e){try{await Er();let r=C.getInstance();h=(await r.getTokenInfo())?.crudifyTokens?.accessToken||null;let o=await e(),n=o.errors&&(typeof o.errors=="string"&&o.errors.includes("401")||Array.isArray(o.errors)&&o.errors.some(i=>typeof i=="string"&&i.includes("401")));return!o.success&&n?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 wr={listModules:()=>a(()=>s.listModules()),getModule:e=>a(()=>s.getModule(e)),createModule:e=>a(()=>s.createModule(e)),editModule:(e,r)=>a(()=>s.editModule(e,r)),deleteModule:e=>a(()=>s.deleteModule(e)),activateModule:e=>a(()=>s.activateModule(e)),deactivateModule:e=>a(()=>s.deactivateModule(e)),getModuleVersions:e=>a(()=>s.getModuleVersions(e)),listActions:e=>a(()=>s.listActions(e)),getAction:e=>a(()=>s.getAction(e)),createAction:e=>a(()=>s.createAction(e)),editAction:(e,r)=>a(()=>s.editAction(e,r)),deleteAction:e=>a(()=>s.deleteAction(e)),activateAction:e=>a(()=>s.activateAction(e)),deactivateAction:e=>a(()=>s.deactivateAction(e)),getActionVersions:e=>a(()=>s.getActionVersions(e)),getActionsByProfile:e=>a(()=>s.getActionsByProfile(e)),updateActionsProfiles:e=>a(()=>s.updateActionsProfiles(e)),calculatePermissions:e=>a(()=>s.calculatePermissions(e))};export{Y as AuthRoute,j as CRITICAL_TRANSLATIONS,fe as CookieManager,le as CrossTabSyncManager,We as CrudiaAutoGenerate,Ye as CrudiaFileField,Je as CrudiaMarkdownField,He as CrudifyInitializationManager,Sr as CrudifyInitializer,Oe as CrudifyLogin,Ae as CrudifyProvider,sr as CrudifyThemeProvider,Ue as DEFAULT_PASSWORD_RULES,Se as ERROR_CODES,ve as ERROR_SEVERITY_MAP,xe as GlobalNotificationProvider,J as GuestRoute,_e as LoginComponent,Ge as POLICY_ACTIONS,De as PREFERRED_POLICY_ORDER,Me as PasswordRequirements,Ke as Policies,V as ProtectedRoute,he as SessionDebugInfo,g as SessionLoadingScreen,C as SessionManager,Ie as SessionProvider,Ve as SessionStatus,se as TokenStorage,te as TranslationService,ie as TranslationsProvider,Ne as UserProfileDisplay,Le as allPasswordRulesPassed,yr as clearCorruptedTokens,ce as createErrorTranslator,de as crossTabSync,kt as crudify,wr as crudifyAdmin,T as crudifyInitManager,ge as decodeJwtSafely,ze as evaluatePasswordRules,M as extractSafeRedirectFromUrl,b as getCookie,ee as getCriticalLanguages,re as getCriticalTranslations,ye as getCurrentUserEmail,Ee as getErrorMessage,be as handleCrudifyError,H as hasCorruptedTokens,W as hasEncryptionKeyHash,B as hasStoredTokens,Re as isTokenExpired,p as logger,Te as parseApiError,we as parseJavaScriptError,ke as parseTransactionError,je as secureLocalStorage,Xe as secureSessionStorage,U as shouldWaitForInitialization,ue as translateError,ae as translateErrorCode,pe as translateErrorCodes,oe as translationService,Ze as useAuth,Be as useAutoGenerate,Pe as useCrudify,vr as useCrudifyInitializer,er as useCrudifyWithNotifications,Qe as useData,qe as useFileUpload,Ce as useGlobalNotification,me as useSession,m as useSessionContext,ne as useTranslations,$e as useUserData,Fe as useUserProfile,E as validateInternalRedirect};
6
+ `});function g({stage:e="loading",message:r}){let o=r||{initializing:"Initializing application...","validating-session":"Validating session...",loading:"Loading..."}[e];return K(lr,{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:ur}),E("p",{style:{fontSize:"1.25em",fontWeight:"500",marginTop:"24px",color:"#1f2937"},children:o})]})]})}var dr=/^[a-zA-Z0-9\-_./\?=&%#]+$/,fr=[/^https?:\/\//i,/^ftp:\/\//i,/^\/\//,/javascript:/i,/data:/i,/vbscript:/i,/about:/i,/\.\.\//,/\.\.\\/,/%2e%2e%2f/i,/%2e%2e%5c/i,/%2f%2f/i,/%5c%5c/i,/[\x00-\x1f\x7f-\x9f]/,/\\/],k=(e,r="/")=>{if(!e||typeof e!="string")return r;let t=e.trim();if(!t)return r;if(!t.startsWith("/"))return p.warn("Open redirect blocked (relative path)",{path:e}),r;if(!dr.test(t))return p.warn("Open redirect blocked (invalid characters)",{path:e}),r;let o=t.toLowerCase();for(let i of fr)if(i.test(o))return p.warn("Open redirect blocked (dangerous pattern)",{path:e}),r;let n=t.split("?")[0].split("/").filter(Boolean);if(n.length===0)return t;for(let i of n)if(i===".."||i.includes(":")||i.length>100)return p.warn("Open redirect blocked (suspicious path part)",{part:i}),r;return t},M=(e,r="/")=>{try{let o=(typeof e=="string"?new URLSearchParams(e):e).get("redirect");if(!o)return r;let n=decodeURIComponent(o);return k(n,r)}catch(t){return p.warn("Error parsing redirect parameter",t instanceof Error?{errorMessage:t.message}:{message:String(t)}),r}};import{Fragment as _,jsx as C}from"react/jsx-runtime";function V({children:e,loadingComponent:r,loginPath:t="/login"}){let{isAuthenticated:o,isLoading:n,isLoggingOut:i,isInitialized:y,tokens:c,error:f}=m(),u=mr();if(!y||n&&!i)return C(_,{children:r||C(g,{stage:"validating-session"})});let l=o&&c?.accessToken&&c.accessToken.length>0;if(f||!o||!l){if(i)return C(z,{to:t,replace:!0});let R=u.pathname+u.search;if(u.pathname===t||u.pathname.startsWith(t))return C(z,{to:t,replace:!0});let S=k(R),w=encodeURIComponent(S);return C(z,{to:`${t}?redirect=${w}`,replace:!0})}return C(_,{children:e})}import{useState as q,useEffect as Rr}from"react";import{Navigate as Cr,useLocation as xr}from"react-router-dom";var L="crudify_tokens",gr="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(gr);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 yr(){try{H()&&localStorage.removeItem(L)}catch{}}import{Fragment as O,jsx as A}from"react/jsx-runtime";function Y({children:e,redirectTo:r="/",loadingComponent:t,initTimeout:o=3e3}){let{isAuthenticated:n,isInitialized:i}=m(),y=xr(),[c]=q(()=>U()),[f,u]=q(!1);if(Rr(()=>{if(!i&&c){let l=setTimeout(()=>{u(!0)},o);return()=>clearTimeout(l)}},[i,c,o]),i&&n){let l=new URLSearchParams(y.search),R=M(l,r);return A(Cr,{to:R,replace:!0})}return i&&!n?A(O,{children:e}):c&&!f?A(O,{children:t||A(g,{stage:"validating-session"})}):A(O,{children:e})}import{Navigate as Ar}from"react-router-dom";import{Fragment as F,jsx as P}from"react/jsx-runtime";function $({children:e,behavior:r="redirect-if-authenticated",redirectTo:t="/",loadingComponent:o}){let{isAuthenticated:n,isInitialized:i}=m();return i?r==="allow-all"?P(F,{children:e}):n?P(Ar,{to:t,replace:!0}):P(F,{children:e}):P(F,{children:o||P(g,{stage:"validating-session"})})}import{createContext as Pr,useContext as Ir,useEffect as hr,useRef as J,useState as N}from"react";import{Fragment as Tr,jsx as Z}from"react/jsx-runtime";var Q=Pr(void 0),Sr=({config:e,children:r,fallback:t=null,onInitialized:o,onError:n})=>{let[i,y]=N(!1),[c,f]=N(!1),[u,l]=N(null),R=J(!1),S=J(!1);hr(()=>{R.current||(T.registerHighPriorityInitializer(),R.current=!0),S.current||(S.current=!0,(async()=>{f(!0),l(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 T.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));l(v),f(!1),n&&n(v)}})())},[e?.publicApiKey,e?.env,e?.enableLogging,o,n]);let w={isInitialized:i,isInitializing:c,error:u};return c&&t?Z(Tr,{children:t}):(u&&p.error("[CrudifyInitializer] Initialization failed",u),Z(Q.Provider,{value:w,children:r}))},vr=()=>{let e=Ir(Q);if(!e)throw new Error("useCrudifyInitializer must be used within CrudifyInitializer");return e};import s from"@nocios/crudify-admin-sdk";var X=!1,I=null,h=null;async function Er(){let r=await x.getInstance().getTokenInfo(),t=r?.apiEndpointAdmin,o=r?.apiKeyEndpointAdmin;return t&&o?{apiUrl:t,apiKey:o}:D.waitForCredentials()}async function kr(){if(!X)return I||(I=(async()=>{try{let e=x.getInstance(),{apiUrl:r,apiKey:t}=await Er();h=(await e.getTokenInfo())?.crudifyTokens?.accessToken||null,s.init({url:r,apiKey:t,getAdditionalHeaders:()=>h?{Authorization:`Bearer ${h}`}:{}}),X=!0}catch(e){throw I=null,p.error("[crudifyAdminWrapper] Initialization failed",e instanceof Error?e:{message:String(e)}),e}})(),I)}async function a(e){try{await kr();let r=x.getInstance();h=(await r.getTokenInfo())?.crudifyTokens?.accessToken||null;let o=await e(),n=o.errors&&(typeof o.errors=="string"&&o.errors.includes("401")||Array.isArray(o.errors)&&o.errors.some(i=>typeof i=="string"&&i.includes("401")));return!o.success&&n?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 wr={listModules:()=>a(()=>s.listModules()),getModule:e=>a(()=>s.getModule(e)),createModule:e=>a(()=>s.createModule(e)),editModule:(e,r)=>a(()=>s.editModule(e,r)),deleteModule:e=>a(()=>s.deleteModule(e)),activateModule:e=>a(()=>s.activateModule(e)),deactivateModule:e=>a(()=>s.deactivateModule(e)),getModuleVersions:e=>a(()=>s.getModuleVersions(e)),listActions:e=>a(()=>s.listActions(e)),getAction:e=>a(()=>s.getAction(e)),createAction:e=>a(()=>s.createAction(e)),editAction:(e,r)=>a(()=>s.editAction(e,r)),deleteAction:e=>a(()=>s.deleteAction(e)),activateAction:e=>a(()=>s.activateAction(e)),deactivateAction:e=>a(()=>s.deactivateAction(e)),getActionVersions:e=>a(()=>s.getActionVersions(e)),getActionsByProfile:e=>a(()=>s.getActionsByProfile(e)),updateActionsProfiles:e=>a(()=>s.updateActionsProfiles(e)),calculatePermissions:e=>a(()=>s.calculatePermissions(e))};export{Y as AuthRoute,j as CRITICAL_TRANSLATIONS,de as CrossTabSyncManager,We as CrudiaAutoGenerate,Ye as CrudiaFileField,$e as CrudiaMarkdownField,He as CrudifyInitializationManager,Sr as CrudifyInitializer,Oe as CrudifyLogin,Ae as CrudifyProvider,sr as CrudifyThemeProvider,Ue as DEFAULT_PASSWORD_RULES,Se as ERROR_CODES,ve as ERROR_SEVERITY_MAP,Ce as GlobalNotificationProvider,$ as GuestRoute,_e as LoginComponent,Ge as POLICY_ACTIONS,De as PREFERRED_POLICY_ORDER,Me as PasswordRequirements,Ke as Policies,V as ProtectedRoute,he as SessionDebugInfo,g as SessionLoadingScreen,x as SessionManager,Ie as SessionProvider,Ve as SessionStatus,ae as TokenStorage,te as TranslationService,ne as TranslationsProvider,Ne as UserProfileDisplay,Le as allPasswordRulesPassed,yr as clearCorruptedTokens,le as createErrorTranslator,fe as crossTabSync,Et as crudify,wr as crudifyAdmin,T as crudifyInitManager,ge as decodeJwtSafely,ze as evaluatePasswordRules,M 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,Re as isTokenExpired,p as logger,Te as parseApiError,we as parseJavaScriptError,Ee as parseTransactionError,b as resolveTenantConfig,je as secureLocalStorage,Xe as secureSessionStorage,U as shouldWaitForInitialization,ce as translateError,pe as translateErrorCode,ue as translateErrorCodes,oe as translationService,Ze as useAuth,Be as useAutoGenerate,Pe as useCrudify,vr as useCrudifyInitializer,er as useCrudifyWithNotifications,Qe as useData,qe as useFileUpload,xe as useGlobalNotification,me as useSession,m as useSessionContext,ie as useTenantConfig,se as useTranslations,Je as useUserData,Fe as useUserProfile,k as validateInternalRedirect};
package/dist/utils.d.mts CHANGED
@@ -1,52 +1,6 @@
1
- export { E as ERROR_CODES, j as ERROR_SEVERITY_MAP, n as ErrorCode, o as ErrorSeverity, q as ErrorTranslationConfig, P as ParsedError, m as createErrorTranslator, d as decodeJwtSafely, a as getCookie, g as getCurrentUserEmail, f as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, e as parseJavaScriptError, c as parseTransactionError, b as secureLocalStorage, s as secureSessionStorage, l as translateError, t as translateErrorCode, k as translateErrorCodes } from './errorTranslation-qwwQTvCO.mjs';
1
+ export { C as ConfigResolverOptions, h as CrudifyEnvironment, E as ERROR_CODES, n as ERROR_SEVERITY_MAP, w as ErrorCode, x as ErrorSeverity, y as ErrorTranslationConfig, P as ParsedError, f as ResolvedConfig, R as ResolvedTenantConfig, T as TenantConfig, b as TenantConfigOptions, v as createErrorTranslator, d as decodeJwtSafely, g as getCurrentUserEmail, m as getErrorMessage, j as handleCrudifyError, i as isTokenExpired, p as parseApiError, l as parseJavaScriptError, k as parseTransactionError, c as resolveConfig, r as resolveTenantConfig, a as secureLocalStorage, s as secureSessionStorage, q as translateError, t as translateErrorCode, o as translateErrorCodes, e as useResolvedConfig, u as useTenantConfig } from './errorTranslation-DeeDj7Vt.mjs';
2
2
  import './api-B4uXiHF0.mjs';
3
3
 
4
- /**
5
- * Sistema centralizado de resolución de configuración para npm-crudify-ui
6
- *
7
- * Prioridad:
8
- * 1. Cookies (producción con Lambda@Edge multitenancy) - MAYOR PRIORIDAD
9
- * 2. Props explícitas (desarrollo local con .env) - FALLBACK
10
- * 3. Error (ninguna configuración disponible)
11
- *
12
- * En producción, Lambda@Edge inyecta cookies con la configuración del tenant.
13
- * En desarrollo local, no hay cookies y se usan las variables de .env como fallback.
14
- */
15
- type CrudifyEnvironment = "dev" | "stg" | "api" | "prod";
16
- interface ResolvedConfig {
17
- publicApiKey?: string;
18
- env?: CrudifyEnvironment;
19
- appName?: string;
20
- logo?: string;
21
- loginActions?: string[];
22
- featureKeys?: string[];
23
- theme?: Record<string, unknown>;
24
- configSource: "props" | "cookies" | "none";
25
- }
26
- interface ConfigResolverOptions {
27
- publicApiKey?: string;
28
- env?: CrudifyEnvironment;
29
- appName?: string;
30
- logo?: string;
31
- loginActions?: string[];
32
- featureKeys?: string[];
33
- enableDebug?: boolean;
34
- }
35
- /**
36
- * Resolves Crudify configuration with the following priority:
37
- * 1. Cookies (production with Lambda multitenancy) - HIGHEST PRIORITY
38
- * 2. Props (local development with .env) - FALLBACK
39
- * 3. None (error - missing configuration)
40
- *
41
- * This resolver is responsible for reading cookies and applying correct priority.
42
- */
43
- declare function resolveConfig(options?: ConfigResolverOptions): ResolvedConfig;
44
- /**
45
- * React hook to use config resolver
46
- * Useful when you need config in a component
47
- */
48
- declare function useResolvedConfig(options?: ConfigResolverOptions): ResolvedConfig;
49
-
50
4
  /**
51
5
  * Event Bus para coordinar acciones de autenticación
52
6
  * Previene race conditions y asegura respuesta única a errores
@@ -172,4 +126,4 @@ declare class NavigationTracker {
172
126
  isActive(): boolean;
173
127
  }
174
128
 
175
- export { type AuthEvent, type AuthEventDetails, type AuthEventType, type ConfigResolverOptions, type CrudifyEnvironment, NavigationTracker, type ResolvedConfig, authEventBus, resolveConfig, useResolvedConfig };
129
+ export { type AuthEvent, type AuthEventDetails, type AuthEventType, NavigationTracker, authEventBus };
package/dist/utils.d.ts CHANGED
@@ -1,52 +1,6 @@
1
- export { E as ERROR_CODES, j as ERROR_SEVERITY_MAP, n as ErrorCode, o as ErrorSeverity, q as ErrorTranslationConfig, P as ParsedError, m as createErrorTranslator, d as decodeJwtSafely, a as getCookie, g as getCurrentUserEmail, f as getErrorMessage, h as handleCrudifyError, i as isTokenExpired, p as parseApiError, e as parseJavaScriptError, c as parseTransactionError, b as secureLocalStorage, s as secureSessionStorage, l as translateError, t as translateErrorCode, k as translateErrorCodes } from './errorTranslation-DGdrMidg.js';
1
+ export { C as ConfigResolverOptions, h as CrudifyEnvironment, E as ERROR_CODES, n as ERROR_SEVERITY_MAP, w as ErrorCode, x as ErrorSeverity, y as ErrorTranslationConfig, P as ParsedError, f as ResolvedConfig, R as ResolvedTenantConfig, T as TenantConfig, b as TenantConfigOptions, v as createErrorTranslator, d as decodeJwtSafely, g as getCurrentUserEmail, m as getErrorMessage, j as handleCrudifyError, i as isTokenExpired, p as parseApiError, l as parseJavaScriptError, k as parseTransactionError, c as resolveConfig, r as resolveTenantConfig, a as secureLocalStorage, s as secureSessionStorage, q as translateError, t as translateErrorCode, o as translateErrorCodes, e as useResolvedConfig, u as useTenantConfig } from './errorTranslation-By5Av0tL.js';
2
2
  import './api-B4uXiHF0.js';
3
3
 
4
- /**
5
- * Sistema centralizado de resolución de configuración para npm-crudify-ui
6
- *
7
- * Prioridad:
8
- * 1. Cookies (producción con Lambda@Edge multitenancy) - MAYOR PRIORIDAD
9
- * 2. Props explícitas (desarrollo local con .env) - FALLBACK
10
- * 3. Error (ninguna configuración disponible)
11
- *
12
- * En producción, Lambda@Edge inyecta cookies con la configuración del tenant.
13
- * En desarrollo local, no hay cookies y se usan las variables de .env como fallback.
14
- */
15
- type CrudifyEnvironment = "dev" | "stg" | "api" | "prod";
16
- interface ResolvedConfig {
17
- publicApiKey?: string;
18
- env?: CrudifyEnvironment;
19
- appName?: string;
20
- logo?: string;
21
- loginActions?: string[];
22
- featureKeys?: string[];
23
- theme?: Record<string, unknown>;
24
- configSource: "props" | "cookies" | "none";
25
- }
26
- interface ConfigResolverOptions {
27
- publicApiKey?: string;
28
- env?: CrudifyEnvironment;
29
- appName?: string;
30
- logo?: string;
31
- loginActions?: string[];
32
- featureKeys?: string[];
33
- enableDebug?: boolean;
34
- }
35
- /**
36
- * Resolves Crudify configuration with the following priority:
37
- * 1. Cookies (production with Lambda multitenancy) - HIGHEST PRIORITY
38
- * 2. Props (local development with .env) - FALLBACK
39
- * 3. None (error - missing configuration)
40
- *
41
- * This resolver is responsible for reading cookies and applying correct priority.
42
- */
43
- declare function resolveConfig(options?: ConfigResolverOptions): ResolvedConfig;
44
- /**
45
- * React hook to use config resolver
46
- * Useful when you need config in a component
47
- */
48
- declare function useResolvedConfig(options?: ConfigResolverOptions): ResolvedConfig;
49
-
50
4
  /**
51
5
  * Event Bus para coordinar acciones de autenticación
52
6
  * Previene race conditions y asegura respuesta única a errores
@@ -172,4 +126,4 @@ declare class NavigationTracker {
172
126
  isActive(): boolean;
173
127
  }
174
128
 
175
- export { type AuthEvent, type AuthEventDetails, type AuthEventType, type ConfigResolverOptions, type CrudifyEnvironment, NavigationTracker, type ResolvedConfig, authEventBus, resolveConfig, useResolvedConfig };
129
+ export { type AuthEvent, type AuthEventDetails, type AuthEventType, NavigationTracker, authEventBus };
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5HFI5CZ5js = require('./chunk-5HFI5CZ5.js');var _chunkNSV6ECYOjs = require('./chunk-NSV6ECYO.js');var _chunkMFYHD6S5js = require('./chunk-MFYHD6S5.js');exports.ERROR_CODES = _chunkNSV6ECYOjs.a; exports.ERROR_SEVERITY_MAP = _chunkNSV6ECYOjs.b; exports.NavigationTracker = _chunkMFYHD6S5js.p; exports.authEventBus = _chunkMFYHD6S5js.e; exports.createErrorTranslator = _chunkMFYHD6S5js.o; exports.decodeJwtSafely = _chunkMFYHD6S5js.q; exports.getCookie = _chunkMFYHD6S5js.b; exports.getCurrentUserEmail = _chunkMFYHD6S5js.r; exports.getErrorMessage = _chunkNSV6ECYOjs.e; exports.handleCrudifyError = _chunkNSV6ECYOjs.g; exports.isTokenExpired = _chunkMFYHD6S5js.s; exports.parseApiError = _chunkNSV6ECYOjs.c; exports.parseJavaScriptError = _chunkNSV6ECYOjs.f; exports.parseTransactionError = _chunkNSV6ECYOjs.d; exports.resolveConfig = _chunkMFYHD6S5js.c; exports.secureLocalStorage = _chunk5HFI5CZ5js.b; exports.secureSessionStorage = _chunk5HFI5CZ5js.a; exports.translateError = _chunkMFYHD6S5js.n; exports.translateErrorCode = _chunkMFYHD6S5js.l; exports.translateErrorCodes = _chunkMFYHD6S5js.m; exports.useResolvedConfig = _chunkMFYHD6S5js.d;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk4VN5YRYZjs = require('./chunk-4VN5YRYZ.js');var _chunkNSV6ECYOjs = require('./chunk-NSV6ECYO.js');var _chunkCR5KJUSTjs = require('./chunk-CR5KJUST.js');exports.ERROR_CODES = _chunkNSV6ECYOjs.a; exports.ERROR_SEVERITY_MAP = _chunkNSV6ECYOjs.b; exports.NavigationTracker = _chunkCR5KJUSTjs.q; exports.authEventBus = _chunkCR5KJUSTjs.f; exports.createErrorTranslator = _chunkCR5KJUSTjs.p; exports.decodeJwtSafely = _chunkCR5KJUSTjs.r; exports.getCurrentUserEmail = _chunkCR5KJUSTjs.s; exports.getErrorMessage = _chunkNSV6ECYOjs.e; exports.handleCrudifyError = _chunkNSV6ECYOjs.g; exports.isTokenExpired = _chunkCR5KJUSTjs.t; exports.parseApiError = _chunkNSV6ECYOjs.c; exports.parseJavaScriptError = _chunkNSV6ECYOjs.f; exports.parseTransactionError = _chunkNSV6ECYOjs.d; exports.resolveConfig = _chunkCR5KJUSTjs.d; exports.resolveTenantConfig = _chunkCR5KJUSTjs.b; exports.secureLocalStorage = _chunk4VN5YRYZjs.b; exports.secureSessionStorage = _chunk4VN5YRYZjs.a; exports.translateError = _chunkCR5KJUSTjs.o; exports.translateErrorCode = _chunkCR5KJUSTjs.m; exports.translateErrorCodes = _chunkCR5KJUSTjs.n; exports.useResolvedConfig = _chunkCR5KJUSTjs.e; exports.useTenantConfig = _chunkCR5KJUSTjs.c;
package/dist/utils.mjs CHANGED
@@ -1 +1 @@
1
- import{a as R,b as c}from"./chunk-JNEWPO2J.mjs";import{a as m,b as v,c as d,d as g,e as u,f as x,g as C}from"./chunk-JAPL7EZJ.mjs";import{b as r,c as e,d as o,e as t,l as a,m as n,n as s,o as E,p as i,q as p,r as f,s as l}from"./chunk-MGJZTOEM.mjs";export{m as ERROR_CODES,v as ERROR_SEVERITY_MAP,i as NavigationTracker,t as authEventBus,E as createErrorTranslator,p as decodeJwtSafely,r as getCookie,f as getCurrentUserEmail,u as getErrorMessage,C as handleCrudifyError,l as isTokenExpired,d as parseApiError,x as parseJavaScriptError,g as parseTransactionError,e as resolveConfig,c as secureLocalStorage,R as secureSessionStorage,s as translateError,a as translateErrorCode,n as translateErrorCodes,o as useResolvedConfig};
1
+ import{a as R,b as y}from"./chunk-RJBX4MWF.mjs";import{a as C,b as v,c as m,d,e as u,f as x,g as T}from"./chunk-JAPL7EZJ.mjs";import{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}from"./chunk-4ILUXVPW.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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocios/crudify-components",
3
- "version": "2.0.1",
3
+ "version": "2.0.6",
4
4
  "engines": {
5
5
  "node": ">=24.12.0"
6
6
  },