acsi-core 0.1.0 → 0.1.2

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.
Files changed (42) hide show
  1. package/dist/.DS_Store +0 -0
  2. package/dist/components/CoreButton/index.d.ts +10 -0
  3. package/dist/components/CoreCheckbox/index.d.ts +10 -0
  4. package/dist/components/CoreError/index.d.ts +6 -0
  5. package/dist/components/CoreInput/index.d.ts +13 -0
  6. package/dist/components/CoreModal/index.d.ts +9 -0
  7. package/dist/components/CoreRadio/index.d.ts +14 -0
  8. package/dist/components/CoreSelect/index.d.ts +18 -0
  9. package/dist/components/Dialogs/CommonDialog.d.ts +3 -0
  10. package/dist/components/Paginations/CustomPagination.d.ts +8 -0
  11. package/dist/components/Selects/CustomAsyncSelect.d.ts +3 -0
  12. package/dist/components/Selects/CustomCreatable.d.ts +3 -0
  13. package/dist/components/Selects/CustomSelect.d.ts +3 -0
  14. package/dist/components/Selects/CustomSelectOption.d.ts +3 -0
  15. package/dist/components/Selects/partials/index.d.ts +4 -0
  16. package/dist/components/Selects/theme/styles.d.ts +6 -0
  17. package/dist/components/index.d.ts +7 -0
  18. package/dist/configs/constants.d.ts +11 -0
  19. package/dist/containers/Login/configs/constants.d.ts +9 -0
  20. package/dist/containers/Login/configs/default.d.ts +1 -0
  21. package/dist/containers/Login/views/block/BlockLogin.d.ts +1 -5
  22. package/dist/icons8-google-96~UAyNiMJa.svg +1 -0
  23. package/dist/index.css +247 -34
  24. package/dist/index.d.ts +12 -2
  25. package/dist/index.js +848 -745
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.modern.js +823 -748
  28. package/dist/index.modern.js.map +1 -1
  29. package/dist/layouts/LayoutContext.d.ts +1 -0
  30. package/dist/layouts/TheLanguageDropdown.d.ts +3 -0
  31. package/dist/redux/commons/action.d.ts +2 -0
  32. package/dist/services/accountService.d.ts +5 -0
  33. package/dist/utils/constants.d.ts +18 -5
  34. package/dist/utils/getErrorMessage.d.ts +1 -0
  35. package/dist/utils/hooks/index.d.ts +3 -0
  36. package/dist/utils/hooks/useGoogleSignOut.d.ts +10 -0
  37. package/dist/utils/hooks/useLanguage.d.ts +12 -0
  38. package/dist/utils/hooks/useLogin.d.ts +7 -0
  39. package/dist/utils/icons.d.ts +3 -0
  40. package/dist/utils/types/login.d.ts +33 -0
  41. package/dist/utils/types.d.ts +1 -0
  42. package/package.json +12 -4
@@ -1,6 +1,7 @@
1
1
  import { FC, PropsWithChildren } from "react";
2
2
  interface Props {
3
3
  onNavigate: (pathname: string) => void;
4
+ role: string;
4
5
  }
5
6
  declare const LayoutContext: FC<Props & PropsWithChildren>;
6
7
  export default LayoutContext;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const TheLanguageDropdown: () => React.JSX.Element;
3
+ export default TheLanguageDropdown;
@@ -1,3 +1,5 @@
1
1
  export declare const setLoading: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<boolean | undefined, string>;
2
2
  export declare const setAlert: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
3
3
  export declare const setUser: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
4
+ export declare const setLanguage: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>;
5
+ export declare const reset: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<undefined, string>;
@@ -1 +1,6 @@
1
+ import { LoginAccessTokenRequest, LoginRequest } from "../utils/types/login";
1
2
  export declare const getInfo: () => Promise<import("axios").AxiosResponse<any, any>>;
3
+ export declare const getSuperAdminInfoFromWeb: () => Promise<import("axios").AxiosResponse<any, any>>;
4
+ export declare const apiLoginGoogle: (body: LoginRequest) => Promise<import("axios").AxiosResponse<any, any>>;
5
+ export declare const apiLoginGoogleSuperAdmin: (body: LoginRequest) => Promise<import("axios").AxiosResponse<any, any>>;
6
+ export declare const apiLoginWithAccessToken: (body: LoginAccessTokenRequest, domain?: string | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -1,8 +1,21 @@
1
- export declare const GOOGLE_RECAPTCHA_KEY = "6LfNtLUaAAAAAL24lbBV11jS-gBtt1mhtxb4NXs0";
2
- export declare const GOOGLE_CLIENT_ID = "64118819726-0qlur4qjrs9jbuu6rnoa0u91g680lmpg.apps.googleusercontent.com";
3
- export declare const GOOGLE_RECAPTCHA_ID = "6LfNtLUaAAAAAL24lbBV11jS-gBtt1mhtxb4NXs0";
4
- export declare const GOOGLE_RECAPTCHA_SECRET = "6LfNtLUaAAAAAC7zhleGzO61FgFwGF0H5FAsKYux";
1
+ export declare const GOOGLE_RECAPTCHA_KEY: string;
2
+ export declare const GOOGLE_CLIENT_ID: string;
3
+ export declare const GOOGLE_RECAPTCHA_ID: string;
4
+ export declare const GOOGLE_RECAPTCHA_SECRET: string;
5
+ export declare const BASE_URL: string;
6
+ export declare const SUPER_ADMIN_BASE_URL: string;
7
+ export declare const PUSHER_CONFIG: {
8
+ cluster: string;
9
+ key: string;
10
+ };
5
11
  export declare const ACCESS_TOKEN = "ACCESS_TOKEN";
6
- export declare const BASE_URL = "https://localhost:5000";
12
+ export declare const ACADEMY_DOMAIN = "ACADEMY_DOMAIN";
13
+ export declare const AcademyHeaders = "Academy-Headers";
14
+ export declare const DATE_MIN_VALUE = "0001-01-01T00:00:00+00:00";
15
+ export declare const DATE_TIME_MIN_VALUE = "0001-01-01T00:00:00";
16
+ export declare const EXAM_CHANNEL = "presence-exam-channel";
17
+ export declare const EXAM_STUDENT_CHANNEL = "EXAM-CHANNEL-{examCode}-STUDENT-{studentId}";
18
+ export declare const DefaultErrorMessage = "an_unexpected_error_has_occurred";
7
19
  export declare const getAccessToken: () => string | null;
20
+ export declare const getAcademyDomain: () => string | null;
8
21
  export declare const encodeParams: (params: any) => string;
@@ -0,0 +1 @@
1
+ export declare const getErrorMessage: (error: any, defaultErrorMessage?: string | undefined) => string;
@@ -0,0 +1,3 @@
1
+ import useAutoAcademyDomain from "./useAutoAcademyDomain";
2
+ import useLogin from "./useLogin";
3
+ export { useLogin, useAutoAcademyDomain };
@@ -0,0 +1,10 @@
1
+ interface Props {
2
+ onLogoutSuccess?: () => void;
3
+ onFailure?: () => void;
4
+ onNavigate: Function;
5
+ }
6
+ declare const useGoogleSignOut: (props: Props) => {
7
+ handleSignOut: (isRemoveDomainStorage?: boolean) => void;
8
+ loaded: boolean;
9
+ };
10
+ export default useGoogleSignOut;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { Language } from "../../configs/constants";
3
+ import "moment/locale/ko.js";
4
+ import "moment/locale/en-au.js";
5
+ declare const useLanguage: () => {
6
+ language: string;
7
+ dropdownOpen: boolean;
8
+ currentLanguage: Language | null;
9
+ toggle: () => void;
10
+ setItemLanguage: import("react").Dispatch<import("react").SetStateAction<string>>;
11
+ };
12
+ export default useLanguage;
@@ -0,0 +1,7 @@
1
+ import { LoginAccessTokenRequest, LoginRequest } from "../types/login";
2
+ declare const useLogin: (onNavigate: (pathname: string) => void, homeAcademyUrl: string, homeUrl: string, registerUrl?: string | undefined) => {
3
+ handleLoginGoogle: (data: LoginRequest, isLogout?: boolean) => Promise<void>;
4
+ handleLoginAccessToken: (data: LoginAccessTokenRequest, isLogout?: boolean, domain?: string | undefined) => Promise<void>;
5
+ redirectLoginUser: (data: any, token: string, redirectUrl?: string | undefined) => void;
6
+ };
7
+ export default useLogin;
@@ -0,0 +1,3 @@
1
+ export declare const icons: {
2
+ ErrorRedIcon: string;
3
+ };
@@ -0,0 +1,33 @@
1
+ export declare type LoginRequest = {
2
+ imageUrl: string;
3
+ fullName: string;
4
+ email: string;
5
+ token: string;
6
+ googleId: string;
7
+ role: string;
8
+ };
9
+ export declare type LoginAccessTokenRequest = {
10
+ accessToken: string;
11
+ email: string;
12
+ academyId?: number;
13
+ role: string;
14
+ };
15
+ export declare type LoginResponse = {
16
+ token: string;
17
+ isFirstLogin: boolean;
18
+ user: UserResponse;
19
+ };
20
+ export declare type UserResponse = {
21
+ id: number;
22
+ phoneNumber?: string;
23
+ email: string;
24
+ avatar: string;
25
+ fulName: string;
26
+ className: string;
27
+ parentPhoneNumber: string;
28
+ parentName: string;
29
+ major: string;
30
+ schoolName: string;
31
+ academyDomain?: string;
32
+ roles: string[];
33
+ };
@@ -1,3 +1,4 @@
1
1
  export interface INavigateProps {
2
2
  onNavigate: (pathname: string) => void;
3
+ role: string;
3
4
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "acsi-core",
3
- "version": "0.1.0",
4
- "description": "Contains core components && functions for TouchStudy project",
3
+ "version": "0.1.2",
4
+ "description": "Contains core components && functions for acsi-core project",
5
5
  "author": "brss",
6
6
  "license": "MIT",
7
7
  "repository": "brss/acsi-core",
@@ -13,22 +13,29 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "@leecheuk/react-google-login": "^5.4.1",
16
+ "@mui/material": "^5.14.12",
16
17
  "@reduxjs/toolkit": "^2.0.1",
17
18
  "axios": "^1.6.2",
18
19
  "formik": "^2.4.5",
19
20
  "gapi-script": "^1.2.0",
21
+ "i18next": "^23.7.16",
20
22
  "link": "^2.1.0",
23
+ "lodash": "^4.17.21",
21
24
  "moment": "^2.29.4",
22
25
  "node-sass": "^7.0.3",
26
+ "pusher-js": "^8.4.0-rc2",
23
27
  "react-google-recaptcha-v3": "^1.10.1",
28
+ "react-i18next": "^14.0.0",
29
+ "react-icons": "^4.12.0",
30
+ "react-select": "^5.9.0",
31
+ "react-toastify": "^9.1.3",
24
32
  "reactstrap": "^9.2.1",
25
33
  "yup": "^1.3.3"
26
34
  },
27
35
  "peerDependencies": {
28
36
  "react": "^18.2.0",
29
37
  "react-dom": "^18.2.0",
30
- "react-redux": "^9.0.4",
31
- "react-router-dom": "^5.2.0"
38
+ "react-redux": "^9.0.4"
32
39
  },
33
40
  "scripts": {
34
41
  "build": "microbundle-crl --no-compress --format modern,cjs",
@@ -49,6 +56,7 @@
49
56
  "@testing-library/react": "^13.4.0",
50
57
  "@testing-library/user-event": "^13.5.0",
51
58
  "@types/jest": "^27.5.2",
59
+ "@types/lodash": "^4.14.202",
52
60
  "@types/node": "^16.18.68",
53
61
  "@types/react": "^18.2.45",
54
62
  "@types/react-dom": "^18.2.18",