edmaxlabs-core 2.6.6 → 2.6.8
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 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -869,7 +869,6 @@ var Query = class {
|
|
|
869
869
|
return [];
|
|
870
870
|
}
|
|
871
871
|
const snapshots = res.documents.map((d) => {
|
|
872
|
-
delete d.token;
|
|
873
872
|
d.id = d.id ?? d._id;
|
|
874
873
|
delete d._id;
|
|
875
874
|
return DocumentSnapshot.fromMap(d);
|
|
@@ -1118,7 +1117,6 @@ var CollectionRef = class {
|
|
|
1118
1117
|
return [];
|
|
1119
1118
|
}
|
|
1120
1119
|
return res.documents.map((d) => {
|
|
1121
|
-
delete d.token;
|
|
1122
1120
|
d.id = d.id ?? d._id;
|
|
1123
1121
|
delete d._id;
|
|
1124
1122
|
return DocumentSnapshot.fromMap(d);
|
|
@@ -1364,18 +1362,6 @@ var Database = class {
|
|
|
1364
1362
|
// src/database/Realtime.ts
|
|
1365
1363
|
var import_socket = require("socket.io-client");
|
|
1366
1364
|
|
|
1367
|
-
// src/utils/uuid.ts
|
|
1368
|
-
function generateUUID() {
|
|
1369
|
-
if (typeof crypto !== "undefined" && crypto.randomUUID) {
|
|
1370
|
-
return crypto.randomUUID();
|
|
1371
|
-
}
|
|
1372
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
1373
|
-
const r = Math.random() * 16 | 0;
|
|
1374
|
-
const v = c === "x" ? r : r & 3 | 8;
|
|
1375
|
-
return v.toString(16);
|
|
1376
|
-
});
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
1365
|
// src/utils/documentNomalizer.ts
|
|
1380
1366
|
function normalizePayload(payload) {
|
|
1381
1367
|
const raw = payload?.document ?? payload?.data ?? payload;
|
|
@@ -1451,9 +1437,9 @@ var Realtime = class {
|
|
|
1451
1437
|
*/
|
|
1452
1438
|
subscribeToCollectionRaw(collection, callback, filter = {}) {
|
|
1453
1439
|
this.connect();
|
|
1454
|
-
const lid =
|
|
1440
|
+
const lid = collection;
|
|
1455
1441
|
const handlers = [];
|
|
1456
|
-
this.socket.emit("subscribe", { collection, filter
|
|
1442
|
+
this.socket.emit("subscribe", { collection, filter });
|
|
1457
1443
|
this.events.forEach((event) => {
|
|
1458
1444
|
const channel = `${lid}-${event}`;
|
|
1459
1445
|
const fn = (payload) => {
|
|
@@ -1477,10 +1463,10 @@ var Realtime = class {
|
|
|
1477
1463
|
*/
|
|
1478
1464
|
subscribeToDocumentRaw(collection, id, callback) {
|
|
1479
1465
|
this.connect();
|
|
1480
|
-
const lid =
|
|
1466
|
+
const lid = collection;
|
|
1481
1467
|
const filter = { _id: id };
|
|
1482
1468
|
const handlers = [];
|
|
1483
|
-
this.socket.emit("subscribe", { collection, filter
|
|
1469
|
+
this.socket.emit("subscribe", { collection, filter });
|
|
1484
1470
|
this.events.forEach((event) => {
|
|
1485
1471
|
const channel = `${lid}-${event}`;
|
|
1486
1472
|
const fn = (payload) => {
|