acsi-core 1.2.0 → 1.2.1
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.ts +2 -2
- package/dist/index.js +92 -642
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +79 -630
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/timeSpanToLocalMoment.d.ts +2 -2
- package/dist/utils/utcToLocalTime.d.ts +7 -0
- package/package.json +2 -1
- package/dist/components/MSALRedirectHandler/index.d.ts +0 -14
- package/dist/components/UpdateNotifier.d.ts +0 -3
- package/dist/configs/api.d.ts +0 -3
- package/dist/configs/api_removed.d.ts +0 -3
- package/dist/utils/configLoader.d.ts +0 -2
- package/dist/utils/hooks/useServiceWorker.d.ts +0 -1
- package/dist/utils/msalInstance.d.ts +0 -38
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import moment from "moment";
|
|
2
|
-
declare const _default: (time: string) => moment.Moment | null;
|
|
1
|
+
import moment from "moment-timezone";
|
|
2
|
+
declare const _default: (time: string, timezone?: string | undefined) => moment.Moment | null;
|
|
3
3
|
export default _default;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
declare const _default: (time: string, FORMAT?: string | undefined) => string;
|
|
2
|
+
/**
|
|
3
|
+
* Convert a UTC time string to a formatted date string, optionally applying a timezone.
|
|
4
|
+
*
|
|
5
|
+
* - If `timezone` is omitted, the result is converted to the local machine timezone.
|
|
6
|
+
* - If `timezone` is an offset (e.g., "UTC+2", "+02:00"), the offset is applied to the UTC time.
|
|
7
|
+
* - If `timezone` is a named IANA zone (e.g., "Asia/Ho_Chi_Minh"), the time is converted to that zone.
|
|
8
|
+
*/
|
|
2
9
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "acsi-core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Contains core components && functions for acsi-core project",
|
|
5
5
|
"author": "brss",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"link": "^2.1.0",
|
|
33
33
|
"lodash": "^4.17.21",
|
|
34
34
|
"moment": "^2.29.4",
|
|
35
|
+
"moment-timezone": "^0.6.0",
|
|
35
36
|
"node-sass": "^7.0.3",
|
|
36
37
|
"pusher-js": "^8.4.0-rc2",
|
|
37
38
|
"react-google-recaptcha-v3": "^1.10.1",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MSALRedirectHandler component
|
|
3
|
-
*
|
|
4
|
-
* This component handles MSAL redirect authentication flows by processing
|
|
5
|
-
* the hash fragment in the URL before any router code can clear it.
|
|
6
|
-
*
|
|
7
|
-
* Uses useLayoutEffect to run synchronously before browser paint,
|
|
8
|
-
* ensuring it processes the redirect before React Router initializes.
|
|
9
|
-
*
|
|
10
|
-
* This component uses the singleton MSAL instance to avoid conflicts
|
|
11
|
-
* and ensure consistent state management.
|
|
12
|
-
*/
|
|
13
|
-
declare const MSALRedirectHandler: () => null;
|
|
14
|
-
export default MSALRedirectHandler;
|
package/dist/configs/api.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useServiceWorker: () => void;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { IPublicClientApplication, AccountInfo, AuthenticationResult } from "@azure/msal-browser";
|
|
2
|
-
/**
|
|
3
|
-
* Get or create the MSAL singleton instance
|
|
4
|
-
* @param clientId - Microsoft client ID (optional, uses env if not provided)
|
|
5
|
-
* @param redirectUri - Redirect URI (optional, uses env if not provided)
|
|
6
|
-
* @returns MSAL instance
|
|
7
|
-
*/
|
|
8
|
-
export declare const getMSALInstance: (clientId?: string | undefined, redirectUri?: string | undefined) => IPublicClientApplication | null;
|
|
9
|
-
/**
|
|
10
|
-
* Initialize the MSAL instance
|
|
11
|
-
* @param clientId - Microsoft client ID (optional)
|
|
12
|
-
* @param redirectUri - Redirect URI (optional)
|
|
13
|
-
* @returns Promise that resolves when initialization is complete
|
|
14
|
-
*/
|
|
15
|
-
export declare const initializeMSAL: (clientId?: string | undefined, redirectUri?: string | undefined) => Promise<IPublicClientApplication | null>;
|
|
16
|
-
/**
|
|
17
|
-
* Handle MSAL redirect promise
|
|
18
|
-
* This should be called as early as possible, before React Router processes the URL
|
|
19
|
-
* @param clientId - Microsoft client ID (optional)
|
|
20
|
-
* @param redirectUri - Redirect URI (optional)
|
|
21
|
-
* @returns Promise with authentication result or null
|
|
22
|
-
*/
|
|
23
|
-
export declare const handleMSALRedirect: (clientId?: string | undefined, redirectUri?: string | undefined) => Promise<AuthenticationResult | null>;
|
|
24
|
-
/**
|
|
25
|
-
* Check if current URL contains MSAL redirect parameters
|
|
26
|
-
* @returns true if MSAL redirect detected
|
|
27
|
-
*/
|
|
28
|
-
export declare const isMSALRedirect: () => boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Get all accounts from MSAL cache
|
|
31
|
-
* @returns Array of account info
|
|
32
|
-
*/
|
|
33
|
-
export declare const getAllAccounts: () => AccountInfo[];
|
|
34
|
-
/**
|
|
35
|
-
* Get active account
|
|
36
|
-
* @returns Active account or null
|
|
37
|
-
*/
|
|
38
|
-
export declare const getActiveAccount: () => AccountInfo | null;
|