@vue-skuilder/db 0.1.13-8 → 0.1.13
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/core/index.d.mts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-CNyNuV0r.d.ts → dataLayerProvider-BV5iZqt_.d.ts} +1 -1
- package/dist/{dataLayerProvider-BKo0bz_q.d.mts → dataLayerProvider-VlngD19_.d.mts} +1 -1
- package/dist/impl/couch/index.d.mts +2 -2
- package/dist/impl/couch/index.d.ts +2 -2
- package/dist/impl/couch/index.js +22 -3
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +22 -3
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.mts +2 -2
- package/dist/impl/static/index.d.ts +2 -2
- package/dist/impl/static/index.js +22 -3
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +22 -3
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +22 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{userDB-zzBUpIzY.d.mts → userDB-BqwxtJ_7.d.mts} +12 -1
- package/dist/{userDB-aPdG17B4.d.ts → userDB-DNa0XPtn.d.ts} +12 -1
- package/package.json +3 -3
- package/src/core/interfaces/contentSource.ts +2 -0
- package/src/core/types/user.ts +15 -0
- package/src/impl/common/BaseUserDB.ts +34 -7
package/dist/index.mjs
CHANGED
|
@@ -2464,18 +2464,37 @@ function accomodateGuest() {
|
|
|
2464
2464
|
};
|
|
2465
2465
|
function generateUUID() {
|
|
2466
2466
|
logger.log("[funnel] Inside generateUUID()");
|
|
2467
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
2468
|
+
const uuid2 = crypto.randomUUID();
|
|
2469
|
+
logger.log("[funnel] Generated UUID using crypto.randomUUID():", uuid2);
|
|
2470
|
+
return uuid2;
|
|
2471
|
+
}
|
|
2472
|
+
if (typeof crypto !== "undefined" && typeof crypto.getRandomValues === "function") {
|
|
2473
|
+
const bytes = new Uint8Array(16);
|
|
2474
|
+
crypto.getRandomValues(bytes);
|
|
2475
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
2476
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
2477
|
+
const uuid2 = [
|
|
2478
|
+
Array.from(bytes.slice(0, 4)).map((b) => b.toString(16).padStart(2, "0")).join(""),
|
|
2479
|
+
Array.from(bytes.slice(4, 6)).map((b) => b.toString(16).padStart(2, "0")).join(""),
|
|
2480
|
+
Array.from(bytes.slice(6, 8)).map((b) => b.toString(16).padStart(2, "0")).join(""),
|
|
2481
|
+
Array.from(bytes.slice(8, 10)).map((b) => b.toString(16).padStart(2, "0")).join(""),
|
|
2482
|
+
Array.from(bytes.slice(10, 16)).map((b) => b.toString(16).padStart(2, "0")).join("")
|
|
2483
|
+
].join("-");
|
|
2484
|
+
logger.log("[funnel] Generated UUID using crypto.getRandomValues():", uuid2);
|
|
2485
|
+
return uuid2;
|
|
2486
|
+
}
|
|
2487
|
+
logger.warn("[funnel] crypto API not available, using timestamp-based UUID (NOT SECURE)");
|
|
2467
2488
|
let d = (/* @__PURE__ */ new Date()).getTime();
|
|
2468
|
-
logger.log("[funnel] Date timestamp:", d);
|
|
2469
2489
|
if (typeof performance !== "undefined" && typeof performance.now === "function") {
|
|
2470
2490
|
d += performance.now();
|
|
2471
|
-
logger.log("[funnel] After adding performance.now():", d);
|
|
2472
2491
|
}
|
|
2473
2492
|
const uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
2474
2493
|
const r = (d + Math.random() * 16) % 16 | 0;
|
|
2475
2494
|
d = Math.floor(d / 16);
|
|
2476
2495
|
return (c === "x" ? r : r & 3 | 8).toString(16);
|
|
2477
2496
|
});
|
|
2478
|
-
logger.log("[funnel] Generated UUID
|
|
2497
|
+
logger.log("[funnel] Generated UUID (fallback):", uuid);
|
|
2479
2498
|
return uuid;
|
|
2480
2499
|
}
|
|
2481
2500
|
}
|