@nocios/crudify-ui 1.0.45 → 1.0.47
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 +48 -1
- package/dist/index.d.ts +48 -1
- package/dist/index.js +404 -167
- package/dist/index.mjs +332 -100
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as _nocios_crudify_browser from '@nocios/crudify-browser';
|
|
1
2
|
export * from '@nocios/crudify-browser';
|
|
2
3
|
export { default as crudify } from '@nocios/crudify-browser';
|
|
3
4
|
import React from 'react';
|
|
@@ -15,6 +16,9 @@ interface CrudifyLoginConfig {
|
|
|
15
16
|
};
|
|
16
17
|
loginActions?: string[];
|
|
17
18
|
}
|
|
19
|
+
interface CrudifyLoginTranslations {
|
|
20
|
+
[key: string]: string | CrudifyLoginTranslations;
|
|
21
|
+
}
|
|
18
22
|
interface CrudifyLoginProps {
|
|
19
23
|
config?: CrudifyLoginConfig;
|
|
20
24
|
onNavigate?: (path: string) => void;
|
|
@@ -23,10 +27,53 @@ interface CrudifyLoginProps {
|
|
|
23
27
|
initialScreen?: BoxScreenType;
|
|
24
28
|
redirectUrl?: string;
|
|
25
29
|
autoReadFromCookies?: boolean;
|
|
30
|
+
translations?: CrudifyLoginTranslations;
|
|
31
|
+
language?: string;
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
declare const CrudifyLogin: React.FC<CrudifyLoginProps>;
|
|
29
35
|
|
|
36
|
+
interface UseUserProfileOptions {
|
|
37
|
+
autoFetch?: boolean;
|
|
38
|
+
retryOnError?: boolean;
|
|
39
|
+
maxRetries?: number;
|
|
40
|
+
}
|
|
41
|
+
interface UseUserProfileReturn {
|
|
42
|
+
userProfile: any | null;
|
|
43
|
+
loading: boolean;
|
|
44
|
+
error: string | null;
|
|
45
|
+
refreshProfile: () => Promise<void>;
|
|
46
|
+
clearProfile: () => void;
|
|
47
|
+
}
|
|
48
|
+
declare const useUserProfile: (options?: UseUserProfileOptions) => UseUserProfileReturn;
|
|
49
|
+
|
|
50
|
+
interface UseCrudifyLoginOptions {
|
|
51
|
+
showErrorNotifications?: boolean;
|
|
52
|
+
showSuccessNotifications?: boolean;
|
|
53
|
+
}
|
|
54
|
+
declare const useCrudifyLogin: (config: CrudifyLoginConfig, _options?: UseCrudifyLoginOptions) => {
|
|
55
|
+
crudify: {
|
|
56
|
+
login: (identifier: string, password: string) => Promise<_nocios_crudify_browser.CrudifyResponse>;
|
|
57
|
+
transaction: (data: any, options?: {
|
|
58
|
+
signal?: AbortSignal;
|
|
59
|
+
}) => Promise<_nocios_crudify_browser.CrudifyResponse>;
|
|
60
|
+
} | null;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
interface JWTPayload {
|
|
64
|
+
email?: string;
|
|
65
|
+
"cognito:username"?: string;
|
|
66
|
+
sub?: string;
|
|
67
|
+
exp?: number;
|
|
68
|
+
iat?: number;
|
|
69
|
+
iss?: string;
|
|
70
|
+
aud?: string;
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
}
|
|
73
|
+
declare const decodeJwtSafely: (token: string) => JWTPayload | null;
|
|
74
|
+
declare const getCurrentUserEmail: () => string | null;
|
|
75
|
+
declare const isTokenExpired: (token: string) => boolean;
|
|
76
|
+
|
|
30
77
|
declare const getCookie: (name: string) => string | null;
|
|
31
78
|
|
|
32
79
|
declare class SecureStorage {
|
|
@@ -43,4 +90,4 @@ declare class SecureStorage {
|
|
|
43
90
|
declare const secureSessionStorage: SecureStorage;
|
|
44
91
|
declare const secureLocalStorage: SecureStorage;
|
|
45
92
|
|
|
46
|
-
export { type BoxScreenType, CrudifyLogin, type CrudifyLoginConfig, type CrudifyLoginProps, getCookie, secureLocalStorage, secureSessionStorage };
|
|
93
|
+
export { type BoxScreenType, CrudifyLogin, type CrudifyLoginConfig, type CrudifyLoginProps, type CrudifyLoginTranslations, decodeJwtSafely, getCookie, getCurrentUserEmail, isTokenExpired, secureLocalStorage, secureSessionStorage, useCrudifyLogin, useUserProfile };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as _nocios_crudify_browser from '@nocios/crudify-browser';
|
|
1
2
|
export * from '@nocios/crudify-browser';
|
|
2
3
|
export { default as crudify } from '@nocios/crudify-browser';
|
|
3
4
|
import React from 'react';
|
|
@@ -15,6 +16,9 @@ interface CrudifyLoginConfig {
|
|
|
15
16
|
};
|
|
16
17
|
loginActions?: string[];
|
|
17
18
|
}
|
|
19
|
+
interface CrudifyLoginTranslations {
|
|
20
|
+
[key: string]: string | CrudifyLoginTranslations;
|
|
21
|
+
}
|
|
18
22
|
interface CrudifyLoginProps {
|
|
19
23
|
config?: CrudifyLoginConfig;
|
|
20
24
|
onNavigate?: (path: string) => void;
|
|
@@ -23,10 +27,53 @@ interface CrudifyLoginProps {
|
|
|
23
27
|
initialScreen?: BoxScreenType;
|
|
24
28
|
redirectUrl?: string;
|
|
25
29
|
autoReadFromCookies?: boolean;
|
|
30
|
+
translations?: CrudifyLoginTranslations;
|
|
31
|
+
language?: string;
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
declare const CrudifyLogin: React.FC<CrudifyLoginProps>;
|
|
29
35
|
|
|
36
|
+
interface UseUserProfileOptions {
|
|
37
|
+
autoFetch?: boolean;
|
|
38
|
+
retryOnError?: boolean;
|
|
39
|
+
maxRetries?: number;
|
|
40
|
+
}
|
|
41
|
+
interface UseUserProfileReturn {
|
|
42
|
+
userProfile: any | null;
|
|
43
|
+
loading: boolean;
|
|
44
|
+
error: string | null;
|
|
45
|
+
refreshProfile: () => Promise<void>;
|
|
46
|
+
clearProfile: () => void;
|
|
47
|
+
}
|
|
48
|
+
declare const useUserProfile: (options?: UseUserProfileOptions) => UseUserProfileReturn;
|
|
49
|
+
|
|
50
|
+
interface UseCrudifyLoginOptions {
|
|
51
|
+
showErrorNotifications?: boolean;
|
|
52
|
+
showSuccessNotifications?: boolean;
|
|
53
|
+
}
|
|
54
|
+
declare const useCrudifyLogin: (config: CrudifyLoginConfig, _options?: UseCrudifyLoginOptions) => {
|
|
55
|
+
crudify: {
|
|
56
|
+
login: (identifier: string, password: string) => Promise<_nocios_crudify_browser.CrudifyResponse>;
|
|
57
|
+
transaction: (data: any, options?: {
|
|
58
|
+
signal?: AbortSignal;
|
|
59
|
+
}) => Promise<_nocios_crudify_browser.CrudifyResponse>;
|
|
60
|
+
} | null;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
interface JWTPayload {
|
|
64
|
+
email?: string;
|
|
65
|
+
"cognito:username"?: string;
|
|
66
|
+
sub?: string;
|
|
67
|
+
exp?: number;
|
|
68
|
+
iat?: number;
|
|
69
|
+
iss?: string;
|
|
70
|
+
aud?: string;
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
}
|
|
73
|
+
declare const decodeJwtSafely: (token: string) => JWTPayload | null;
|
|
74
|
+
declare const getCurrentUserEmail: () => string | null;
|
|
75
|
+
declare const isTokenExpired: (token: string) => boolean;
|
|
76
|
+
|
|
30
77
|
declare const getCookie: (name: string) => string | null;
|
|
31
78
|
|
|
32
79
|
declare class SecureStorage {
|
|
@@ -43,4 +90,4 @@ declare class SecureStorage {
|
|
|
43
90
|
declare const secureSessionStorage: SecureStorage;
|
|
44
91
|
declare const secureLocalStorage: SecureStorage;
|
|
45
92
|
|
|
46
|
-
export { type BoxScreenType, CrudifyLogin, type CrudifyLoginConfig, type CrudifyLoginProps, getCookie, secureLocalStorage, secureSessionStorage };
|
|
93
|
+
export { type BoxScreenType, CrudifyLogin, type CrudifyLoginConfig, type CrudifyLoginProps, type CrudifyLoginTranslations, decodeJwtSafely, getCookie, getCurrentUserEmail, isTokenExpired, secureLocalStorage, secureSessionStorage, useCrudifyLogin, useUserProfile };
|