@instantdb/core 0.22.89-experimental.uuidfix.20282483875.1 → 0.22.89
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/__tests__/src/Reactor.test.js +1 -1
- package/dist/commonjs/Reactor.js +10 -10
- package/dist/commonjs/Reactor.js.map +1 -1
- package/dist/commonjs/SyncTable.js +3 -3
- package/dist/commonjs/SyncTable.js.map +1 -1
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +2 -2
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/instaml.js +8 -8
- package/dist/commonjs/instaml.js.map +1 -1
- package/dist/commonjs/instaql.js +2 -2
- package/dist/commonjs/instaql.js.map +1 -1
- package/dist/commonjs/utils/{id.d.ts → uuid.d.ts} +1 -1
- package/dist/commonjs/utils/uuid.d.ts.map +1 -0
- package/dist/commonjs/utils/{id.js → uuid.js} +1 -1
- package/dist/commonjs/utils/uuid.js.map +1 -0
- package/dist/esm/Reactor.js +1 -1
- package/dist/esm/Reactor.js.map +1 -1
- package/dist/esm/SyncTable.js +1 -1
- package/dist/esm/SyncTable.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/instaml.js +1 -1
- package/dist/esm/instaml.js.map +1 -1
- package/dist/esm/instaql.js +1 -1
- package/dist/esm/instaql.js.map +1 -1
- package/dist/esm/utils/{id.d.ts → uuid.d.ts} +1 -1
- package/dist/esm/utils/uuid.d.ts.map +1 -0
- package/dist/esm/utils/{id.js → uuid.js} +1 -1
- package/dist/esm/utils/uuid.js.map +1 -0
- package/dist/standalone/index.js +1 -1
- package/dist/standalone/index.umd.cjs +2 -2
- package/package.json +2 -2
- package/src/Reactor.js +1 -1
- package/src/SyncTable.ts +1 -1
- package/src/index.ts +1 -1
- package/src/instaml.ts +1 -1
- package/src/instaql.ts +1 -1
- package/dist/commonjs/utils/id.d.ts.map +0 -1
- package/dist/commonjs/utils/id.js.map +0 -1
- package/dist/esm/utils/id.d.ts.map +0 -1
- package/dist/esm/utils/id.js.map +0 -1
- /package/src/utils/{id.ts → uuid.ts} +0 -0
|
@@ -11,7 +11,7 @@ import * as instaml from '../../src/instaml';
|
|
|
11
11
|
import * as instatx from '../../src/instatx';
|
|
12
12
|
import zenecaAttrs from './data/zeneca/attrs.json';
|
|
13
13
|
import zenecaTriples from './data/zeneca/triples.json';
|
|
14
|
-
import uuid from '../../src/utils/
|
|
14
|
+
import uuid from '../../src/utils/uuid';
|
|
15
15
|
import { weakHash } from '../../src';
|
|
16
16
|
import { AttrsStoreClass } from '../../src/store';
|
|
17
17
|
|
package/dist/commonjs/Reactor.js
CHANGED
|
@@ -61,7 +61,7 @@ const weakHash_ts_1 = __importDefault(require("./utils/weakHash.js"));
|
|
|
61
61
|
const instaql_ts_1 = __importDefault(require("./instaql.js"));
|
|
62
62
|
const instaml = __importStar(require("./instaml.js"));
|
|
63
63
|
const s = __importStar(require("./store.js"));
|
|
64
|
-
const
|
|
64
|
+
const uuid_ts_1 = __importDefault(require("./utils/uuid.js"));
|
|
65
65
|
const IndexedDBStorage_ts_1 = __importDefault(require("./IndexedDBStorage.js"));
|
|
66
66
|
const WindowNetworkListener_js_1 = __importDefault(require("./WindowNetworkListener.js"));
|
|
67
67
|
const authAPI = __importStar(require("./authAPI.js"));
|
|
@@ -333,7 +333,7 @@ class Reactor {
|
|
|
333
333
|
* @returns
|
|
334
334
|
*/
|
|
335
335
|
this.pushOps = (txSteps, error) => {
|
|
336
|
-
const eventId = (0,
|
|
336
|
+
const eventId = (0, uuid_ts_1.default)();
|
|
337
337
|
const mutations = [...this._pendingMutations().values()];
|
|
338
338
|
const order = Math.max(0, ...mutations.map((mut) => mut.order || 0)) + 1;
|
|
339
339
|
const mutation = {
|
|
@@ -363,7 +363,7 @@ class Reactor {
|
|
|
363
363
|
this.getCurrentUser()
|
|
364
364
|
.then((resp) => {
|
|
365
365
|
var _a;
|
|
366
|
-
this._trySend((0,
|
|
366
|
+
this._trySend((0, uuid_ts_1.default)(), {
|
|
367
367
|
op: 'init',
|
|
368
368
|
'app-id': this.config.appId,
|
|
369
369
|
'refresh-token': (_a = resp.user) === null || _a === void 0 ? void 0 : _a['refresh_token'],
|
|
@@ -962,7 +962,7 @@ class Reactor {
|
|
|
962
962
|
this.notifyAttrsSubs();
|
|
963
963
|
}
|
|
964
964
|
_startQuerySub(q, hash) {
|
|
965
|
-
const eventId = (0,
|
|
965
|
+
const eventId = (0, uuid_ts_1.default)();
|
|
966
966
|
this.querySubs.updateInPlace((prev) => {
|
|
967
967
|
prev[hash] = prev[hash] || { q, result: null, eventId };
|
|
968
968
|
prev[hash].lastAccessed = Date.now();
|
|
@@ -1051,7 +1051,7 @@ class Reactor {
|
|
|
1051
1051
|
delete this.queryOnceDfds[hash];
|
|
1052
1052
|
delete this._dataForQueryCache[hash];
|
|
1053
1053
|
this.querySubs.unloadKey(hash);
|
|
1054
|
-
this._trySendAuthed((0,
|
|
1054
|
+
this._trySendAuthed((0, uuid_ts_1.default)(), { op: 'remove-query', q });
|
|
1055
1055
|
}
|
|
1056
1056
|
// When we `pushTx`, it's possible that we don't yet have `this.attrs`
|
|
1057
1057
|
// This means that `tx-steps` in `pendingMutations` will include `add-attr`
|
|
@@ -1425,7 +1425,7 @@ class Reactor {
|
|
|
1425
1425
|
if (current) {
|
|
1426
1426
|
return current;
|
|
1427
1427
|
}
|
|
1428
|
-
const newId = (0,
|
|
1428
|
+
const newId = (0, uuid_ts_1.default)();
|
|
1429
1429
|
this.kv.updateInPlace((prev) => {
|
|
1430
1430
|
if (prev[k])
|
|
1431
1431
|
return;
|
|
@@ -1891,18 +1891,18 @@ class Reactor {
|
|
|
1891
1891
|
this._notifyPresenceSubs(roomId);
|
|
1892
1892
|
}
|
|
1893
1893
|
_trySetPresence(roomId, data) {
|
|
1894
|
-
this._trySendAuthed((0,
|
|
1894
|
+
this._trySendAuthed((0, uuid_ts_1.default)(), {
|
|
1895
1895
|
op: 'set-presence',
|
|
1896
1896
|
'room-id': roomId,
|
|
1897
1897
|
data,
|
|
1898
1898
|
});
|
|
1899
1899
|
}
|
|
1900
1900
|
_tryJoinRoom(roomId, data) {
|
|
1901
|
-
this._trySendAuthed((0,
|
|
1901
|
+
this._trySendAuthed((0, uuid_ts_1.default)(), { op: 'join-room', 'room-id': roomId, data });
|
|
1902
1902
|
delete this._roomsPendingLeave[roomId];
|
|
1903
1903
|
}
|
|
1904
1904
|
_tryLeaveRoom(roomId) {
|
|
1905
|
-
this._trySendAuthed((0,
|
|
1905
|
+
this._trySendAuthed((0, uuid_ts_1.default)(), { op: 'leave-room', 'room-id': roomId });
|
|
1906
1906
|
}
|
|
1907
1907
|
_trySetRoomConnected(roomId, isConnected) {
|
|
1908
1908
|
const room = this._rooms[roomId];
|
|
@@ -1995,7 +1995,7 @@ class Reactor {
|
|
|
1995
1995
|
this._tryBroadcast(roomId, roomType, topic, data);
|
|
1996
1996
|
}
|
|
1997
1997
|
_tryBroadcast(roomId, roomType, topic, data) {
|
|
1998
|
-
this._trySendAuthed((0,
|
|
1998
|
+
this._trySendAuthed((0, uuid_ts_1.default)(), {
|
|
1999
1999
|
op: 'client-broadcast',
|
|
2000
2000
|
'room-id': roomId,
|
|
2001
2001
|
roomType,
|