tsv2-library 1.0.61-alpha.123 → 1.0.61-alpha.124
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/tsv2-library.es.js
CHANGED
|
@@ -6544,8 +6544,8 @@ const getLoggedInUser = () => {
|
|
|
6544
6544
|
timeFormat: true
|
|
6545
6545
|
}
|
|
6546
6546
|
};
|
|
6547
|
-
const
|
|
6548
|
-
const loggedInUser =
|
|
6547
|
+
const user = localStorage.getItem("user");
|
|
6548
|
+
const loggedInUser = user ? JSON.parse(user) : defaultUserSettings;
|
|
6549
6549
|
return loggedInUser;
|
|
6550
6550
|
};
|
|
6551
6551
|
const getUserLocale = () => {
|
|
@@ -6851,10 +6851,10 @@ const formatDateReadable = (date, maxSeconds) => {
|
|
|
6851
6851
|
return "just now";
|
|
6852
6852
|
};
|
|
6853
6853
|
const reportErrors = (error, activity) => {
|
|
6854
|
-
const
|
|
6854
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
6855
6855
|
const userRoles = JSON.parse(localStorage.getItem("user_roles") ?? "{}");
|
|
6856
6856
|
({
|
|
6857
|
-
...
|
|
6857
|
+
...user,
|
|
6858
6858
|
userRoles
|
|
6859
6859
|
});
|
|
6860
6860
|
};
|
|
@@ -6917,8 +6917,8 @@ const getFilenameFromResponse = (response) => {
|
|
|
6917
6917
|
}
|
|
6918
6918
|
};
|
|
6919
6919
|
const getAuthToken = () => {
|
|
6920
|
-
const
|
|
6921
|
-
return
|
|
6920
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
6921
|
+
return user.jwt ?? user.token ?? "";
|
|
6922
6922
|
};
|
|
6923
6923
|
const fetchFile = async (name) => {
|
|
6924
6924
|
const token = getAuthToken();
|
|
@@ -13150,12 +13150,12 @@ const reLogin$1 = (body) => {
|
|
|
13150
13150
|
};
|
|
13151
13151
|
const AuthAPIs = { reLogin: reLogin$1 };
|
|
13152
13152
|
const reLogin = async () => {
|
|
13153
|
-
const
|
|
13154
|
-
if (!
|
|
13153
|
+
const user = localStorage.getItem("user");
|
|
13154
|
+
if (!user) {
|
|
13155
13155
|
forceLogout();
|
|
13156
13156
|
}
|
|
13157
13157
|
try {
|
|
13158
|
-
const parsedUser = JSON.parse(
|
|
13158
|
+
const parsedUser = JSON.parse(user);
|
|
13159
13159
|
const { token } = parsedUser;
|
|
13160
13160
|
const response = await AuthAPIs.reLogin({ jwt: token });
|
|
13161
13161
|
if (response == null ? void 0 : response.data) {
|
|
@@ -13342,13 +13342,13 @@ const API$f = ({
|
|
|
13342
13342
|
params = {},
|
|
13343
13343
|
usePrefix = true
|
|
13344
13344
|
} = {}) => {
|
|
13345
|
-
const
|
|
13345
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
13346
13346
|
const BASE_URL2 = "https://dev-api.tagsamurai.com/fam";
|
|
13347
13347
|
const instance = axios.create({
|
|
13348
13348
|
baseURL: `${BASE_URL2}/assets/v2${usePrefix ? "/assets" : ""}`,
|
|
13349
13349
|
headers: {
|
|
13350
13350
|
"Content-type": "application/json",
|
|
13351
|
-
"Authorization": `Bearer ${
|
|
13351
|
+
"Authorization": `Bearer ${user.token}`,
|
|
13352
13352
|
...headers
|
|
13353
13353
|
},
|
|
13354
13354
|
params
|
|
@@ -13428,13 +13428,13 @@ const API$e = ({
|
|
|
13428
13428
|
headers = {},
|
|
13429
13429
|
params = {}
|
|
13430
13430
|
} = {}) => {
|
|
13431
|
-
const
|
|
13431
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
13432
13432
|
const BASE_URL2 = "https://dev-api.tagsamurai.com/fam";
|
|
13433
13433
|
const instance = axios.create({
|
|
13434
13434
|
baseURL: `${BASE_URL2}/settings-attribute/v2/asset-name`,
|
|
13435
13435
|
headers: {
|
|
13436
13436
|
"Content-type": "application/json",
|
|
13437
|
-
"Authorization": `Bearer ${
|
|
13437
|
+
"Authorization": `Bearer ${user.token}`,
|
|
13438
13438
|
...headers
|
|
13439
13439
|
},
|
|
13440
13440
|
params
|
|
@@ -13471,13 +13471,13 @@ const API$d = ({
|
|
|
13471
13471
|
headers = {},
|
|
13472
13472
|
params = {}
|
|
13473
13473
|
} = {}) => {
|
|
13474
|
-
const
|
|
13474
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
13475
13475
|
const BASE_URL2 = "https://dev-api.tagsamurai.com/fam";
|
|
13476
13476
|
const instance = axios.create({
|
|
13477
13477
|
baseURL: `${BASE_URL2}/settings-attribute/v2/brands`,
|
|
13478
13478
|
headers: {
|
|
13479
13479
|
"Content-type": "application/json",
|
|
13480
|
-
"Authorization": `Bearer ${
|
|
13480
|
+
"Authorization": `Bearer ${user.token}`,
|
|
13481
13481
|
...headers
|
|
13482
13482
|
},
|
|
13483
13483
|
params
|
|
@@ -13490,13 +13490,13 @@ const AssetBrandService = {
|
|
|
13490
13490
|
}
|
|
13491
13491
|
};
|
|
13492
13492
|
const API$c = ({ headers = {}, params = {} } = {}) => {
|
|
13493
|
-
const
|
|
13493
|
+
const user = JSON.parse(localStorage.getItem("user")) ?? {};
|
|
13494
13494
|
const BASE_URL2 = "https://dev-api.tagsamurai.com/fam";
|
|
13495
13495
|
const instance = axios.create({
|
|
13496
13496
|
baseURL: `${BASE_URL2}/disposal/v2`,
|
|
13497
13497
|
headers: {
|
|
13498
13498
|
"Content-type": "application/json",
|
|
13499
|
-
"Authorization": `Bearer ${
|
|
13499
|
+
"Authorization": `Bearer ${user.token}`,
|
|
13500
13500
|
...headers
|
|
13501
13501
|
},
|
|
13502
13502
|
params
|
|
@@ -13519,13 +13519,13 @@ const API$b = ({
|
|
|
13519
13519
|
headers = {},
|
|
13520
13520
|
params = {}
|
|
13521
13521
|
} = {}) => {
|
|
13522
|
-
const
|
|
13522
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
13523
13523
|
const BASE_URL2 = "https://dev-api.tagsamurai.com/fam";
|
|
13524
13524
|
const instance = axios.create({
|
|
13525
13525
|
baseURL: `${BASE_URL2}/settings-attribute/v2/`,
|
|
13526
13526
|
headers: {
|
|
13527
13527
|
"Content-type": "application/json",
|
|
13528
|
-
"Authorization": `Bearer ${
|
|
13528
|
+
"Authorization": `Bearer ${user.token}`,
|
|
13529
13529
|
...headers
|
|
13530
13530
|
},
|
|
13531
13531
|
params
|
|
@@ -13543,12 +13543,12 @@ const TreeServices = {
|
|
|
13543
13543
|
}
|
|
13544
13544
|
};
|
|
13545
13545
|
const API$a = ({ headers = {}, params = {} } = {}) => {
|
|
13546
|
-
const
|
|
13546
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
13547
13547
|
const instance = axios.create({
|
|
13548
13548
|
baseURL: "https://dev-api.tagsamurai.com/fam/routine/v2/",
|
|
13549
13549
|
headers: {
|
|
13550
13550
|
"Content-type": "application/json",
|
|
13551
|
-
"Authorization": `Bearer ${
|
|
13551
|
+
"Authorization": `Bearer ${user.token}`,
|
|
13552
13552
|
...headers
|
|
13553
13553
|
},
|
|
13554
13554
|
params
|
|
@@ -27262,11 +27262,11 @@ const VueHtmlToPaper = {
|
|
|
27262
27262
|
const apiEnv = "https://dev-api.tagsamurai.com/fam";
|
|
27263
27263
|
const BASE_URL = window.Cypress ? "https://localhost:9080" : apiEnv;
|
|
27264
27264
|
const api = ({ headers = {}, params = {} } = {}) => {
|
|
27265
|
-
const
|
|
27265
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
27266
27266
|
const instance = axios.create({
|
|
27267
27267
|
baseURL: `${BASE_URL}/transfer/v2/transaction`,
|
|
27268
27268
|
headers: {
|
|
27269
|
-
"Authorization": `Bearer ${
|
|
27269
|
+
"Authorization": `Bearer ${user.token}`,
|
|
27270
27270
|
"Content-type": "application/json",
|
|
27271
27271
|
...headers
|
|
27272
27272
|
},
|
|
@@ -27592,13 +27592,13 @@ const getBaseURL$1 = (env) => {
|
|
|
27592
27592
|
return process.env["VUE_" + env];
|
|
27593
27593
|
};
|
|
27594
27594
|
const API$9 = ({ headers = {}, params = {} } = {}) => {
|
|
27595
|
-
const
|
|
27595
|
+
const user = JSON.parse(localStorage.getItem("user")) ?? {};
|
|
27596
27596
|
const BASE_URL2 = getBaseURL$1("APP_TAGSAMURAI_API");
|
|
27597
27597
|
const instance = axios.create({
|
|
27598
27598
|
baseURL: `${BASE_URL2}/repair/v2/damage`,
|
|
27599
27599
|
headers: {
|
|
27600
27600
|
"Content-type": "application/json",
|
|
27601
|
-
"Authorization": `Bearer ${
|
|
27601
|
+
"Authorization": `Bearer ${user.token}`,
|
|
27602
27602
|
...headers
|
|
27603
27603
|
},
|
|
27604
27604
|
params
|
|
@@ -27911,13 +27911,13 @@ const getBaseURL = (env) => {
|
|
|
27911
27911
|
return process.env["VUE_" + env];
|
|
27912
27912
|
};
|
|
27913
27913
|
const API$8 = ({ headers = {}, params = {} } = {}) => {
|
|
27914
|
-
const
|
|
27914
|
+
const user = JSON.parse(localStorage.getItem("user")) ?? {};
|
|
27915
27915
|
const BASE_URL2 = getBaseURL("APP_TAGSAMURAI_API");
|
|
27916
27916
|
const instance = axios.create({
|
|
27917
27917
|
baseURL: `${BASE_URL2}/tracking/v2/missing`,
|
|
27918
27918
|
headers: {
|
|
27919
27919
|
"Content-type": "application/json",
|
|
27920
|
-
"Authorization": `Bearer ${
|
|
27920
|
+
"Authorization": `Bearer ${user.token}`,
|
|
27921
27921
|
...headers
|
|
27922
27922
|
},
|
|
27923
27923
|
params
|
|
@@ -36322,13 +36322,13 @@ const getErrorCode = (error) => {
|
|
|
36322
36322
|
return void 0;
|
|
36323
36323
|
};
|
|
36324
36324
|
const API$7 = ({ headers = {}, params = {} } = {}) => {
|
|
36325
|
-
const
|
|
36325
|
+
const user = JSON.parse(localStorage.getItem("user")) ?? {};
|
|
36326
36326
|
const BASE_URL2 = "https://dev-api.tagsamurai.com/fam";
|
|
36327
36327
|
const instance = axios.create({
|
|
36328
36328
|
baseURL: `${BASE_URL2}/iot/v2`,
|
|
36329
36329
|
headers: {
|
|
36330
36330
|
"Content-type": "application/json",
|
|
36331
|
-
"Authorization": `Bearer ${
|
|
36331
|
+
"Authorization": `Bearer ${user.token}`,
|
|
36332
36332
|
...headers
|
|
36333
36333
|
},
|
|
36334
36334
|
params
|
|
@@ -36699,13 +36699,13 @@ const API$6 = ({
|
|
|
36699
36699
|
headers = {},
|
|
36700
36700
|
params = {}
|
|
36701
36701
|
} = {}) => {
|
|
36702
|
-
const
|
|
36702
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
36703
36703
|
const BASE_URL2 = "https://dev-api.tagsamurai.com/fam";
|
|
36704
36704
|
const instance = axios.create({
|
|
36705
36705
|
baseURL: `${BASE_URL2}/tag/v2/scan-log`,
|
|
36706
36706
|
headers: {
|
|
36707
36707
|
"Content-type": "application/json",
|
|
36708
|
-
"Authorization": `Bearer ${
|
|
36708
|
+
"Authorization": `Bearer ${user.token}`,
|
|
36709
36709
|
...headers
|
|
36710
36710
|
},
|
|
36711
36711
|
params
|
|
@@ -51742,8 +51742,9 @@ function cloneDeep(value) {
|
|
|
51742
51742
|
}
|
|
51743
51743
|
var cloneDeep_1 = cloneDeep;
|
|
51744
51744
|
const cloneDeep$1 = /* @__PURE__ */ getDefaultExportFromCjs(cloneDeep_1);
|
|
51745
|
-
const
|
|
51745
|
+
const getUser = () => JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
51746
51746
|
const API$5 = ({ headers = {}, params = {} } = {}) => {
|
|
51747
|
+
const user = getUser();
|
|
51747
51748
|
const BASE_URL2 = "https://dev-api.global-settings.tagsamurai.com";
|
|
51748
51749
|
const instance = axios.create({
|
|
51749
51750
|
baseURL: `${BASE_URL2}/v1/global-settings`,
|
|
@@ -51758,26 +51759,34 @@ const API$5 = ({ headers = {}, params = {} } = {}) => {
|
|
|
51758
51759
|
};
|
|
51759
51760
|
const ColumnServices = {
|
|
51760
51761
|
getColumnSetup: (tableId) => {
|
|
51762
|
+
const user = getUser();
|
|
51761
51763
|
return API$5().get(`/columns/${user._id}/${tableId}`);
|
|
51762
51764
|
},
|
|
51763
51765
|
editColumnSetup: (tableId, body) => {
|
|
51766
|
+
const user = getUser();
|
|
51764
51767
|
return API$5().put(`/columns/${user._id}/${tableId}`, { data: body });
|
|
51765
51768
|
}
|
|
51766
51769
|
};
|
|
51767
51770
|
async function readConfig(tableId, defaultColumns) {
|
|
51768
|
-
|
|
51769
|
-
|
|
51770
|
-
|
|
51771
|
-
|
|
51772
|
-
|
|
51773
|
-
|
|
51774
|
-
|
|
51775
|
-
|
|
51776
|
-
|
|
51777
|
-
|
|
51778
|
-
|
|
51779
|
-
|
|
51780
|
-
|
|
51771
|
+
try {
|
|
51772
|
+
const {
|
|
51773
|
+
data: { data: tableConfig }
|
|
51774
|
+
} = await ColumnServices.getColumnSetup(tableId);
|
|
51775
|
+
if (tableConfig && tableConfig.length > 0) {
|
|
51776
|
+
return tableConfig.map((conf) => {
|
|
51777
|
+
const foundCol = defaultColumns.find(
|
|
51778
|
+
(col) => col.field === conf.field
|
|
51779
|
+
);
|
|
51780
|
+
if (!foundCol || foundCol.visible === false)
|
|
51781
|
+
return void 0;
|
|
51782
|
+
return {
|
|
51783
|
+
...foundCol,
|
|
51784
|
+
...conf
|
|
51785
|
+
};
|
|
51786
|
+
}).filter((col) => !!col);
|
|
51787
|
+
}
|
|
51788
|
+
} catch (error) {
|
|
51789
|
+
console.error(error);
|
|
51781
51790
|
}
|
|
51782
51791
|
return defaultColumns;
|
|
51783
51792
|
}
|
|
@@ -52027,7 +52036,11 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
52027
52036
|
};
|
|
52028
52037
|
}
|
|
52029
52038
|
);
|
|
52030
|
-
|
|
52039
|
+
try {
|
|
52040
|
+
await ColumnServices.editColumnSetup(props.tableId, columnsConfig);
|
|
52041
|
+
} catch (error) {
|
|
52042
|
+
console.error(error);
|
|
52043
|
+
}
|
|
52031
52044
|
}
|
|
52032
52045
|
};
|
|
52033
52046
|
const teleportColumnList = (source, target) => {
|
|
@@ -52838,7 +52851,11 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
|
52838
52851
|
width: colElement ? getComputedStyle(colElement).width : column.width ?? "max-content"
|
|
52839
52852
|
};
|
|
52840
52853
|
});
|
|
52841
|
-
|
|
52854
|
+
try {
|
|
52855
|
+
await ColumnServices.editColumnSetup(dataTableID.value, columnConfig);
|
|
52856
|
+
} catch (error) {
|
|
52857
|
+
console.error(error);
|
|
52858
|
+
}
|
|
52842
52859
|
}
|
|
52843
52860
|
};
|
|
52844
52861
|
const getColumnStyle = (col) => {
|
|
@@ -64580,8 +64597,8 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
64580
64597
|
const roleData = props.user ?? props.asset;
|
|
64581
64598
|
if (!roleData)
|
|
64582
64599
|
return [];
|
|
64583
|
-
const
|
|
64584
|
-
const companyAddons =
|
|
64600
|
+
const user = JSON.parse(localStorage.user ?? "{}");
|
|
64601
|
+
const companyAddons = user.addOn;
|
|
64585
64602
|
const transaction = [
|
|
64586
64603
|
{
|
|
64587
64604
|
label: "Borrowing",
|
|
@@ -69045,13 +69062,13 @@ const API$4 = ({
|
|
|
69045
69062
|
headers = {},
|
|
69046
69063
|
params = {}
|
|
69047
69064
|
} = {}) => {
|
|
69048
|
-
const
|
|
69065
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
69049
69066
|
const BASE_URL2 = "https://dev-api.tagsamurai.com/fam";
|
|
69050
69067
|
const instance = axios.create({
|
|
69051
69068
|
baseURL: `${BASE_URL2}/tag/v2/qr`,
|
|
69052
69069
|
headers: {
|
|
69053
69070
|
"Content-type": "application/json",
|
|
69054
|
-
"Authorization": `Bearer ${
|
|
69071
|
+
"Authorization": `Bearer ${user.token}`,
|
|
69055
69072
|
...headers
|
|
69056
69073
|
},
|
|
69057
69074
|
params
|
|
@@ -69463,12 +69480,12 @@ const API$3 = ({
|
|
|
69463
69480
|
headers = {},
|
|
69464
69481
|
params = {}
|
|
69465
69482
|
} = {}) => {
|
|
69466
|
-
const
|
|
69483
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
69467
69484
|
const BASE_URL2 = "https://dev-api.tagsamurai.com/fam";
|
|
69468
69485
|
const instance = axios.create({
|
|
69469
69486
|
baseURL: `${BASE_URL2}/damage-repair-ticketing/v2/damage`,
|
|
69470
69487
|
headers: {
|
|
69471
|
-
Authorization: `Bearer ${
|
|
69488
|
+
Authorization: `Bearer ${user.token}`,
|
|
69472
69489
|
...headers
|
|
69473
69490
|
},
|
|
69474
69491
|
params
|
|
@@ -69765,13 +69782,13 @@ const API$2 = ({
|
|
|
69765
69782
|
headers = {},
|
|
69766
69783
|
params = {}
|
|
69767
69784
|
} = {}) => {
|
|
69768
|
-
const
|
|
69785
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
69769
69786
|
const BASE_URL2 = "https://dev-api.tagsamurai.com/fam";
|
|
69770
69787
|
const instance = axios.create({
|
|
69771
69788
|
baseURL: `${BASE_URL2}/missing-tracking/v2/missing`,
|
|
69772
69789
|
headers: {
|
|
69773
69790
|
"Content-type": "application/json",
|
|
69774
|
-
"Authorization": `Bearer ${
|
|
69791
|
+
"Authorization": `Bearer ${user.token}`,
|
|
69775
69792
|
...headers
|
|
69776
69793
|
},
|
|
69777
69794
|
params
|
|
@@ -69788,13 +69805,13 @@ const API$1 = ({
|
|
|
69788
69805
|
headers = {},
|
|
69789
69806
|
params = {}
|
|
69790
69807
|
} = {}) => {
|
|
69791
|
-
const
|
|
69808
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
69792
69809
|
const BASE_URL2 = "https://dev-api.tagsamurai.com/fam";
|
|
69793
69810
|
const instance = axios.create({
|
|
69794
69811
|
baseURL: `${BASE_URL2}/missing-tracking/v2/tracking`,
|
|
69795
69812
|
headers: {
|
|
69796
69813
|
"Content-type": "application/json",
|
|
69797
|
-
"Authorization": `Bearer ${
|
|
69814
|
+
"Authorization": `Bearer ${user.token}`,
|
|
69798
69815
|
...headers
|
|
69799
69816
|
},
|
|
69800
69817
|
params
|
|
@@ -69947,13 +69964,13 @@ const API = ({
|
|
|
69947
69964
|
headers = {},
|
|
69948
69965
|
params = {}
|
|
69949
69966
|
} = {}) => {
|
|
69950
|
-
const
|
|
69967
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
69951
69968
|
const BASE_URL2 = "https://dev-api.tagsamurai.com/fam";
|
|
69952
69969
|
const instance = axios.create({
|
|
69953
69970
|
baseURL: `${BASE_URL2}/tag/v2/tag-transaction`,
|
|
69954
69971
|
headers: {
|
|
69955
69972
|
"Content-type": "application/json",
|
|
69956
|
-
"Authorization": `Bearer ${
|
|
69973
|
+
"Authorization": `Bearer ${user.token}`,
|
|
69957
69974
|
...headers
|
|
69958
69975
|
},
|
|
69959
69976
|
params
|