@fctc/edu-logic-lib 1.1.8 → 1.1.10
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/chunk-227GQM56.mjs +295 -0
- package/dist/chunk-2QWNSNZX.mjs +62 -0
- package/dist/chunk-3B6NWGPJ.js +303 -0
- package/dist/chunk-6BLY7NZ6.mjs +120 -0
- package/dist/chunk-7JD5GMIZ.js +2 -0
- package/dist/chunk-7L75ULY6.js +32 -0
- package/dist/chunk-ELARQVCE.mjs +2344 -0
- package/dist/chunk-FVGPSTJ7.js +122 -0
- package/dist/chunk-GGOFXFSX.js +2362 -0
- package/dist/chunk-IX7MI3OE.mjs +1059 -0
- package/dist/chunk-IXDDYGKE.js +61 -0
- package/dist/chunk-MLJQPO4Q.mjs +57 -0
- package/dist/chunk-OBR6UTC5.mjs +1 -0
- package/dist/chunk-ODQQQ7WA.js +94 -0
- package/dist/chunk-PG7J6HGQ.js +66 -0
- package/dist/chunk-QLUONJPQ.mjs +519 -0
- package/dist/chunk-QYYFZUNV.mjs +90 -0
- package/dist/chunk-RGJT5VWB.mjs +585 -0
- package/dist/chunk-RZBHZYXG.js +582 -0
- package/dist/chunk-S7B3VKMJ.mjs +85 -0
- package/dist/chunk-S7YF2I23.js +95 -0
- package/dist/chunk-SJSYRHBU.js +635 -0
- package/dist/chunk-YIQHTB3S.js +1068 -0
- package/dist/chunk-ZARZLSLP.mjs +29 -0
- package/dist/config.js +6 -257
- package/dist/config.mjs +2 -256
- package/dist/constants.js +53 -152
- package/dist/constants.mjs +2 -141
- package/dist/environment.d.mts +18 -1
- package/dist/environment.d.ts +18 -1
- package/dist/environment.js +16 -840
- package/dist/environment.mjs +4 -841
- package/dist/hooks.d.mts +207 -2
- package/dist/hooks.d.ts +207 -2
- package/dist/hooks.js +180 -3040
- package/dist/hooks.mjs +9 -3048
- package/dist/index-C_nK1Mii.d.mts +19 -0
- package/dist/index-C_nK1Mii.d.ts +19 -0
- package/dist/index.d.mts +8 -6
- package/dist/index.d.ts +8 -6
- package/dist/index.js +626 -4711
- package/dist/index.mjs +12 -4601
- package/dist/models.d.mts +4 -21
- package/dist/models.d.ts +4 -21
- package/dist/models.js +18 -3217
- package/dist/models.mjs +9 -3217
- package/dist/provider.js +17 -3224
- package/dist/provider.mjs +8 -3224
- package/dist/services.d.mts +2 -13
- package/dist/services.d.ts +2 -13
- package/dist/services.js +31 -4032
- package/dist/services.mjs +7 -4032
- package/dist/store.js +248 -576
- package/dist/store.mjs +1 -519
- package/dist/types.js +2 -0
- package/dist/types.mjs +1 -1
- package/dist/use-get-selection-DFh6sc49.d.mts +26 -0
- package/dist/use-get-selection-DFh6sc49.d.ts +26 -0
- package/dist/utils.js +61 -2355
- package/dist/utils.mjs +1 -2344
- package/package.json +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/constants/api/key-constant.ts
|
|
4
|
+
var KeyConstants = /* @__PURE__ */ ((KeyConstants2) => {
|
|
5
|
+
KeyConstants2["PROFILE"] = "userinfo";
|
|
6
|
+
KeyConstants2["CURRENT_COMPANY"] = "current_company";
|
|
7
|
+
KeyConstants2["LIST_COMPANY"] = "list_company";
|
|
8
|
+
KeyConstants2["COMPANY_INFO"] = "company_info";
|
|
9
|
+
KeyConstants2["MENU"] = "menus";
|
|
10
|
+
KeyConstants2["GET_VIEW_BY_ACTION"] = "get_view_by_action";
|
|
11
|
+
KeyConstants2["ACTION_DETAIL"] = "action_detail";
|
|
12
|
+
KeyConstants2["GET_DATA_SELECTION"] = "get_data_select";
|
|
13
|
+
KeyConstants2["WEB_SAVE"] = "web_save";
|
|
14
|
+
KeyConstants2["WEB_READ"] = "web_read";
|
|
15
|
+
KeyConstants2["GET_PROVIDER"] = "get_provider";
|
|
16
|
+
return KeyConstants2;
|
|
17
|
+
})(KeyConstants || {});
|
|
18
|
+
|
|
19
|
+
// src/constants/api/method-constant.ts
|
|
20
|
+
var MethodConstants = /* @__PURE__ */ ((MethodConstants2) => {
|
|
21
|
+
MethodConstants2["WEB_SEARCH_READ"] = "web_search_read";
|
|
22
|
+
MethodConstants2["WEB_READ_GROUP"] = "web_read_group";
|
|
23
|
+
MethodConstants2["WEB_READ"] = "web_read";
|
|
24
|
+
MethodConstants2["WEB_SAVE"] = "web_save";
|
|
25
|
+
MethodConstants2["UNLINK"] = "unlink";
|
|
26
|
+
MethodConstants2["ONCHANGE"] = "onchange";
|
|
27
|
+
MethodConstants2["GET_ONCHANGE_FIELDS"] = "get_fields_onchange";
|
|
28
|
+
MethodConstants2["GET_FIELD_VIEW"] = "get_fields_view_v2";
|
|
29
|
+
return MethodConstants2;
|
|
30
|
+
})(MethodConstants || {});
|
|
31
|
+
|
|
32
|
+
// src/constants/api/uri-constant.ts
|
|
33
|
+
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
34
|
+
UriConstants2["AUTH_TOKEN_PATH"] = "/authentication/oauth2/token";
|
|
35
|
+
UriConstants2["GENTOKEN_SOCIAL"] = "/token/generate";
|
|
36
|
+
UriConstants2["CALL_PATH"] = "/call";
|
|
37
|
+
UriConstants2["COMPANY_PATH"] = "/company";
|
|
38
|
+
UriConstants2["PROFILE_PATH"] = "/userinfo";
|
|
39
|
+
UriConstants2["RESET_PASSWORD_PATH"] = "/reset_password";
|
|
40
|
+
UriConstants2["CHANGE_PASSWORD_PATH"] = "/change_password";
|
|
41
|
+
UriConstants2["UPDATE_PASSWORD_PATH"] = "/change_password_parent";
|
|
42
|
+
UriConstants2["LOAD_ACTION"] = `/load_action`;
|
|
43
|
+
UriConstants2["REPORT_PATH"] = `/report`;
|
|
44
|
+
UriConstants2["RUN_ACTION_PATH"] = `/run_action`;
|
|
45
|
+
UriConstants2["UPLOAD_FILE_PATH"] = `/upload/file`;
|
|
46
|
+
UriConstants2["GET_MESSAGE"] = `/chatter/thread/messages`;
|
|
47
|
+
UriConstants2["SENT_MESSAGE"] = `/chatter/message/post`;
|
|
48
|
+
UriConstants2["UPLOAD_IMAGE"] = `/mail/attachment/upload`;
|
|
49
|
+
UriConstants2["DELETE_MESSAGE"] = `/chatter/message/update_content`;
|
|
50
|
+
UriConstants2["IMAGE_PATH"] = `/web/image`;
|
|
51
|
+
UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
|
|
52
|
+
UriConstants2["TOKEN"] = `/check_token`;
|
|
53
|
+
UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
|
|
54
|
+
UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
|
|
55
|
+
UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
|
|
56
|
+
return UriConstants2;
|
|
57
|
+
})(UriConstants || {});
|
|
58
|
+
|
|
59
|
+
exports.KeyConstants = KeyConstants;
|
|
60
|
+
exports.MethodConstants = MethodConstants;
|
|
61
|
+
exports.UriConstants = UriConstants;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/constants/api/key-constant.ts
|
|
2
|
+
var KeyConstants = /* @__PURE__ */ ((KeyConstants2) => {
|
|
3
|
+
KeyConstants2["PROFILE"] = "userinfo";
|
|
4
|
+
KeyConstants2["CURRENT_COMPANY"] = "current_company";
|
|
5
|
+
KeyConstants2["LIST_COMPANY"] = "list_company";
|
|
6
|
+
KeyConstants2["COMPANY_INFO"] = "company_info";
|
|
7
|
+
KeyConstants2["MENU"] = "menus";
|
|
8
|
+
KeyConstants2["GET_VIEW_BY_ACTION"] = "get_view_by_action";
|
|
9
|
+
KeyConstants2["ACTION_DETAIL"] = "action_detail";
|
|
10
|
+
KeyConstants2["GET_DATA_SELECTION"] = "get_data_select";
|
|
11
|
+
KeyConstants2["WEB_SAVE"] = "web_save";
|
|
12
|
+
KeyConstants2["WEB_READ"] = "web_read";
|
|
13
|
+
KeyConstants2["GET_PROVIDER"] = "get_provider";
|
|
14
|
+
return KeyConstants2;
|
|
15
|
+
})(KeyConstants || {});
|
|
16
|
+
|
|
17
|
+
// src/constants/api/method-constant.ts
|
|
18
|
+
var MethodConstants = /* @__PURE__ */ ((MethodConstants2) => {
|
|
19
|
+
MethodConstants2["WEB_SEARCH_READ"] = "web_search_read";
|
|
20
|
+
MethodConstants2["WEB_READ_GROUP"] = "web_read_group";
|
|
21
|
+
MethodConstants2["WEB_READ"] = "web_read";
|
|
22
|
+
MethodConstants2["WEB_SAVE"] = "web_save";
|
|
23
|
+
MethodConstants2["UNLINK"] = "unlink";
|
|
24
|
+
MethodConstants2["ONCHANGE"] = "onchange";
|
|
25
|
+
MethodConstants2["GET_ONCHANGE_FIELDS"] = "get_fields_onchange";
|
|
26
|
+
MethodConstants2["GET_FIELD_VIEW"] = "get_fields_view_v2";
|
|
27
|
+
return MethodConstants2;
|
|
28
|
+
})(MethodConstants || {});
|
|
29
|
+
|
|
30
|
+
// src/constants/api/uri-constant.ts
|
|
31
|
+
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
32
|
+
UriConstants2["AUTH_TOKEN_PATH"] = "/authentication/oauth2/token";
|
|
33
|
+
UriConstants2["GENTOKEN_SOCIAL"] = "/token/generate";
|
|
34
|
+
UriConstants2["CALL_PATH"] = "/call";
|
|
35
|
+
UriConstants2["COMPANY_PATH"] = "/company";
|
|
36
|
+
UriConstants2["PROFILE_PATH"] = "/userinfo";
|
|
37
|
+
UriConstants2["RESET_PASSWORD_PATH"] = "/reset_password";
|
|
38
|
+
UriConstants2["CHANGE_PASSWORD_PATH"] = "/change_password";
|
|
39
|
+
UriConstants2["UPDATE_PASSWORD_PATH"] = "/change_password_parent";
|
|
40
|
+
UriConstants2["LOAD_ACTION"] = `/load_action`;
|
|
41
|
+
UriConstants2["REPORT_PATH"] = `/report`;
|
|
42
|
+
UriConstants2["RUN_ACTION_PATH"] = `/run_action`;
|
|
43
|
+
UriConstants2["UPLOAD_FILE_PATH"] = `/upload/file`;
|
|
44
|
+
UriConstants2["GET_MESSAGE"] = `/chatter/thread/messages`;
|
|
45
|
+
UriConstants2["SENT_MESSAGE"] = `/chatter/message/post`;
|
|
46
|
+
UriConstants2["UPLOAD_IMAGE"] = `/mail/attachment/upload`;
|
|
47
|
+
UriConstants2["DELETE_MESSAGE"] = `/chatter/message/update_content`;
|
|
48
|
+
UriConstants2["IMAGE_PATH"] = `/web/image`;
|
|
49
|
+
UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
|
|
50
|
+
UriConstants2["TOKEN"] = `/check_token`;
|
|
51
|
+
UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
|
|
52
|
+
UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
|
|
53
|
+
UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
|
|
54
|
+
return UriConstants2;
|
|
55
|
+
})(UriConstants || {});
|
|
56
|
+
|
|
57
|
+
export { KeyConstants, MethodConstants, UriConstants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkRZBHZYXG_js = require('./chunk-RZBHZYXG.js');
|
|
4
|
+
var chunk3B6NWGPJ_js = require('./chunk-3B6NWGPJ.js');
|
|
5
|
+
|
|
6
|
+
// src/environment/EnvStore.ts
|
|
7
|
+
var EnvStore = class {
|
|
8
|
+
envStore;
|
|
9
|
+
baseUrl;
|
|
10
|
+
requests;
|
|
11
|
+
context;
|
|
12
|
+
defaultCompany;
|
|
13
|
+
config;
|
|
14
|
+
companies;
|
|
15
|
+
user;
|
|
16
|
+
db;
|
|
17
|
+
localStorageUtils;
|
|
18
|
+
sessionStorageUtils;
|
|
19
|
+
constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
|
|
20
|
+
this.envStore = envStore2;
|
|
21
|
+
this.localStorageUtils = localStorageUtils2;
|
|
22
|
+
this.sessionStorageUtils = sessionStorageUtils2;
|
|
23
|
+
this.setup();
|
|
24
|
+
}
|
|
25
|
+
setup() {
|
|
26
|
+
const env2 = this.envStore.getState().env;
|
|
27
|
+
this.baseUrl = env2?.baseUrl;
|
|
28
|
+
this.requests = env2?.requests;
|
|
29
|
+
this.context = env2?.context;
|
|
30
|
+
this.defaultCompany = env2?.defaultCompany;
|
|
31
|
+
this.config = env2?.config;
|
|
32
|
+
this.companies = env2?.companies || [];
|
|
33
|
+
this.user = env2?.user;
|
|
34
|
+
this.db = env2?.db;
|
|
35
|
+
}
|
|
36
|
+
setupEnv(envConfig) {
|
|
37
|
+
const dispatch = this.envStore.dispatch;
|
|
38
|
+
const env2 = {
|
|
39
|
+
...envConfig,
|
|
40
|
+
localStorageUtils: this.localStorageUtils,
|
|
41
|
+
sessionStorageUtils: this.sessionStorageUtils
|
|
42
|
+
};
|
|
43
|
+
const requests = chunk3B6NWGPJ_js.axiosClient.init(env2);
|
|
44
|
+
dispatch(chunkRZBHZYXG_js.setEnv({ ...env2, requests }));
|
|
45
|
+
this.setup();
|
|
46
|
+
}
|
|
47
|
+
setUid(uid) {
|
|
48
|
+
const dispatch = this.envStore.dispatch;
|
|
49
|
+
dispatch(chunkRZBHZYXG_js.setUid(uid));
|
|
50
|
+
this.setup();
|
|
51
|
+
}
|
|
52
|
+
setLang(lang) {
|
|
53
|
+
const dispatch = this.envStore.dispatch;
|
|
54
|
+
dispatch(chunkRZBHZYXG_js.setLang(lang));
|
|
55
|
+
this.setup();
|
|
56
|
+
}
|
|
57
|
+
setAllowCompanies(allowCompanies) {
|
|
58
|
+
const dispatch = this.envStore.dispatch;
|
|
59
|
+
dispatch(chunkRZBHZYXG_js.setAllowCompanies(allowCompanies));
|
|
60
|
+
this.setup();
|
|
61
|
+
}
|
|
62
|
+
setCompanies(companies) {
|
|
63
|
+
const dispatch = this.envStore.dispatch;
|
|
64
|
+
dispatch(chunkRZBHZYXG_js.setCompanies(companies));
|
|
65
|
+
this.setup();
|
|
66
|
+
}
|
|
67
|
+
setDefaultCompany(company) {
|
|
68
|
+
const dispatch = this.envStore.dispatch;
|
|
69
|
+
dispatch(chunkRZBHZYXG_js.setDefaultCompany(company));
|
|
70
|
+
this.setup();
|
|
71
|
+
}
|
|
72
|
+
setUserInfo(userInfo) {
|
|
73
|
+
const dispatch = this.envStore.dispatch;
|
|
74
|
+
dispatch(chunkRZBHZYXG_js.setUser(userInfo));
|
|
75
|
+
this.setup();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
exports.env = null;
|
|
79
|
+
function initEnv({
|
|
80
|
+
localStorageUtils: localStorageUtils2,
|
|
81
|
+
sessionStorageUtils: sessionStorageUtils2
|
|
82
|
+
}) {
|
|
83
|
+
exports.env = new EnvStore(chunkRZBHZYXG_js.envStore, localStorageUtils2, sessionStorageUtils2);
|
|
84
|
+
return exports.env;
|
|
85
|
+
}
|
|
86
|
+
function getEnv() {
|
|
87
|
+
if (!exports.env)
|
|
88
|
+
exports.env = new EnvStore(chunkRZBHZYXG_js.envStore, chunk3B6NWGPJ_js.localStorageUtils(), chunk3B6NWGPJ_js.sessionStorageUtils());
|
|
89
|
+
return exports.env;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
exports.EnvStore = EnvStore;
|
|
93
|
+
exports.getEnv = getEnv;
|
|
94
|
+
exports.initEnv = initEnv;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkYIQHTB3S_js = require('./chunk-YIQHTB3S.js');
|
|
4
|
+
var chunkRZBHZYXG_js = require('./chunk-RZBHZYXG.js');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var reactQuery = require('@tanstack/react-query');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
var reactRedux = require('react-redux');
|
|
9
|
+
|
|
10
|
+
var ReactQueryProvider = ({ children }) => {
|
|
11
|
+
const [queryClient] = react.useState(
|
|
12
|
+
() => new reactQuery.QueryClient({
|
|
13
|
+
defaultOptions: {
|
|
14
|
+
queries: {
|
|
15
|
+
refetchOnWindowFocus: false,
|
|
16
|
+
refetchOnMount: false,
|
|
17
|
+
refetchOnReconnect: false,
|
|
18
|
+
retry: false
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
);
|
|
23
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children });
|
|
24
|
+
};
|
|
25
|
+
var ReduxProvider = ({ children }) => {
|
|
26
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactRedux.Provider, { store: chunkRZBHZYXG_js.envStore, children });
|
|
27
|
+
};
|
|
28
|
+
var MainProvider = ({ children }) => {
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ReduxProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(ReactQueryProvider, { children }) });
|
|
30
|
+
};
|
|
31
|
+
var VersionGate = ({ children }) => {
|
|
32
|
+
const queryClient = reactQuery.useQueryClient();
|
|
33
|
+
const [ready, setReady] = react.useState(false);
|
|
34
|
+
react.useEffect(() => {
|
|
35
|
+
const clearVersion = () => {
|
|
36
|
+
queryClient.clear();
|
|
37
|
+
localStorage.removeItem("__api_version__");
|
|
38
|
+
};
|
|
39
|
+
const validateVersion = async () => {
|
|
40
|
+
const serverVersion = await chunkYIQHTB3S_js.view_service_default.getVersion();
|
|
41
|
+
const cached = localStorage.getItem("__api_version__");
|
|
42
|
+
if (cached !== serverVersion?.api_version) {
|
|
43
|
+
clearVersion();
|
|
44
|
+
localStorage.setItem("__api_version__", serverVersion?.api_version);
|
|
45
|
+
} else {
|
|
46
|
+
console.log("Api version:", serverVersion?.api_version);
|
|
47
|
+
}
|
|
48
|
+
setReady(true);
|
|
49
|
+
};
|
|
50
|
+
validateVersion();
|
|
51
|
+
if (typeof window !== "undefined") {
|
|
52
|
+
const onKey = (e) => {
|
|
53
|
+
const key = e.key.toLowerCase();
|
|
54
|
+
const isHardRefresh = (key === "f5" || key === "r") && e.ctrlKey && (key !== "r" || e.shiftKey) || key === "r" && e.metaKey && e.shiftKey || key === "r" && e.metaKey && e.altKey;
|
|
55
|
+
if (isHardRefresh) clearVersion();
|
|
56
|
+
};
|
|
57
|
+
window.addEventListener("keydown", onKey);
|
|
58
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
59
|
+
}
|
|
60
|
+
}, [queryClient]);
|
|
61
|
+
return ready ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children }) : null;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
exports.MainProvider = MainProvider;
|
|
65
|
+
exports.ReactQueryProvider = ReactQueryProvider;
|
|
66
|
+
exports.VersionGate = VersionGate;
|