@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.
- package/.github/workflows/ci.yml +70 -0
- package/.husky/pre-commit +26 -0
- package/.husky/pre-push +30 -0
- package/.prettierignore +18 -0
- package/.prettierrc +9 -0
- package/README.md +44 -36
- package/README_DEPTH.md +148 -141
- package/coverage/coverage-final.json +83 -83
- package/coverage/index.html +175 -175
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +686 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov.info +22388 -0
- package/dist/{CrudiaMarkdownField-CXAuu-v2.d.ts → CrudiaMarkdownField-CkiBwG-U.d.ts} +8 -8
- package/dist/{CrudiaMarkdownField-TNyMLb-h.d.mts → CrudiaMarkdownField-D-DqiXMQ.d.mts} +8 -8
- package/dist/{GlobalNotificationProvider-Zq18OkpI.d.ts → GlobalNotificationProvider-CdwdNv_8.d.mts} +4 -4
- package/dist/{GlobalNotificationProvider-Zq18OkpI.d.mts → GlobalNotificationProvider-CdwdNv_8.d.ts} +4 -4
- package/dist/chunk-2WAUZ6KI.js +1 -0
- package/dist/chunk-3IGZNZCT.mjs +1 -0
- package/dist/chunk-43L2PP77.mjs +1 -0
- package/dist/chunk-6VS5OT3A.mjs +1 -0
- package/dist/chunk-BWJTTMKS.js +1 -0
- package/dist/chunk-EMPPCCVU.js +1 -0
- package/dist/chunk-J43UPGBE.js +1 -0
- package/dist/chunk-K6ZRXOJ7.mjs +1 -0
- package/dist/chunk-RYQQZTEP.js +1 -0
- package/dist/chunk-VTMSOK4V.mjs +1 -0
- package/dist/components.d.mts +3 -3
- package/dist/components.d.ts +3 -3
- package/dist/components.js +1 -1
- package/dist/components.mjs +1 -1
- package/dist/{errorTranslation-D-Y7uNN_.d.mts → errorTranslation-BcX8AaK7.d.mts} +5 -5
- package/dist/{errorTranslation-DDlAXpMl.d.ts → errorTranslation-CF-5JClP.d.ts} +5 -5
- package/dist/hooks.d.mts +3 -3
- package/dist/hooks.d.ts +3 -3
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/{index-U--xRr8A.d.mts → index-D06kTP0C.d.mts} +18 -18
- package/dist/{index-dXVRVcEB.d.ts → index-DEDnmsdO.d.ts} +18 -18
- package/dist/index.d.mts +361 -361
- package/dist/index.d.ts +361 -361
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{tenantConfig-DqJqQkoR.d.mts → tenantConfig-CYnS9TPV.d.mts} +14 -8
- package/dist/{tenantConfig-DqJqQkoR.d.ts → tenantConfig-CYnS9TPV.d.ts} +14 -8
- package/dist/utils.d.mts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +1 -1
- package/eslint.config.mjs +140 -0
- package/package.json +34 -5
- package/scripts/bump-version.cjs +23 -0
- package/sonar-project.properties +23 -0
- package/tests/helpers/testUtils.tsx +89 -0
- package/tests/hooks/useSession/testUtils.tsx +212 -0
- package/tests/setup.ts +139 -0
- package/tests/vitest.d.ts +1 -0
- package/vitest.config.ts +20 -9
- package/.github/workflows/test.yml +0 -59
- package/dist/chunk-2IOB6HHT.js +0 -1
- package/dist/chunk-2WHCDP7V.mjs +0 -1
- package/dist/chunk-37WOWEJG.js +0 -1
- package/dist/chunk-44VU4TSP.mjs +0 -1
- package/dist/chunk-4LMFQECS.js +0 -1
- package/dist/chunk-BXFEQ6KP.js +0 -1
- package/dist/chunk-MFQKGZI4.js +0 -1
- package/dist/chunk-NJERBWND.mjs +0 -1
- package/dist/chunk-WMLIOPUC.mjs +0 -1
- package/dist/chunk-XMEZUDF6.mjs +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { U as UserProfile,
|
|
1
|
+
import { U as UserProfile, h as CrudifyRequestOptions, f as CrudifyApiResponse, l as TransactionInput, g as CrudifyOperationOptions } from './tenantConfig-CYnS9TPV.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import { CrudifyResponse } from '@nocios/crudify-sdk';
|
|
5
|
-
import { b as NotificationSeverity } from './GlobalNotificationProvider-
|
|
5
|
+
import { b as NotificationSeverity } from './GlobalNotificationProvider-CdwdNv_8.js';
|
|
6
6
|
|
|
7
7
|
type TokenData = {
|
|
8
8
|
accessToken: string;
|
|
@@ -12,7 +12,7 @@ type TokenData = {
|
|
|
12
12
|
apiEndpointAdmin?: string;
|
|
13
13
|
apiKeyEndpointAdmin?: string;
|
|
14
14
|
};
|
|
15
|
-
type StorageType =
|
|
15
|
+
type StorageType = 'localStorage' | 'sessionStorage' | 'none';
|
|
16
16
|
declare class TokenStorage {
|
|
17
17
|
private static readonly TOKEN_KEY;
|
|
18
18
|
private static readonly ENCRYPTION_KEY_STORAGE;
|
|
@@ -165,12 +165,12 @@ type SessionConfig = {
|
|
|
165
165
|
onSessionRestored?: (tokens: TokenData) => void;
|
|
166
166
|
onLoginSuccess?: (tokens: TokenData) => void;
|
|
167
167
|
onLogout?: () => void;
|
|
168
|
-
showNotification?: (message: string, severity?:
|
|
168
|
+
showNotification?: (message: string, severity?: 'error' | 'info' | 'success' | 'warning') => void;
|
|
169
169
|
translateFn?: (key: string) => string;
|
|
170
170
|
apiEndpointAdmin?: string;
|
|
171
171
|
apiKeyEndpointAdmin?: string;
|
|
172
172
|
publicApiKey?: string;
|
|
173
|
-
env?:
|
|
173
|
+
env?: 'dev' | 'stg' | 'api' | 'prod';
|
|
174
174
|
};
|
|
175
175
|
/**
|
|
176
176
|
* Response data from a successful login
|
|
@@ -314,7 +314,7 @@ declare class SessionManager {
|
|
|
314
314
|
* La renovación de tokens se maneja en useSession con lógica de TTL
|
|
315
315
|
* @returns 'logout' si debe desloguear por inactividad, 'none' si no hace nada
|
|
316
316
|
*/
|
|
317
|
-
checkInactivity():
|
|
317
|
+
checkInactivity(): 'logout' | 'none';
|
|
318
318
|
/**
|
|
319
319
|
* Limpiar sesión completamente
|
|
320
320
|
*/
|
|
@@ -350,12 +350,12 @@ type UseSessionOptions = {
|
|
|
350
350
|
enableLogging?: boolean;
|
|
351
351
|
onSessionExpired?: () => void;
|
|
352
352
|
onSessionRestored?: (tokens: TokenData) => void;
|
|
353
|
-
showNotification?: (message: string, severity?:
|
|
353
|
+
showNotification?: (message: string, severity?: 'error' | 'info' | 'success' | 'warning') => void;
|
|
354
354
|
translateFn?: (key: string) => string;
|
|
355
355
|
apiEndpointAdmin?: string;
|
|
356
356
|
apiKeyEndpointAdmin?: string;
|
|
357
357
|
publicApiKey?: string;
|
|
358
|
-
env?:
|
|
358
|
+
env?: 'dev' | 'stg' | 'api' | 'prod';
|
|
359
359
|
};
|
|
360
360
|
/**
|
|
361
361
|
* Retorno completo del hook useSession
|
|
@@ -408,7 +408,7 @@ type SessionData = {
|
|
|
408
408
|
} | null;
|
|
409
409
|
type CrudifyConfig = {
|
|
410
410
|
publicApiKey?: string;
|
|
411
|
-
env?:
|
|
411
|
+
env?: 'dev' | 'stg' | 'api' | 'prod';
|
|
412
412
|
appName?: string;
|
|
413
413
|
loginActions?: string[];
|
|
414
414
|
logo?: string;
|
|
@@ -426,7 +426,7 @@ type SessionContextType = {
|
|
|
426
426
|
logout: () => Promise<void>;
|
|
427
427
|
refreshTokens: () => Promise<boolean>;
|
|
428
428
|
clearError: () => void;
|
|
429
|
-
getTokenInfo: () => ReturnType<typeof useSession>[
|
|
429
|
+
getTokenInfo: () => ReturnType<typeof useSession>['getTokenInfo'] extends () => infer R ? R : unknown;
|
|
430
430
|
isExpiringSoon: boolean;
|
|
431
431
|
expiresIn: number;
|
|
432
432
|
refreshExpiresIn: number;
|
|
@@ -436,8 +436,8 @@ type NotificationOptions = {
|
|
|
436
436
|
maxNotifications?: number;
|
|
437
437
|
defaultAutoHideDuration?: number;
|
|
438
438
|
position?: {
|
|
439
|
-
vertical:
|
|
440
|
-
horizontal:
|
|
439
|
+
vertical: 'top' | 'bottom';
|
|
440
|
+
horizontal: 'left' | 'center' | 'right';
|
|
441
441
|
};
|
|
442
442
|
allowHtml?: boolean;
|
|
443
443
|
};
|
|
@@ -465,7 +465,7 @@ declare function SessionDebugInfo(): react_jsx_runtime.JSX.Element;
|
|
|
465
465
|
/**
|
|
466
466
|
* Individual file status
|
|
467
467
|
*/
|
|
468
|
-
type FileStatus =
|
|
468
|
+
type FileStatus = 'pending' | 'uploading' | 'completed' | 'error' | 'removing' | 'pendingDeletion';
|
|
469
469
|
/**
|
|
470
470
|
* Represents a file in the system
|
|
471
471
|
*/
|
|
@@ -491,7 +491,7 @@ interface FileItem {
|
|
|
491
491
|
* File visibility
|
|
492
492
|
* Extracted from filePath for convenience
|
|
493
493
|
*/
|
|
494
|
-
visibility?:
|
|
494
|
+
visibility?: 'public' | 'private';
|
|
495
495
|
/** Public URL for public files */
|
|
496
496
|
publicUrl?: string;
|
|
497
497
|
/** Preview URL (for images) */
|
|
@@ -521,7 +521,7 @@ interface UseFileUploadOptions {
|
|
|
521
521
|
* Visibility of uploaded files
|
|
522
522
|
* @default "private"
|
|
523
523
|
*/
|
|
524
|
-
visibility?:
|
|
524
|
+
visibility?: 'public' | 'private';
|
|
525
525
|
/** Callback when an upload completes successfully */
|
|
526
526
|
onUploadComplete?: (file: FileItem) => void;
|
|
527
527
|
/** Callback when an upload fails */
|
|
@@ -531,7 +531,7 @@ interface UseFileUploadOptions {
|
|
|
531
531
|
/** Callback when the file list changes */
|
|
532
532
|
onFilesChange?: (files: FileItem[]) => void;
|
|
533
533
|
/** Form mode: 'create' or 'edit' - affects delete behavior */
|
|
534
|
-
mode?:
|
|
534
|
+
mode?: 'create' | 'edit';
|
|
535
535
|
}
|
|
536
536
|
/**
|
|
537
537
|
* Hook return type
|
|
@@ -712,7 +712,7 @@ interface UseAuthReturn {
|
|
|
712
712
|
isExpiringSoon: boolean;
|
|
713
713
|
expiresIn: number;
|
|
714
714
|
refreshExpiresIn: number;
|
|
715
|
-
getTokenInfo: () => ReturnType<SessionContextType[
|
|
715
|
+
getTokenInfo: () => ReturnType<SessionContextType['getTokenInfo']>;
|
|
716
716
|
clearError: () => void;
|
|
717
717
|
}
|
|
718
718
|
/**
|
|
@@ -903,4 +903,4 @@ declare const useCrudifyWithNotifications: (options?: CrudifyWithNotificationsOp
|
|
|
903
903
|
shouldShowNotification: typeof shouldShowNotification;
|
|
904
904
|
};
|
|
905
905
|
|
|
906
|
-
export { type FileItem as F, type LoginResult as L, type NotificationOptions as N,
|
|
906
|
+
export { type FileItem as F, type LoginResult as L, type NotificationOptions as N, type SessionConfig as S, type TokenData as T, type UseAuthReturn as U, type FileStatus as a, SessionDebugInfo as b, SessionManager as c, SessionProvider as d, type SessionProviderProps as e, type SessionState as f, type StorageType as g, TokenStorage as h, type UseDataReturn as i, type UseFileUploadOptions as j, type UseFileUploadReturn as k, type UseSessionOptions as l, type UseUserDataOptions as m, type UseUserDataReturn as n, type UserData as o, useCrudifyWithNotifications as p, useData as q, useFileUpload as r, useSession as s, useSessionContext as t, useAuth as u, useUserData as v, useUserProfile as w };
|