@fctc/interface-logic 1.5.7 → 1.5.8
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/{configs.d.cts → configs.d.mts} +1 -1
- package/dist/configs.js +44 -9
- package/dist/{configs.cjs → configs.mjs} +9 -44
- package/dist/constants.js +40 -2
- package/dist/{constants.cjs → constants.mjs} +2 -40
- package/dist/environment.js +68 -32
- package/dist/{environment.cjs → environment.mjs} +32 -68
- package/dist/{hooks.d.cts → hooks.d.mts} +1 -1
- package/dist/hooks.js +332 -232
- package/dist/{hooks.cjs → hooks.mjs} +232 -332
- package/dist/provider.js +83 -48
- package/dist/{provider.cjs → provider.mjs} +48 -83
- package/dist/{services.d.cts → services.d.mts} +1 -1
- package/dist/services.js +82 -41
- package/dist/{services.cjs → services.mjs} +41 -82
- package/dist/store.js +128 -27
- package/dist/{store.cjs → store.mjs} +27 -128
- package/dist/{types.d.cts → types.d.mts} +1 -1
- package/dist/types.js +17 -0
- package/dist/types.mjs +0 -0
- package/dist/utils.js +83 -21
- package/dist/{utils.cjs → utils.mjs} +21 -83
- package/package.json +2 -2
- package/dist/types.cjs +0 -17
- /package/dist/{constants.d.cts → constants.d.mts} +0 -0
- /package/dist/{environment.d.cts → environment.d.mts} +0 -0
- /package/dist/{provider.d.cts → provider.d.mts} +0 -0
- /package/dist/{store.d.cts → store.d.mts} +0 -0
- /package/dist/{utils.d.cts → utils.d.mts} +0 -0
- /package/dist/{view-type-BGJfDe73.d.cts → view-type-BGJfDe73.d.mts} +0 -0
package/dist/configs.js
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1
7
|
var __pow = Math.pow;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
2
29
|
var __async = (__this, __arguments, generator) => {
|
|
3
30
|
return new Promise((resolve, reject) => {
|
|
4
31
|
var fulfilled = (value) => {
|
|
@@ -20,11 +47,18 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20
47
|
});
|
|
21
48
|
};
|
|
22
49
|
|
|
50
|
+
// src/configs.ts
|
|
51
|
+
var configs_exports = {};
|
|
52
|
+
__export(configs_exports, {
|
|
53
|
+
axiosClient: () => axiosClient
|
|
54
|
+
});
|
|
55
|
+
module.exports = __toCommonJS(configs_exports);
|
|
56
|
+
|
|
23
57
|
// src/configs/axios-client.ts
|
|
24
|
-
|
|
58
|
+
var import_axios = __toESM(require("axios"));
|
|
25
59
|
|
|
26
60
|
// src/utils/format.ts
|
|
27
|
-
|
|
61
|
+
var import_moment = __toESM(require("moment"));
|
|
28
62
|
|
|
29
63
|
// src/utils/domain/py_tokenizer.ts
|
|
30
64
|
var TokenizerError = class extends Error {
|
|
@@ -2116,7 +2150,7 @@ function matchDomain(record, domain) {
|
|
|
2116
2150
|
}
|
|
2117
2151
|
|
|
2118
2152
|
// src/utils/function.ts
|
|
2119
|
-
|
|
2153
|
+
var import_react = require("react");
|
|
2120
2154
|
var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
2121
2155
|
if (!originalRequest.data) return originalRequest.data;
|
|
2122
2156
|
if (typeof originalRequest.data === "string") {
|
|
@@ -2193,8 +2227,8 @@ var axiosClient = {
|
|
|
2193
2227
|
});
|
|
2194
2228
|
failedQueue = [];
|
|
2195
2229
|
};
|
|
2196
|
-
const instance =
|
|
2197
|
-
adapter:
|
|
2230
|
+
const instance = import_axios.default.create({
|
|
2231
|
+
adapter: import_axios.default.defaults.adapter,
|
|
2198
2232
|
baseURL: config.baseUrl,
|
|
2199
2233
|
timeout: 5e4,
|
|
2200
2234
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
@@ -2267,7 +2301,7 @@ var axiosClient = {
|
|
|
2267
2301
|
);
|
|
2268
2302
|
return new Promise(function(resolve) {
|
|
2269
2303
|
var _a3;
|
|
2270
|
-
|
|
2304
|
+
import_axios.default.post(
|
|
2271
2305
|
`${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2272
2306
|
payload,
|
|
2273
2307
|
{
|
|
@@ -2280,7 +2314,7 @@ var axiosClient = {
|
|
|
2280
2314
|
const data = res.data;
|
|
2281
2315
|
yield localStorage2.setToken(data.access_token);
|
|
2282
2316
|
yield localStorage2.setRefreshToken(data.refresh_token);
|
|
2283
|
-
|
|
2317
|
+
import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2284
2318
|
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2285
2319
|
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
2286
2320
|
originalRequest,
|
|
@@ -2356,6 +2390,7 @@ var axiosClient = {
|
|
|
2356
2390
|
return requests;
|
|
2357
2391
|
}
|
|
2358
2392
|
};
|
|
2359
|
-
export
|
|
2393
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2394
|
+
0 && (module.exports = {
|
|
2360
2395
|
axiosClient
|
|
2361
|
-
};
|
|
2396
|
+
});
|
|
@@ -1,31 +1,4 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
1
|
var __pow = Math.pow;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
2
|
var __async = (__this, __arguments, generator) => {
|
|
30
3
|
return new Promise((resolve, reject) => {
|
|
31
4
|
var fulfilled = (value) => {
|
|
@@ -47,18 +20,11 @@ var __async = (__this, __arguments, generator) => {
|
|
|
47
20
|
});
|
|
48
21
|
};
|
|
49
22
|
|
|
50
|
-
// src/configs.ts
|
|
51
|
-
var configs_exports = {};
|
|
52
|
-
__export(configs_exports, {
|
|
53
|
-
axiosClient: () => axiosClient
|
|
54
|
-
});
|
|
55
|
-
module.exports = __toCommonJS(configs_exports);
|
|
56
|
-
|
|
57
23
|
// src/configs/axios-client.ts
|
|
58
|
-
|
|
24
|
+
import axios from "axios";
|
|
59
25
|
|
|
60
26
|
// src/utils/format.ts
|
|
61
|
-
|
|
27
|
+
import moment from "moment";
|
|
62
28
|
|
|
63
29
|
// src/utils/domain/py_tokenizer.ts
|
|
64
30
|
var TokenizerError = class extends Error {
|
|
@@ -2150,7 +2116,7 @@ function matchDomain(record, domain) {
|
|
|
2150
2116
|
}
|
|
2151
2117
|
|
|
2152
2118
|
// src/utils/function.ts
|
|
2153
|
-
|
|
2119
|
+
import { useEffect, useState } from "react";
|
|
2154
2120
|
var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
2155
2121
|
if (!originalRequest.data) return originalRequest.data;
|
|
2156
2122
|
if (typeof originalRequest.data === "string") {
|
|
@@ -2227,8 +2193,8 @@ var axiosClient = {
|
|
|
2227
2193
|
});
|
|
2228
2194
|
failedQueue = [];
|
|
2229
2195
|
};
|
|
2230
|
-
const instance =
|
|
2231
|
-
adapter:
|
|
2196
|
+
const instance = axios.create({
|
|
2197
|
+
adapter: axios.defaults.adapter,
|
|
2232
2198
|
baseURL: config.baseUrl,
|
|
2233
2199
|
timeout: 5e4,
|
|
2234
2200
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
@@ -2301,7 +2267,7 @@ var axiosClient = {
|
|
|
2301
2267
|
);
|
|
2302
2268
|
return new Promise(function(resolve) {
|
|
2303
2269
|
var _a3;
|
|
2304
|
-
|
|
2270
|
+
axios.post(
|
|
2305
2271
|
`${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2306
2272
|
payload,
|
|
2307
2273
|
{
|
|
@@ -2314,7 +2280,7 @@ var axiosClient = {
|
|
|
2314
2280
|
const data = res.data;
|
|
2315
2281
|
yield localStorage2.setToken(data.access_token);
|
|
2316
2282
|
yield localStorage2.setRefreshToken(data.refresh_token);
|
|
2317
|
-
|
|
2283
|
+
axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2318
2284
|
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2319
2285
|
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
2320
2286
|
originalRequest,
|
|
@@ -2390,7 +2356,6 @@ var axiosClient = {
|
|
|
2390
2356
|
return requests;
|
|
2391
2357
|
}
|
|
2392
2358
|
};
|
|
2393
|
-
|
|
2394
|
-
0 && (module.exports = {
|
|
2359
|
+
export {
|
|
2395
2360
|
axiosClient
|
|
2396
|
-
}
|
|
2361
|
+
};
|
package/dist/constants.js
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/constants.ts
|
|
20
|
+
var constants_exports = {};
|
|
21
|
+
__export(constants_exports, {
|
|
22
|
+
ComponentType: () => ComponentType,
|
|
23
|
+
FieldTypeConstants: () => FieldTypeConstants,
|
|
24
|
+
KeyConstants: () => KeyConstants,
|
|
25
|
+
MethodConstants: () => MethodConstants,
|
|
26
|
+
MethodType: () => MethodType,
|
|
27
|
+
ModelConstants: () => ModelConstants,
|
|
28
|
+
SearchType: () => SearchType,
|
|
29
|
+
UriConstants: () => UriConstants,
|
|
30
|
+
WIDGETAVATAR: () => WIDGETAVATAR,
|
|
31
|
+
WIDGETCOLOR: () => WIDGETCOLOR,
|
|
32
|
+
WIDGETCURRENCY: () => WIDGETCURRENCY,
|
|
33
|
+
WIDGETNOSTRING: () => WIDGETNOSTRING,
|
|
34
|
+
WIDGETSTATUS: () => WIDGETSTATUS
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(constants_exports);
|
|
37
|
+
|
|
1
38
|
// src/constants/api/key-constant.ts
|
|
2
39
|
var KeyConstants = /* @__PURE__ */ ((KeyConstants2) => {
|
|
3
40
|
KeyConstants2["PROFILE"] = "userinfo";
|
|
@@ -149,7 +186,8 @@ var WIDGETNOSTRING = /* @__PURE__ */ ((WIDGETNOSTRING2) => {
|
|
|
149
186
|
WIDGETNOSTRING2["sla_status_ids"] = "sla_status_ids";
|
|
150
187
|
return WIDGETNOSTRING2;
|
|
151
188
|
})(WIDGETNOSTRING || {});
|
|
152
|
-
export
|
|
189
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
190
|
+
0 && (module.exports = {
|
|
153
191
|
ComponentType,
|
|
154
192
|
FieldTypeConstants,
|
|
155
193
|
KeyConstants,
|
|
@@ -163,4 +201,4 @@ export {
|
|
|
163
201
|
WIDGETCURRENCY,
|
|
164
202
|
WIDGETNOSTRING,
|
|
165
203
|
WIDGETSTATUS
|
|
166
|
-
};
|
|
204
|
+
});
|
|
@@ -1,40 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/constants.ts
|
|
20
|
-
var constants_exports = {};
|
|
21
|
-
__export(constants_exports, {
|
|
22
|
-
ComponentType: () => ComponentType,
|
|
23
|
-
FieldTypeConstants: () => FieldTypeConstants,
|
|
24
|
-
KeyConstants: () => KeyConstants,
|
|
25
|
-
MethodConstants: () => MethodConstants,
|
|
26
|
-
MethodType: () => MethodType,
|
|
27
|
-
ModelConstants: () => ModelConstants,
|
|
28
|
-
SearchType: () => SearchType,
|
|
29
|
-
UriConstants: () => UriConstants,
|
|
30
|
-
WIDGETAVATAR: () => WIDGETAVATAR,
|
|
31
|
-
WIDGETCOLOR: () => WIDGETCOLOR,
|
|
32
|
-
WIDGETCURRENCY: () => WIDGETCURRENCY,
|
|
33
|
-
WIDGETNOSTRING: () => WIDGETNOSTRING,
|
|
34
|
-
WIDGETSTATUS: () => WIDGETSTATUS
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(constants_exports);
|
|
37
|
-
|
|
38
1
|
// src/constants/api/key-constant.ts
|
|
39
2
|
var KeyConstants = /* @__PURE__ */ ((KeyConstants2) => {
|
|
40
3
|
KeyConstants2["PROFILE"] = "userinfo";
|
|
@@ -186,8 +149,7 @@ var WIDGETNOSTRING = /* @__PURE__ */ ((WIDGETNOSTRING2) => {
|
|
|
186
149
|
WIDGETNOSTRING2["sla_status_ids"] = "sla_status_ids";
|
|
187
150
|
return WIDGETNOSTRING2;
|
|
188
151
|
})(WIDGETNOSTRING || {});
|
|
189
|
-
|
|
190
|
-
0 && (module.exports = {
|
|
152
|
+
export {
|
|
191
153
|
ComponentType,
|
|
192
154
|
FieldTypeConstants,
|
|
193
155
|
KeyConstants,
|
|
@@ -201,4 +163,4 @@ var WIDGETNOSTRING = /* @__PURE__ */ ((WIDGETNOSTRING2) => {
|
|
|
201
163
|
WIDGETCURRENCY,
|
|
202
164
|
WIDGETNOSTRING,
|
|
203
165
|
WIDGETSTATUS
|
|
204
|
-
}
|
|
166
|
+
};
|
package/dist/environment.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
5
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
7
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
10
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
11
|
var __pow = Math.pow;
|
|
@@ -18,6 +22,27 @@ var __spreadValues = (a, b) => {
|
|
|
18
22
|
return a;
|
|
19
23
|
};
|
|
20
24
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __export = (target, all) => {
|
|
26
|
+
for (var name in all)
|
|
27
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
|
+
};
|
|
29
|
+
var __copyProps = (to, from, except, desc) => {
|
|
30
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
31
|
+
for (let key of __getOwnPropNames(from))
|
|
32
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
33
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
|
+
}
|
|
35
|
+
return to;
|
|
36
|
+
};
|
|
37
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
38
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
39
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
40
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
41
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
42
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
43
|
+
mod
|
|
44
|
+
));
|
|
45
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
46
|
var __async = (__this, __arguments, generator) => {
|
|
22
47
|
return new Promise((resolve, reject) => {
|
|
23
48
|
var fulfilled = (value) => {
|
|
@@ -39,11 +64,21 @@ var __async = (__this, __arguments, generator) => {
|
|
|
39
64
|
});
|
|
40
65
|
};
|
|
41
66
|
|
|
67
|
+
// src/environment.ts
|
|
68
|
+
var environment_exports = {};
|
|
69
|
+
__export(environment_exports, {
|
|
70
|
+
EnvStore: () => EnvStore,
|
|
71
|
+
env: () => env,
|
|
72
|
+
getEnv: () => getEnv,
|
|
73
|
+
initEnv: () => initEnv
|
|
74
|
+
});
|
|
75
|
+
module.exports = __toCommonJS(environment_exports);
|
|
76
|
+
|
|
42
77
|
// src/configs/axios-client.ts
|
|
43
|
-
|
|
78
|
+
var import_axios = __toESM(require("axios"));
|
|
44
79
|
|
|
45
80
|
// src/utils/format.ts
|
|
46
|
-
|
|
81
|
+
var import_moment = __toESM(require("moment"));
|
|
47
82
|
|
|
48
83
|
// src/utils/domain/py_tokenizer.ts
|
|
49
84
|
var TokenizerError = class extends Error {
|
|
@@ -2135,7 +2170,7 @@ function matchDomain(record, domain) {
|
|
|
2135
2170
|
}
|
|
2136
2171
|
|
|
2137
2172
|
// src/utils/function.ts
|
|
2138
|
-
|
|
2173
|
+
var import_react = require("react");
|
|
2139
2174
|
var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
2140
2175
|
if (!originalRequest.data) return originalRequest.data;
|
|
2141
2176
|
if (typeof originalRequest.data === "string") {
|
|
@@ -2212,8 +2247,8 @@ var axiosClient = {
|
|
|
2212
2247
|
});
|
|
2213
2248
|
failedQueue = [];
|
|
2214
2249
|
};
|
|
2215
|
-
const instance =
|
|
2216
|
-
adapter:
|
|
2250
|
+
const instance = import_axios.default.create({
|
|
2251
|
+
adapter: import_axios.default.defaults.adapter,
|
|
2217
2252
|
baseURL: config.baseUrl,
|
|
2218
2253
|
timeout: 5e4,
|
|
2219
2254
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
@@ -2286,7 +2321,7 @@ var axiosClient = {
|
|
|
2286
2321
|
);
|
|
2287
2322
|
return new Promise(function(resolve) {
|
|
2288
2323
|
var _a3;
|
|
2289
|
-
|
|
2324
|
+
import_axios.default.post(
|
|
2290
2325
|
`${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2291
2326
|
payload,
|
|
2292
2327
|
{
|
|
@@ -2299,7 +2334,7 @@ var axiosClient = {
|
|
|
2299
2334
|
const data = res.data;
|
|
2300
2335
|
yield localStorage2.setToken(data.access_token);
|
|
2301
2336
|
yield localStorage2.setRefreshToken(data.refresh_token);
|
|
2302
|
-
|
|
2337
|
+
import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2303
2338
|
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2304
2339
|
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
2305
2340
|
originalRequest,
|
|
@@ -2377,14 +2412,14 @@ var axiosClient = {
|
|
|
2377
2412
|
};
|
|
2378
2413
|
|
|
2379
2414
|
// src/store/index.ts
|
|
2380
|
-
|
|
2415
|
+
var import_react_redux = require("react-redux");
|
|
2381
2416
|
|
|
2382
2417
|
// src/store/reducers/breadcrums-slice/index.ts
|
|
2383
|
-
|
|
2418
|
+
var import_toolkit = require("@reduxjs/toolkit");
|
|
2384
2419
|
var initialState = {
|
|
2385
2420
|
breadCrumbs: []
|
|
2386
2421
|
};
|
|
2387
|
-
var breadcrumbsSlice = createSlice({
|
|
2422
|
+
var breadcrumbsSlice = (0, import_toolkit.createSlice)({
|
|
2388
2423
|
name: "breadcrumbs",
|
|
2389
2424
|
initialState,
|
|
2390
2425
|
reducers: {
|
|
@@ -2397,7 +2432,7 @@ var { setBreadCrumbs } = breadcrumbsSlice.actions;
|
|
|
2397
2432
|
var breadcrums_slice_default = breadcrumbsSlice.reducer;
|
|
2398
2433
|
|
|
2399
2434
|
// src/store/reducers/env-slice/index.ts
|
|
2400
|
-
|
|
2435
|
+
var import_toolkit2 = require("@reduxjs/toolkit");
|
|
2401
2436
|
var initialState2 = {
|
|
2402
2437
|
baseUrl: "",
|
|
2403
2438
|
requests: null,
|
|
@@ -2418,7 +2453,7 @@ var initialState2 = {
|
|
|
2418
2453
|
tz: "Asia/Saigon"
|
|
2419
2454
|
}
|
|
2420
2455
|
};
|
|
2421
|
-
var envSlice =
|
|
2456
|
+
var envSlice = (0, import_toolkit2.createSlice)({
|
|
2422
2457
|
name: "env",
|
|
2423
2458
|
initialState: initialState2,
|
|
2424
2459
|
reducers: {
|
|
@@ -2465,7 +2500,7 @@ var {
|
|
|
2465
2500
|
var env_slice_default = envSlice.reducer;
|
|
2466
2501
|
|
|
2467
2502
|
// src/store/reducers/excel-slice/index.ts
|
|
2468
|
-
|
|
2503
|
+
var import_toolkit3 = require("@reduxjs/toolkit");
|
|
2469
2504
|
var initialState3 = {
|
|
2470
2505
|
dataParse: null,
|
|
2471
2506
|
idFile: null,
|
|
@@ -2474,7 +2509,7 @@ var initialState3 = {
|
|
|
2474
2509
|
selectedFile: null,
|
|
2475
2510
|
errorData: null
|
|
2476
2511
|
};
|
|
2477
|
-
var excelSlice =
|
|
2512
|
+
var excelSlice = (0, import_toolkit3.createSlice)({
|
|
2478
2513
|
name: "excel",
|
|
2479
2514
|
initialState: initialState3,
|
|
2480
2515
|
reducers: {
|
|
@@ -2509,7 +2544,7 @@ var {
|
|
|
2509
2544
|
var excel_slice_default = excelSlice.reducer;
|
|
2510
2545
|
|
|
2511
2546
|
// src/store/reducers/form-slice/index.ts
|
|
2512
|
-
|
|
2547
|
+
var import_toolkit4 = require("@reduxjs/toolkit");
|
|
2513
2548
|
var initialState4 = {
|
|
2514
2549
|
viewDataStore: {},
|
|
2515
2550
|
isShowingModalDetail: false,
|
|
@@ -2519,7 +2554,7 @@ var initialState4 = {
|
|
|
2519
2554
|
listSubject: {},
|
|
2520
2555
|
dataUser: {}
|
|
2521
2556
|
};
|
|
2522
|
-
var formSlice =
|
|
2557
|
+
var formSlice = (0, import_toolkit4.createSlice)({
|
|
2523
2558
|
name: "form",
|
|
2524
2559
|
initialState: initialState4,
|
|
2525
2560
|
reducers: {
|
|
@@ -2558,8 +2593,8 @@ var {
|
|
|
2558
2593
|
var form_slice_default = formSlice.reducer;
|
|
2559
2594
|
|
|
2560
2595
|
// src/store/reducers/header-slice/index.ts
|
|
2561
|
-
|
|
2562
|
-
var headerSlice =
|
|
2596
|
+
var import_toolkit5 = require("@reduxjs/toolkit");
|
|
2597
|
+
var headerSlice = (0, import_toolkit5.createSlice)({
|
|
2563
2598
|
name: "header",
|
|
2564
2599
|
initialState: {
|
|
2565
2600
|
value: { allowedCompanyIds: [] }
|
|
@@ -2577,7 +2612,7 @@ var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
|
|
|
2577
2612
|
var header_slice_default = headerSlice.reducer;
|
|
2578
2613
|
|
|
2579
2614
|
// src/store/reducers/list-slice/index.ts
|
|
2580
|
-
|
|
2615
|
+
var import_toolkit6 = require("@reduxjs/toolkit");
|
|
2581
2616
|
var initialState5 = {
|
|
2582
2617
|
pageLimit: 10,
|
|
2583
2618
|
fields: {},
|
|
@@ -2591,7 +2626,7 @@ var initialState5 = {
|
|
|
2591
2626
|
page: 0,
|
|
2592
2627
|
domainTable: []
|
|
2593
2628
|
};
|
|
2594
|
-
var listSlice =
|
|
2629
|
+
var listSlice = (0, import_toolkit6.createSlice)({
|
|
2595
2630
|
name: "list",
|
|
2596
2631
|
initialState: initialState5,
|
|
2597
2632
|
reducers: {
|
|
@@ -2642,13 +2677,13 @@ var {
|
|
|
2642
2677
|
var list_slice_default = listSlice.reducer;
|
|
2643
2678
|
|
|
2644
2679
|
// src/store/reducers/login-slice/index.ts
|
|
2645
|
-
|
|
2680
|
+
var import_toolkit7 = require("@reduxjs/toolkit");
|
|
2646
2681
|
var initialState6 = {
|
|
2647
2682
|
db: "",
|
|
2648
2683
|
redirectTo: "/",
|
|
2649
2684
|
forgotPasswordUrl: "/"
|
|
2650
2685
|
};
|
|
2651
|
-
var loginSlice =
|
|
2686
|
+
var loginSlice = (0, import_toolkit7.createSlice)({
|
|
2652
2687
|
name: "login",
|
|
2653
2688
|
initialState: initialState6,
|
|
2654
2689
|
reducers: {
|
|
@@ -2667,14 +2702,14 @@ var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
|
|
|
2667
2702
|
var login_slice_default = loginSlice.reducer;
|
|
2668
2703
|
|
|
2669
2704
|
// src/store/reducers/navbar-slice/index.ts
|
|
2670
|
-
|
|
2705
|
+
var import_toolkit8 = require("@reduxjs/toolkit");
|
|
2671
2706
|
var initialState7 = {
|
|
2672
2707
|
menuFocus: {},
|
|
2673
2708
|
menuAction: {},
|
|
2674
2709
|
navbarWidth: 250,
|
|
2675
2710
|
menuList: []
|
|
2676
2711
|
};
|
|
2677
|
-
var navbarSlice =
|
|
2712
|
+
var navbarSlice = (0, import_toolkit8.createSlice)({
|
|
2678
2713
|
name: "navbar",
|
|
2679
2714
|
initialState: initialState7,
|
|
2680
2715
|
reducers: {
|
|
@@ -2696,11 +2731,11 @@ var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSl
|
|
|
2696
2731
|
var navbar_slice_default = navbarSlice.reducer;
|
|
2697
2732
|
|
|
2698
2733
|
// src/store/reducers/profile-slice/index.ts
|
|
2699
|
-
|
|
2734
|
+
var import_toolkit9 = require("@reduxjs/toolkit");
|
|
2700
2735
|
var initialState8 = {
|
|
2701
2736
|
profile: {}
|
|
2702
2737
|
};
|
|
2703
|
-
var profileSlice =
|
|
2738
|
+
var profileSlice = (0, import_toolkit9.createSlice)({
|
|
2704
2739
|
name: "profile",
|
|
2705
2740
|
initialState: initialState8,
|
|
2706
2741
|
reducers: {
|
|
@@ -2713,7 +2748,7 @@ var { setProfile } = profileSlice.actions;
|
|
|
2713
2748
|
var profile_slice_default = profileSlice.reducer;
|
|
2714
2749
|
|
|
2715
2750
|
// src/store/reducers/search-slice/index.ts
|
|
2716
|
-
|
|
2751
|
+
var import_toolkit10 = require("@reduxjs/toolkit");
|
|
2717
2752
|
var initialState9 = {
|
|
2718
2753
|
groupByDomain: null,
|
|
2719
2754
|
searchBy: [],
|
|
@@ -2725,7 +2760,7 @@ var initialState9 = {
|
|
|
2725
2760
|
filterBy: [],
|
|
2726
2761
|
groupBy: []
|
|
2727
2762
|
};
|
|
2728
|
-
var searchSlice =
|
|
2763
|
+
var searchSlice = (0, import_toolkit10.createSlice)({
|
|
2729
2764
|
name: "search",
|
|
2730
2765
|
initialState: initialState9,
|
|
2731
2766
|
reducers: {
|
|
@@ -2799,7 +2834,7 @@ var {
|
|
|
2799
2834
|
var search_slice_default = searchSlice.reducer;
|
|
2800
2835
|
|
|
2801
2836
|
// src/store/store.ts
|
|
2802
|
-
|
|
2837
|
+
var import_toolkit11 = require("@reduxjs/toolkit");
|
|
2803
2838
|
|
|
2804
2839
|
// node_modules/redux/dist/redux.mjs
|
|
2805
2840
|
function formatProdErrorMessage(code) {
|
|
@@ -2983,7 +3018,7 @@ var rootReducer = combineReducers({
|
|
|
2983
3018
|
excel: excel_slice_default,
|
|
2984
3019
|
profile: profile_slice_default
|
|
2985
3020
|
});
|
|
2986
|
-
var envStore = configureStore({
|
|
3021
|
+
var envStore = (0, import_toolkit11.configureStore)({
|
|
2987
3022
|
reducer: rootReducer,
|
|
2988
3023
|
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
|
2989
3024
|
serializableCheck: false
|
|
@@ -3064,9 +3099,10 @@ function getEnv() {
|
|
|
3064
3099
|
env = new EnvStore(envStore, localStorageUtils(), sessionStorageUtils());
|
|
3065
3100
|
return env;
|
|
3066
3101
|
}
|
|
3067
|
-
export
|
|
3102
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
3103
|
+
0 && (module.exports = {
|
|
3068
3104
|
EnvStore,
|
|
3069
3105
|
env,
|
|
3070
3106
|
getEnv,
|
|
3071
3107
|
initEnv
|
|
3072
|
-
};
|
|
3108
|
+
});
|