@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 CHANGED
@@ -724,13 +724,13 @@ var getData = async ({ id, dataSource, isPersisting, schema, SQLite, changeTime
724
724
  } else if (isPersisting && SQLite) {
725
725
  console.time("Persisted Data");
726
726
  const qDatum = await SQLite.read(`SELECT * FROM documents WHERE model = '${id}' ORDER BY lastUpdate DESC`);
727
- systemLog("axios", "SQLite.read Posledni datum update: ", qDatum[0]?.lastUpdate);
727
+ console.warn("[axios] SQLite.read Posledni datum update: ", qDatum[0]?.lastUpdate);
728
728
  if (qDatum[0]?.lastUpdate) params.changeTimeFrom = qDatum[0].lastUpdate;
729
729
  persistedData = qDatum.map((item) => {
730
730
  try {
731
731
  const parsedData = typeof item.data === "string" ? JSON.parse(item.data) : item.data;
732
732
  if (!parsedData || typeof parsedData !== "object" || Array.isArray(parsedData)) {
733
- systemLog("axios", "SQLite.read Preskakuji neplatny dokument:", item.id);
733
+ console.warn("[axios] SQLite.read Preskakuji neplatny dokument:", item.id);
734
734
  return null;
735
735
  }
736
736
  return { id: item.id, ...parsedData };
@@ -780,9 +780,8 @@ var getData = async ({ id, dataSource, isPersisting, schema, SQLite, changeTime
780
780
  newData = axiosResponse.data.data;
781
781
  }
782
782
  const dataCount = Array.isArray(newData) ? newData.length : "single";
783
- systemLog(
784
- "axios",
785
- `(SERVER TIME: ${axiosResponse.data.queryTime}) Data:`,
783
+ console.log(
784
+ `[axios](SERVER TIME: ${axiosResponse.data.queryTime}) Data:`,
786
785
  dataCount,
787
786
  "items, Size:",
788
787
  JSON.stringify(newData).length,
@@ -812,7 +811,8 @@ var getData = async ({ id, dataSource, isPersisting, schema, SQLite, changeTime
812
811
  }
813
812
  } catch (e) {
814
813
  const msg = e instanceof Error ? e.message : String(e);
815
- console.error(`[AXIOS] CHYBA PRI NACITANI DAT Z:`, JSON.stringify(dataSource, null, 2), "\nChyba:", msg);
814
+ console.warn(`[AXIOS] Warn CHYBABA PRI NACITANI DAT Z:`, JSON.stringify(dataSource, null, 2), "\nChyba:", msg);
815
+ console.error(`[AXIOS] CHYBABA PRI NACITANI DAT Z:`, JSON.stringify(dataSource, null, 2), "\nChyba:", msg);
816
816
  throw e;
817
817
  }
818
818
  };