@mgarlik/datastore 0.1.15 → 0.1.16
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.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -654,13 +654,13 @@ var getData = async ({ id, dataSource, isPersisting, schema, SQLite, changeTime
|
|
|
654
654
|
} else if (isPersisting && SQLite) {
|
|
655
655
|
console.time("Persisted Data");
|
|
656
656
|
const qDatum = await SQLite.read(`SELECT * FROM documents WHERE model = '${id}' ORDER BY lastUpdate DESC`);
|
|
657
|
-
|
|
657
|
+
console.warn("[axios] SQLite.read Posledni datum update: ", qDatum[0]?.lastUpdate);
|
|
658
658
|
if (qDatum[0]?.lastUpdate) params.changeTimeFrom = qDatum[0].lastUpdate;
|
|
659
659
|
persistedData = qDatum.map((item) => {
|
|
660
660
|
try {
|
|
661
661
|
const parsedData = typeof item.data === "string" ? JSON.parse(item.data) : item.data;
|
|
662
662
|
if (!parsedData || typeof parsedData !== "object" || Array.isArray(parsedData)) {
|
|
663
|
-
|
|
663
|
+
console.warn("[axios] SQLite.read Preskakuji neplatny dokument:", item.id);
|
|
664
664
|
return null;
|
|
665
665
|
}
|
|
666
666
|
return { id: item.id, ...parsedData };
|
|
@@ -710,9 +710,8 @@ var getData = async ({ id, dataSource, isPersisting, schema, SQLite, changeTime
|
|
|
710
710
|
newData = axiosResponse.data.data;
|
|
711
711
|
}
|
|
712
712
|
const dataCount = Array.isArray(newData) ? newData.length : "single";
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
`(SERVER TIME: ${axiosResponse.data.queryTime}) Data:`,
|
|
713
|
+
console.log(
|
|
714
|
+
`[axios](SERVER TIME: ${axiosResponse.data.queryTime}) Data:`,
|
|
716
715
|
dataCount,
|
|
717
716
|
"items, Size:",
|
|
718
717
|
JSON.stringify(newData).length,
|
|
@@ -742,7 +741,8 @@ var getData = async ({ id, dataSource, isPersisting, schema, SQLite, changeTime
|
|
|
742
741
|
}
|
|
743
742
|
} catch (e) {
|
|
744
743
|
const msg = e instanceof Error ? e.message : String(e);
|
|
745
|
-
console.
|
|
744
|
+
console.warn(`[AXIOS] Warn CHYBABA PRI NACITANI DAT Z:`, JSON.stringify(dataSource, null, 2), "\nChyba:", msg);
|
|
745
|
+
console.error(`[AXIOS] CHYBABA PRI NACITANI DAT Z:`, JSON.stringify(dataSource, null, 2), "\nChyba:", msg);
|
|
746
746
|
throw e;
|
|
747
747
|
}
|
|
748
748
|
};
|