edmaxlabs-core 2.6.6 → 2.6.7
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 +4 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1332,18 +1332,6 @@ var Database = class {
|
|
|
1332
1332
|
// src/database/Realtime.ts
|
|
1333
1333
|
import { io } from "socket.io-client";
|
|
1334
1334
|
|
|
1335
|
-
// src/utils/uuid.ts
|
|
1336
|
-
function generateUUID() {
|
|
1337
|
-
if (typeof crypto !== "undefined" && crypto.randomUUID) {
|
|
1338
|
-
return crypto.randomUUID();
|
|
1339
|
-
}
|
|
1340
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
1341
|
-
const r = Math.random() * 16 | 0;
|
|
1342
|
-
const v = c === "x" ? r : r & 3 | 8;
|
|
1343
|
-
return v.toString(16);
|
|
1344
|
-
});
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
1335
|
// src/utils/documentNomalizer.ts
|
|
1348
1336
|
function normalizePayload(payload) {
|
|
1349
1337
|
const raw = payload?.document ?? payload?.data ?? payload;
|
|
@@ -1419,9 +1407,9 @@ var Realtime = class {
|
|
|
1419
1407
|
*/
|
|
1420
1408
|
subscribeToCollectionRaw(collection, callback, filter = {}) {
|
|
1421
1409
|
this.connect();
|
|
1422
|
-
const lid =
|
|
1410
|
+
const lid = collection;
|
|
1423
1411
|
const handlers = [];
|
|
1424
|
-
this.socket.emit("subscribe", { collection, filter
|
|
1412
|
+
this.socket.emit("subscribe", { collection, filter });
|
|
1425
1413
|
this.events.forEach((event) => {
|
|
1426
1414
|
const channel = `${lid}-${event}`;
|
|
1427
1415
|
const fn = (payload) => {
|
|
@@ -1445,10 +1433,10 @@ var Realtime = class {
|
|
|
1445
1433
|
*/
|
|
1446
1434
|
subscribeToDocumentRaw(collection, id, callback) {
|
|
1447
1435
|
this.connect();
|
|
1448
|
-
const lid =
|
|
1436
|
+
const lid = collection;
|
|
1449
1437
|
const filter = { _id: id };
|
|
1450
1438
|
const handlers = [];
|
|
1451
|
-
this.socket.emit("subscribe", { collection, filter
|
|
1439
|
+
this.socket.emit("subscribe", { collection, filter });
|
|
1452
1440
|
this.events.forEach((event) => {
|
|
1453
1441
|
const channel = `${lid}-${event}`;
|
|
1454
1442
|
const fn = (payload) => {
|