@goralys/core 1.6.5 → 1.6.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/README.md +3 -7
- package/dist/index.d.ts +8 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,12 +3,10 @@
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
This package contains the shared business logic for the [Goralys](https://github.com/SAMSAM-55/Goralys) applications –
|
|
6
|
-
web
|
|
7
|
-
and mobile.
|
|
6
|
+
web and mobile.
|
|
8
7
|
|
|
9
8
|
This package bundles the reusable code for the web frontend and the mobile app to avoid code redundancy and duplication
|
|
10
|
-
|
|
11
|
-
platforms.
|
|
9
|
+
across platforms.
|
|
12
10
|
|
|
13
11
|
### Content Overview
|
|
14
12
|
|
|
@@ -16,9 +14,7 @@ platforms.
|
|
|
16
14
|
- `lib/` – Fetch logic, event listeners, etc.
|
|
17
15
|
- `types/` – Shared TypeScript types
|
|
18
16
|
|
|
19
|
-
The UI components are **not** part of this package
|
|
20
|
-
technologies
|
|
21
|
-
used for rendering are different (HTML/CSS for the web vs React Native components).
|
|
17
|
+
The UI components are **not** part of this package.
|
|
22
18
|
|
|
23
19
|
### Setup
|
|
24
20
|
|
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ type Toast = {
|
|
|
53
53
|
message: string;
|
|
54
54
|
expires?: number;
|
|
55
55
|
};
|
|
56
|
-
type ToastFn = (toast: Toast, duration?: number) => void;
|
|
56
|
+
type ToastFn = (toast: Toast, animate?: boolean, duration?: number) => void;
|
|
57
57
|
|
|
58
58
|
interface ToastConfig {
|
|
59
59
|
getShowToast: () => ToastFn;
|
|
@@ -109,6 +109,12 @@ type AuthToken = {
|
|
|
109
109
|
expires: PHPDateTime;
|
|
110
110
|
created: PHPDateTime;
|
|
111
111
|
};
|
|
112
|
+
type AuditAction = {
|
|
113
|
+
initiator: string;
|
|
114
|
+
type: "add" | "update" | "delete" | "other";
|
|
115
|
+
description: string;
|
|
116
|
+
at: PHPDateTime;
|
|
117
|
+
};
|
|
112
118
|
|
|
113
119
|
declare function useAuthTokens(context: AuthTokenContext, target?: string | null): {
|
|
114
120
|
tokens: AuthToken[] | null;
|
|
@@ -368,4 +374,4 @@ declare function fetchVirtualUsersClient(): Promise<Response>;
|
|
|
368
374
|
declare function fetchAdminsClient(): Promise<Response>;
|
|
369
375
|
declare function fetchVirtualAdminsClient(): Promise<Response>;
|
|
370
376
|
|
|
371
|
-
export { ADMIN_CACHE_RADIX, ADMIN_SYNC_RADIX, AUTH_TOKEN_CACHES, AUTH_TOKEN_CACHE_RADIX, AUTH_TOKEN_SYNCS, AUTH_TOKEN_SYNC_RADIX, type AuthEvent, type AuthToken, type AuthTokenContext, COOKIES_DISMISSED_KEY, type CheckAuthImpl, type ConfirmOptions, type CookieValue, type CookiesAdapter, type DraftModalResult, EMAIL_KEY, FILTER_OPTIONS_CACHE, FILTER_OPTIONS_SYNC, FLASH_TOAST_KEY, FULL_NAME_KEY, GoralysActionHandler, type GoralysClientConfig, type GoralysFetchOptions, HTTP_METHODS, type HttpMethod, type Json, LOGO_PATH, PERSISTANT_COOKIES, PERSISTANT_LOCALS, type PHPDateTime, PUB_ID_KEY, ROLE_KEY, SUBJECT_CACHES, SUBJECT_CACHE_RADIX, SUBJECT_SYNCS, SUBJECT_SYNC_RADIX, SUPPORT_TICKET_CACHE, SUPPORT_TICKET_SYNC, type StorageAdapter, type Subject, type SubjectStatus, SubjectStatusConfig, type SubjectsFilterOptions, type SubjectsSearchField, type SupportReasons, type SupportTicket, type Toast, type ToastConfig, type ToastFn, USERNAME_KEY, USER_CACHES, USER_CACHE_RADIX, USER_ROLES, USER_SYNCS, USER_SYNC_RADIX, type UseSyncedResourceOptions, type User, type UserData, type UserEvent, type UserProfile, type UserRole, type UserType, arrayAny, buildApiUrl, buildArray, cacheUserDataClient, configGoralysCore, configureCheckAuth, configureCookies, configureGoralysClient, configureStorage, configureToast, cookiesGet, cookiesGetAll, cookiesOnChange, cookiesRemove, cookiesSet, emitAuthEvent, emitNavigationEvent, emitUserEvent, emptyUserCacheClient, fetchAdminsClient, fetchAuthTokensForContext, fetchCsrfClient, fetchSubjectsForRoleClient, fetchTokensAdminPanel, fetchTokensProfile, fetchUsersClient, fetchVirtualAdminsClient, fetchVirtualUsersClient, fromPhpDate, getGoralysClientConfig, getLongFromShort, getShortFromLong, getStatusHelper, getStatusLabel, getToastConfig, goralysFetchClient, handleToastRequest, helpContent, isAuthenticated, isFoolsDay, isHTTPMethod, onAuthEvent, onNavigationEvent, onUserEvent, parsePhpDateTime, reasonsConfig, searchFields, separateNames, storageGet, storageKeyAt, storageKeys, storageRemove, storageSet, storageSize, useAdmins, useAuthTokens, useSubjects, useSupportTickets, useSyncedResource, useUsers, useVirtualAdmins, useVirtualUsers };
|
|
377
|
+
export { ADMIN_CACHE_RADIX, ADMIN_SYNC_RADIX, AUTH_TOKEN_CACHES, AUTH_TOKEN_CACHE_RADIX, AUTH_TOKEN_SYNCS, AUTH_TOKEN_SYNC_RADIX, type AuditAction, type AuthEvent, type AuthToken, type AuthTokenContext, COOKIES_DISMISSED_KEY, type CheckAuthImpl, type ConfirmOptions, type CookieValue, type CookiesAdapter, type DraftModalResult, EMAIL_KEY, FILTER_OPTIONS_CACHE, FILTER_OPTIONS_SYNC, FLASH_TOAST_KEY, FULL_NAME_KEY, GoralysActionHandler, type GoralysClientConfig, type GoralysFetchOptions, HTTP_METHODS, type HttpMethod, type Json, LOGO_PATH, PERSISTANT_COOKIES, PERSISTANT_LOCALS, type PHPDateTime, PUB_ID_KEY, ROLE_KEY, SUBJECT_CACHES, SUBJECT_CACHE_RADIX, SUBJECT_SYNCS, SUBJECT_SYNC_RADIX, SUPPORT_TICKET_CACHE, SUPPORT_TICKET_SYNC, type StorageAdapter, type Subject, type SubjectStatus, SubjectStatusConfig, type SubjectsFilterOptions, type SubjectsSearchField, type SupportReasons, type SupportTicket, type Toast, type ToastConfig, type ToastFn, USERNAME_KEY, USER_CACHES, USER_CACHE_RADIX, USER_ROLES, USER_SYNCS, USER_SYNC_RADIX, type UseSyncedResourceOptions, type User, type UserData, type UserEvent, type UserProfile, type UserRole, type UserType, arrayAny, buildApiUrl, buildArray, cacheUserDataClient, configGoralysCore, configureCheckAuth, configureCookies, configureGoralysClient, configureStorage, configureToast, cookiesGet, cookiesGetAll, cookiesOnChange, cookiesRemove, cookiesSet, emitAuthEvent, emitNavigationEvent, emitUserEvent, emptyUserCacheClient, fetchAdminsClient, fetchAuthTokensForContext, fetchCsrfClient, fetchSubjectsForRoleClient, fetchTokensAdminPanel, fetchTokensProfile, fetchUsersClient, fetchVirtualAdminsClient, fetchVirtualUsersClient, fromPhpDate, getGoralysClientConfig, getLongFromShort, getShortFromLong, getStatusHelper, getStatusLabel, getToastConfig, goralysFetchClient, handleToastRequest, helpContent, isAuthenticated, isFoolsDay, isHTTPMethod, onAuthEvent, onNavigationEvent, onUserEvent, parsePhpDateTime, reasonsConfig, searchFields, separateNames, storageGet, storageKeyAt, storageKeys, storageRemove, storageSet, storageSize, useAdmins, useAuthTokens, useSubjects, useSupportTickets, useSyncedResource, useUsers, useVirtualAdmins, useVirtualUsers };
|
package/dist/index.js
CHANGED
|
@@ -522,7 +522,7 @@ async function handleToastRequest(r, showToast, redirect = true, duration) {
|
|
|
522
522
|
const res = r.clone();
|
|
523
523
|
const data = await res.json();
|
|
524
524
|
if (data?.toast) {
|
|
525
|
-
showToast({ type: data.toastType, title: data.toastTitle, message: data.toastMessage }, duration);
|
|
525
|
+
showToast({ type: data.toastType, title: data.toastTitle, message: data.toastMessage }, true, duration);
|
|
526
526
|
if (data?.redirect && redirect) {
|
|
527
527
|
emitNavigationEvent({ type: "redirect", url: data.redirect });
|
|
528
528
|
}
|