@instantdb/core 0.22.88-experimental.version-bump-0-22-88.20244772799.1 → 0.22.89-experimental.drewh-ssr.20277611943.1
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 +18 -11
- package/__tests__/src/{datalog.test.js → datalog.test.ts} +17 -5
- package/__tests__/src/{instaml.test.js → instaml.test.ts} +183 -119
- package/__tests__/src/instaql.bench.ts +34 -0
- package/__tests__/src/{instaql.test.js → instaql.test.ts} +342 -455
- package/__tests__/src/instaqlInference.test.js +13 -9
- package/__tests__/src/serializeSchema.test.ts +123 -0
- package/__tests__/src/{store.test.js → store.test.ts} +215 -212
- package/dist/commonjs/Reactor.d.ts +36 -7
- package/dist/commonjs/Reactor.d.ts.map +1 -1
- package/dist/commonjs/Reactor.js +176 -47
- package/dist/commonjs/Reactor.js.map +1 -1
- package/dist/commonjs/SyncTable.d.ts +4 -1
- package/dist/commonjs/SyncTable.d.ts.map +1 -1
- package/dist/commonjs/SyncTable.js +35 -37
- package/dist/commonjs/SyncTable.js.map +1 -1
- package/dist/commonjs/createRouteHandler.d.ts +8 -0
- package/dist/commonjs/createRouteHandler.d.ts.map +1 -0
- package/dist/commonjs/createRouteHandler.js +57 -0
- package/dist/commonjs/createRouteHandler.js.map +1 -0
- package/dist/commonjs/framework.d.ts +77 -0
- package/dist/commonjs/framework.d.ts.map +1 -0
- package/dist/commonjs/framework.js +209 -0
- package/dist/commonjs/framework.js.map +1 -0
- package/dist/commonjs/index.d.ts +5 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +7 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/instaml.d.ts +17 -4
- package/dist/commonjs/instaml.d.ts.map +1 -1
- package/dist/commonjs/instaml.js +115 -82
- package/dist/commonjs/instaml.js.map +1 -1
- package/dist/commonjs/instaql.d.ts +4 -3
- package/dist/commonjs/instaql.d.ts.map +1 -1
- package/dist/commonjs/instaql.js +65 -63
- package/dist/commonjs/instaql.js.map +1 -1
- package/dist/commonjs/parseSchemaFromJSON.d.ts +3 -0
- package/dist/commonjs/parseSchemaFromJSON.d.ts.map +1 -0
- package/dist/commonjs/parseSchemaFromJSON.js +148 -0
- package/dist/commonjs/parseSchemaFromJSON.js.map +1 -0
- package/dist/commonjs/reactorTypes.d.ts +30 -0
- package/dist/commonjs/reactorTypes.d.ts.map +1 -0
- package/dist/commonjs/reactorTypes.js +3 -0
- package/dist/commonjs/reactorTypes.js.map +1 -0
- package/dist/commonjs/store.d.ts +67 -25
- package/dist/commonjs/store.d.ts.map +1 -1
- package/dist/commonjs/store.js +177 -81
- package/dist/commonjs/store.js.map +1 -1
- package/dist/esm/Reactor.d.ts +36 -7
- package/dist/esm/Reactor.d.ts.map +1 -1
- package/dist/esm/Reactor.js +177 -48
- package/dist/esm/Reactor.js.map +1 -1
- package/dist/esm/SyncTable.d.ts +4 -1
- package/dist/esm/SyncTable.d.ts.map +1 -1
- package/dist/esm/SyncTable.js +35 -37
- package/dist/esm/SyncTable.js.map +1 -1
- package/dist/esm/createRouteHandler.d.ts +8 -0
- package/dist/esm/createRouteHandler.d.ts.map +1 -0
- package/dist/esm/createRouteHandler.js +53 -0
- package/dist/esm/createRouteHandler.js.map +1 -0
- package/dist/esm/framework.d.ts +77 -0
- package/dist/esm/framework.d.ts.map +1 -0
- package/dist/esm/framework.js +169 -0
- package/dist/esm/framework.js.map +1 -0
- package/dist/esm/index.d.ts +5 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/instaml.d.ts +17 -4
- package/dist/esm/instaml.d.ts.map +1 -1
- package/dist/esm/instaml.js +112 -77
- package/dist/esm/instaml.js.map +1 -1
- package/dist/esm/instaql.d.ts +4 -3
- package/dist/esm/instaql.d.ts.map +1 -1
- package/dist/esm/instaql.js +65 -63
- package/dist/esm/instaql.js.map +1 -1
- package/dist/esm/parseSchemaFromJSON.d.ts +3 -0
- package/dist/esm/parseSchemaFromJSON.d.ts.map +1 -0
- package/dist/esm/parseSchemaFromJSON.js +144 -0
- package/dist/esm/parseSchemaFromJSON.js.map +1 -0
- package/dist/esm/reactorTypes.d.ts +30 -0
- package/dist/esm/reactorTypes.d.ts.map +1 -0
- package/dist/esm/reactorTypes.js +2 -0
- package/dist/esm/reactorTypes.js.map +1 -0
- package/dist/esm/store.d.ts +67 -25
- package/dist/esm/store.d.ts.map +1 -1
- package/dist/esm/store.js +174 -81
- package/dist/esm/store.js.map +1 -1
- package/dist/standalone/index.js +2899 -2389
- package/dist/standalone/index.umd.cjs +3 -3
- package/package.json +2 -2
- package/src/Reactor.js +232 -77
- package/src/SyncTable.ts +85 -45
- package/src/createRouteHandler.ts +44 -0
- package/src/framework.ts +294 -0
- package/src/index.ts +9 -0
- package/src/{instaml.js → instaml.ts} +201 -96
- package/src/instaql.ts +88 -62
- package/src/parseSchemaFromJSON.ts +176 -0
- package/src/reactorTypes.ts +33 -0
- package/src/store.ts +257 -101
- package/__tests__/src/instaql.bench.js +0 -29
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export default class Reactor<RoomSchema extends import("./presence.ts").RoomSchemaShape = {}> {
|
|
5
5
|
constructor(config: any, Storage: typeof IndexedDBStorage | undefined, NetworkListener: typeof WindowNetworkListener | undefined, versions: any, EventSourceConstructor: any);
|
|
6
|
-
|
|
6
|
+
/** @type {s.AttrsStore | undefined} */
|
|
7
|
+
attrs: s.AttrsStore | undefined;
|
|
7
8
|
_isOnline: boolean;
|
|
8
9
|
_isShutdown: boolean;
|
|
9
10
|
status: string;
|
|
10
|
-
/** @type {PersistedObject} */
|
|
11
|
-
querySubs: PersistedObject<
|
|
11
|
+
/** @type {PersistedObject<string, QuerySub, QuerySubInStorage>} */
|
|
12
|
+
querySubs: PersistedObject<string, QuerySub, QuerySubInStorage>;
|
|
12
13
|
/** @type {PersistedObject} */
|
|
13
14
|
kv: PersistedObject<any, any, any>;
|
|
14
15
|
/** @type {SyncTable} */
|
|
@@ -78,6 +79,7 @@ export default class Reactor<RoomSchema extends import("./presence.ts").RoomSche
|
|
|
78
79
|
queryCacheLimit: any;
|
|
79
80
|
versions: any;
|
|
80
81
|
_beforeUnload(): void;
|
|
82
|
+
ensureAttrs(): s.AttrsStore;
|
|
81
83
|
updateSchema(schema: any): void;
|
|
82
84
|
_reactorStats(): {
|
|
83
85
|
inFlightMutationCount: number;
|
|
@@ -100,6 +102,17 @@ export default class Reactor<RoomSchema extends import("./presence.ts").RoomSche
|
|
|
100
102
|
_setStatus(status: any, err: any): void;
|
|
101
103
|
_onMergeKv: (key: any, storageV: any, inMemoryV: any) => any;
|
|
102
104
|
_flushEnqueuedRoomData(roomId: any): void;
|
|
105
|
+
/**
|
|
106
|
+
* Does the same thing as add-query-ok
|
|
107
|
+
* but called as a result of receiving query info from ssr
|
|
108
|
+
* @param {any} q
|
|
109
|
+
* @param {{ triples: any; pageInfo: any; }} result
|
|
110
|
+
* @param {boolean} enableCardinalityInference
|
|
111
|
+
*/
|
|
112
|
+
_addQueryData(q: any, result: {
|
|
113
|
+
triples: any;
|
|
114
|
+
pageInfo: any;
|
|
115
|
+
}, enableCardinalityInference: boolean): void;
|
|
103
116
|
_handleReceive(connId: any, msg: any): void;
|
|
104
117
|
_sessionId: any;
|
|
105
118
|
_pendingMutations(): any;
|
|
@@ -139,12 +152,24 @@ export default class Reactor<RoomSchema extends import("./presence.ts").RoomSche
|
|
|
139
152
|
_unsubQuery(q: any, hash: any, cb: any): void;
|
|
140
153
|
_hasQueryListeners(hash: any): boolean;
|
|
141
154
|
_cleanupQuery(q: any, hash: any): void;
|
|
142
|
-
|
|
155
|
+
/**
|
|
156
|
+
*
|
|
157
|
+
* @param {s.AttrsStore} attrs
|
|
158
|
+
* @param {any} muts
|
|
159
|
+
* @param {number} [processedTxId]
|
|
160
|
+
*/
|
|
161
|
+
_rewriteMutations(attrs: s.AttrsStore, muts: any, processedTxId?: number): any;
|
|
143
162
|
_rewriteMutationsSorted(attrs: any, muts: any): any[];
|
|
144
|
-
|
|
163
|
+
/**
|
|
164
|
+
* @returns {s.AttrsStore}
|
|
165
|
+
*/
|
|
166
|
+
optimisticAttrs(): s.AttrsStore;
|
|
145
167
|
/** Runs instaql on a query and a store */
|
|
146
|
-
dataForQuery(hash: any): any;
|
|
147
|
-
_applyOptimisticUpdates(store: any, mutations: any, processedTxId: any):
|
|
168
|
+
dataForQuery(hash: any, applyOptimistic?: boolean): any;
|
|
169
|
+
_applyOptimisticUpdates(store: any, attrsStore: any, mutations: any, processedTxId: any): {
|
|
170
|
+
store: any;
|
|
171
|
+
attrsStore: any;
|
|
172
|
+
};
|
|
148
173
|
/** Re-run instaql and call all callbacks with new data */
|
|
149
174
|
notifyOne: (hash: any) => void;
|
|
150
175
|
notifyOneQueryOnce: (hash: any) => void;
|
|
@@ -246,6 +271,7 @@ export default class Reactor<RoomSchema extends import("./presence.ts").RoomSche
|
|
|
246
271
|
}>;
|
|
247
272
|
_hasCurrentUser(): Promise<boolean>;
|
|
248
273
|
changeCurrentUser(newUser: any): Promise<void>;
|
|
274
|
+
syncUserToEndpoint(user: any): Promise<void>;
|
|
249
275
|
updateUser(newUser: any): void;
|
|
250
276
|
sendMagicCode({ email }: {
|
|
251
277
|
email: any;
|
|
@@ -338,6 +364,9 @@ export type Logger = import("./utils/log.ts").Logger;
|
|
|
338
364
|
export type Connection = import("./Connection.ts").Connection<any>;
|
|
339
365
|
export type TransportType = import("./Connection.ts").TransportType;
|
|
340
366
|
export type EventSourceConstructor = import("./Connection.ts").EventSourceConstructor;
|
|
367
|
+
export type QuerySub = import("./reactorTypes.ts").QuerySub;
|
|
368
|
+
export type QuerySubInStorage = import("./reactorTypes.ts").QuerySubInStorage;
|
|
369
|
+
import * as s from './store.ts';
|
|
341
370
|
import { PersistedObject } from './utils/PersistedObject.ts';
|
|
342
371
|
import { SyncTable } from './SyncTable.ts';
|
|
343
372
|
import { Deferred } from './utils/Deferred.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Reactor.d.ts","sourceRoot":"","sources":["../../src/Reactor.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Reactor.d.ts","sourceRoot":"","sources":["../../src/Reactor.js"],"names":[],"mappings":"AAyMA;;GAEG;AACH,6BAFwD,UAAU,SAArD,OAAQ,eAAe,EAAE,eAAgB;IAmEpD,8KA2HC;IA3LD,uCAAuC;IACvC,OADW,CAAC,CAAC,UAAU,GAAG,SAAS,CAC7B;IACN,mBAAiB;IACjB,qBAAoB;IACpB,eAA2B;IAE3B,mEAAmE;IACnE,WADW,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CACrD;IAEV,8BAA8B;IAC9B,mCAAG;IAEH,wBAAwB;IACxB,YADW,SAAS,CACT;IAEX,wEAAwE;IACxE,UADW,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;QAAE,CAAC,EAAE,GAAG,CAAC;QAAC,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAA;KAAE,CAAC,CAAC,CACtD;IACd,gFAAgF;IAChF,eADW,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;QAAE,CAAC,EAAE,GAAG,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,QAAQ,CAAA;KAAE,CAAC,CAAC,CACzD;IACnB,eAAa;IACb,gBAAc;IACd,wBAAsB;IACtB,2BAAyB;IACzB,YAAO;IACP,qCAAkC;IAClC,0BAA2B;IAC3B,4BAAwB;IACxB,yBAAyB;IACzB,YADW,UAAU,CACV;IACX,4BAA4B;IAC5B,gBADW,aAAa,CACF;IAEtB,qCAAqC;IACrC,cADW,sBAAsB,CACpB;IACb,6BAA6B;IAC7B,OADW,OAAO,GAAG,IAAI,CACZ;IACb,qBAAsB;IACtB,oBAAqB;IACrB,gEAAgE;IAChE,wBADW,OAAO,CAA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,wCAWC;CACF;qBA58Ea,OAAO,gBAAgB,EAAE,MAAM;;4BAE/B,OAAO,iBAAiB,EAAE,aAAa;qCACvC,OAAO,iBAAiB,EAAE,sBAAsB;uBAChD,OAAO,mBAAmB,EAAE,QAAQ;gCACpC,OAAO,mBAAmB,EAAE,iBAAiB;mBAnCxC,YAAY;gCASC,4BAA4B;0BAmBlC,gBAAgB;yBApBjB,qBAAqB;yBAJrB,cAAc;4BACX,iBAAiB;6BAHhB,uBAAuB;kCAClB,4BAA4B"}
|
package/dist/commonjs/Reactor.js
CHANGED
|
@@ -87,6 +87,8 @@ const SyncTable_ts_1 = require("./SyncTable.js");
|
|
|
87
87
|
/** @typedef {import('./Connection.ts').Connection} Connection */
|
|
88
88
|
/** @typedef {import('./Connection.ts').TransportType} TransportType */
|
|
89
89
|
/** @typedef {import('./Connection.ts').EventSourceConstructor} EventSourceConstructor */
|
|
90
|
+
/** @typedef {import('./reactorTypes.ts').QuerySub} QuerySub */
|
|
91
|
+
/** @typedef {import('./reactorTypes.ts').QuerySubInStorage} QuerySubInStorage */
|
|
90
92
|
const STATUS = {
|
|
91
93
|
CONNECTING: 'connecting',
|
|
92
94
|
OPENED: 'opened',
|
|
@@ -139,20 +141,37 @@ const ignoreLogging = {
|
|
|
139
141
|
'refresh-presence': true,
|
|
140
142
|
'patch-presence': true,
|
|
141
143
|
};
|
|
144
|
+
/**
|
|
145
|
+
* @param {QuerySubInStorage} x
|
|
146
|
+
* @param {boolean | null} useDateObjects
|
|
147
|
+
* @returns {QuerySub}
|
|
148
|
+
*/
|
|
142
149
|
function querySubFromStorage(x, useDateObjects) {
|
|
143
150
|
var _a;
|
|
144
151
|
const v = typeof x === 'string' ? JSON.parse(x) : x;
|
|
145
152
|
if ((_a = v === null || v === void 0 ? void 0 : v.result) === null || _a === void 0 ? void 0 : _a.store) {
|
|
146
|
-
const
|
|
147
|
-
|
|
153
|
+
const attrsStore = s.attrsStoreFromJSON(v.result.attrsStore, v.result.store);
|
|
154
|
+
if (attrsStore) {
|
|
155
|
+
const storeJSON = v.result.store;
|
|
156
|
+
v.result.store = s.fromJSON(attrsStore, Object.assign(Object.assign({}, storeJSON), { useDateObjects: useDateObjects }));
|
|
157
|
+
v.result.attrsStore = attrsStore;
|
|
158
|
+
}
|
|
148
159
|
}
|
|
149
160
|
return v;
|
|
150
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
*
|
|
164
|
+
* @param {string} _key
|
|
165
|
+
* @param {QuerySub} sub
|
|
166
|
+
* @returns QuerySubInStorage
|
|
167
|
+
*/
|
|
151
168
|
function querySubToStorage(_key, sub) {
|
|
152
|
-
|
|
153
|
-
const jsonSub =
|
|
154
|
-
if (
|
|
155
|
-
|
|
169
|
+
const { result } = sub, rest = __rest(sub, ["result"]);
|
|
170
|
+
const jsonSub = /** @type {import('./reactorTypes.ts').QuerySubInStorage} */ (rest);
|
|
171
|
+
if (result) {
|
|
172
|
+
/** @type {import('./reactorTypes.ts').QuerySubResultInStorage} */
|
|
173
|
+
const jsonResult = Object.assign(Object.assign({}, result), { store: s.toJSON(result.store), attrsStore: result.attrsStore.toJSON() });
|
|
174
|
+
jsonSub.result = jsonResult;
|
|
156
175
|
}
|
|
157
176
|
return jsonSub;
|
|
158
177
|
}
|
|
@@ -297,7 +316,7 @@ class Reactor {
|
|
|
297
316
|
}
|
|
298
317
|
try {
|
|
299
318
|
const txSteps = instaml.transform({
|
|
300
|
-
|
|
319
|
+
attrsStore: this.optimisticAttrs(),
|
|
301
320
|
schema: this.config.schema,
|
|
302
321
|
stores: Object.values(this.querySubs.currentValue).map((sub) => { var _a; return (_a = sub === null || sub === void 0 ? void 0 : sub.result) === null || _a === void 0 ? void 0 : _a.store; }),
|
|
303
322
|
useDateObjects: this.config.useDateObjects,
|
|
@@ -463,10 +482,18 @@ class Reactor {
|
|
|
463
482
|
this._initStorage(Storage);
|
|
464
483
|
this._syncTable = new SyncTable_ts_1.SyncTable(this._trySendAuthed.bind(this), new Storage(this.config.appId, 'syncSubs'), {
|
|
465
484
|
useDateObjects: this.config.useDateObjects,
|
|
466
|
-
}, this._log, (triples) =>
|
|
485
|
+
}, this._log, (triples) => {
|
|
486
|
+
return s.createStore(this.ensureAttrs(), triples, this.config.enableCardinalityInference, this.config.useDateObjects);
|
|
487
|
+
}, () => this.ensureAttrs());
|
|
467
488
|
this._oauthCallbackResponse = this._oauthLoginInit();
|
|
468
489
|
// kick off a request to cache it
|
|
469
|
-
this.getCurrentUser()
|
|
490
|
+
this.getCurrentUser().then((userInfo) => {
|
|
491
|
+
this.syncUserToEndpoint(userInfo.user);
|
|
492
|
+
});
|
|
493
|
+
setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
494
|
+
const currentUser = yield this.getCurrentUser();
|
|
495
|
+
this.syncUserToEndpoint(currentUser.user);
|
|
496
|
+
}), 1000 * 60 * 20);
|
|
470
497
|
NetworkListener.getIsOnline().then((isOnline) => {
|
|
471
498
|
this._isOnline = isOnline;
|
|
472
499
|
this._startSocket();
|
|
@@ -493,6 +520,12 @@ class Reactor {
|
|
|
493
520
|
addEventListener('beforeunload', this._beforeUnload);
|
|
494
521
|
}
|
|
495
522
|
}
|
|
523
|
+
ensureAttrs() {
|
|
524
|
+
if (!this.attrs) {
|
|
525
|
+
throw new Error('attrs have not loaded.');
|
|
526
|
+
}
|
|
527
|
+
return this.attrs;
|
|
528
|
+
}
|
|
496
529
|
updateSchema(schema) {
|
|
497
530
|
this.config = Object.assign(Object.assign({}, this.config), { schema: schema, cardinalityInference: Boolean(schema) });
|
|
498
531
|
this._linkIndex = schema ? (0, linkIndex_ts_1.createLinkIndex)(this.config.schema) : null;
|
|
@@ -516,7 +549,7 @@ class Reactor {
|
|
|
516
549
|
serialize: querySubToStorage,
|
|
517
550
|
parse: (_key, x) => querySubFromStorage(x, this.config.useDateObjects),
|
|
518
551
|
// objectSize
|
|
519
|
-
objectSize: (x) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = x.result) === null || _a === void 0 ? void 0 : _a.store) === null || _b === void 0 ? void 0 : _b.triples) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0; },
|
|
552
|
+
objectSize: (x) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = x === null || x === void 0 ? void 0 : x.result) === null || _a === void 0 ? void 0 : _a.store) === null || _b === void 0 ? void 0 : _b.triples) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0; },
|
|
520
553
|
logger: this._log,
|
|
521
554
|
preloadEntryCount: 10,
|
|
522
555
|
gc: {
|
|
@@ -612,6 +645,37 @@ class Reactor {
|
|
|
612
645
|
}
|
|
613
646
|
}
|
|
614
647
|
}
|
|
648
|
+
/**
|
|
649
|
+
* Does the same thing as add-query-ok
|
|
650
|
+
* but called as a result of receiving query info from ssr
|
|
651
|
+
* @param {any} q
|
|
652
|
+
* @param {{ triples: any; pageInfo: any; }} result
|
|
653
|
+
* @param {boolean} enableCardinalityInference
|
|
654
|
+
*/
|
|
655
|
+
_addQueryData(q, result, enableCardinalityInference) {
|
|
656
|
+
if (!this.attrs) {
|
|
657
|
+
throw new Error('Attrs in reactor have not been set');
|
|
658
|
+
}
|
|
659
|
+
const queryHash = (0, weakHash_ts_1.default)(q);
|
|
660
|
+
const attrsStore = this.ensureAttrs();
|
|
661
|
+
const store = s.createStore(this.attrs, result.triples, enableCardinalityInference, this.config.useDateObjects);
|
|
662
|
+
this.querySubs.updateInPlace((prev) => {
|
|
663
|
+
prev[queryHash] = {
|
|
664
|
+
result: {
|
|
665
|
+
store,
|
|
666
|
+
attrsStore,
|
|
667
|
+
pageInfo: result.pageInfo,
|
|
668
|
+
processedTxId: undefined,
|
|
669
|
+
isExternal: true,
|
|
670
|
+
},
|
|
671
|
+
q,
|
|
672
|
+
};
|
|
673
|
+
});
|
|
674
|
+
this._cleanupPendingMutationsQueries();
|
|
675
|
+
this.notifyOne(queryHash);
|
|
676
|
+
this.notifyOneQueryOnce(queryHash);
|
|
677
|
+
this._cleanupPendingMutationsTimeout();
|
|
678
|
+
}
|
|
615
679
|
_handleReceive(connId, msg) {
|
|
616
680
|
var _a, _b, _c, _d, _e, _f;
|
|
617
681
|
// opt-out, enabled by default if schema
|
|
@@ -650,7 +714,8 @@ class Reactor {
|
|
|
650
714
|
const pageInfo = (_d = (_c = result === null || result === void 0 ? void 0 : result[0]) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d['page-info'];
|
|
651
715
|
const aggregate = (_f = (_e = result === null || result === void 0 ? void 0 : result[0]) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f['aggregate'];
|
|
652
716
|
const triples = (0, instaqlResult_js_1.extractTriples)(result);
|
|
653
|
-
const
|
|
717
|
+
const attrsStore = this.ensureAttrs();
|
|
718
|
+
const store = s.createStore(attrsStore, triples, enableCardinalityInference, this.config.useDateObjects);
|
|
654
719
|
this.querySubs.updateInPlace((prev) => {
|
|
655
720
|
if (!prev[hash]) {
|
|
656
721
|
this._log.info('Missing value in querySubs', { hash, q });
|
|
@@ -658,6 +723,7 @@ class Reactor {
|
|
|
658
723
|
}
|
|
659
724
|
prev[hash].result = {
|
|
660
725
|
store,
|
|
726
|
+
attrsStore,
|
|
661
727
|
pageInfo,
|
|
662
728
|
aggregate,
|
|
663
729
|
processedTxId: msg['processed-tx-id'],
|
|
@@ -692,7 +758,7 @@ class Reactor {
|
|
|
692
758
|
this._setAttrs(attrs);
|
|
693
759
|
}
|
|
694
760
|
this._cleanupPendingMutationsTimeout();
|
|
695
|
-
const rewrittenMutations = this._rewriteMutations(this.
|
|
761
|
+
const rewrittenMutations = this._rewriteMutations(this.ensureAttrs(), this._pendingMutations(), processedTxId);
|
|
696
762
|
if (rewrittenMutations !== this._pendingMutations()) {
|
|
697
763
|
// We know we've changed the mutations to fix the attr ids and removed
|
|
698
764
|
// processed attrs, so we'll persist those changes to prevent optimisticAttrs
|
|
@@ -708,19 +774,33 @@ class Reactor {
|
|
|
708
774
|
const result = x['instaql-result'];
|
|
709
775
|
const hash = (0, weakHash_ts_1.default)(q);
|
|
710
776
|
const triples = (0, instaqlResult_js_1.extractTriples)(result);
|
|
711
|
-
const
|
|
712
|
-
const
|
|
777
|
+
const attrsStore = this.ensureAttrs();
|
|
778
|
+
const store = s.createStore(attrsStore, triples, enableCardinalityInference, this.config.useDateObjects);
|
|
779
|
+
const { store: newStore, attrsStore: newAttrsStore } = this._applyOptimisticUpdates(store, attrsStore, mutations, processedTxId);
|
|
713
780
|
const pageInfo = (_b = (_a = result === null || result === void 0 ? void 0 : result[0]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b['page-info'];
|
|
714
781
|
const aggregate = (_d = (_c = result === null || result === void 0 ? void 0 : result[0]) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d['aggregate'];
|
|
715
|
-
return {
|
|
782
|
+
return {
|
|
783
|
+
q,
|
|
784
|
+
hash,
|
|
785
|
+
store: newStore,
|
|
786
|
+
attrsStore: newAttrsStore,
|
|
787
|
+
pageInfo,
|
|
788
|
+
aggregate,
|
|
789
|
+
};
|
|
716
790
|
});
|
|
717
|
-
updates.forEach(({ hash, q, store, pageInfo, aggregate }) => {
|
|
791
|
+
updates.forEach(({ hash, q, store, attrsStore, pageInfo, aggregate }) => {
|
|
718
792
|
this.querySubs.updateInPlace((prev) => {
|
|
719
793
|
if (!prev[hash]) {
|
|
720
794
|
this._log.error('Missing value in querySubs', { hash, q });
|
|
721
795
|
return;
|
|
722
796
|
}
|
|
723
|
-
prev[hash].result = {
|
|
797
|
+
prev[hash].result = {
|
|
798
|
+
store,
|
|
799
|
+
attrsStore,
|
|
800
|
+
pageInfo,
|
|
801
|
+
aggregate,
|
|
802
|
+
processedTxId,
|
|
803
|
+
};
|
|
724
804
|
});
|
|
725
805
|
});
|
|
726
806
|
this._cleanupPendingMutationsQueries();
|
|
@@ -732,7 +812,7 @@ class Reactor {
|
|
|
732
812
|
case 'transact-ok': {
|
|
733
813
|
const { 'client-event-id': eventId, 'tx-id': txId } = msg;
|
|
734
814
|
this._inFlightMutationEventIds.delete(eventId);
|
|
735
|
-
const muts = this._rewriteMutations(this.
|
|
815
|
+
const muts = this._rewriteMutations(this.ensureAttrs(), this._pendingMutations());
|
|
736
816
|
const prevMutation = muts.get(eventId);
|
|
737
817
|
if (!prevMutation) {
|
|
738
818
|
break;
|
|
@@ -741,11 +821,17 @@ class Reactor {
|
|
|
741
821
|
this._updatePendingMutations((prev) => {
|
|
742
822
|
prev.set(eventId, Object.assign(Object.assign({}, prev.get(eventId)), { 'tx-id': txId, confirmed: Date.now() }));
|
|
743
823
|
});
|
|
744
|
-
const newAttrs =
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
824
|
+
const newAttrs = [];
|
|
825
|
+
for (const step of prevMutation['tx-steps']) {
|
|
826
|
+
if (step[0] === 'add-attr') {
|
|
827
|
+
const attr = step[1];
|
|
828
|
+
newAttrs.push(attr);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
if (newAttrs.length) {
|
|
832
|
+
const existingAttrs = Object.values(this.ensureAttrs().attrs);
|
|
833
|
+
this._setAttrs([...existingAttrs, ...newAttrs]);
|
|
834
|
+
}
|
|
749
835
|
this._finishTransaction('synced', eventId);
|
|
750
836
|
this._cleanupPendingMutationsTimeout();
|
|
751
837
|
break;
|
|
@@ -906,10 +992,10 @@ class Reactor {
|
|
|
906
992
|
this._completeQueryOnce(q, hash, r.dfd);
|
|
907
993
|
}
|
|
908
994
|
_setAttrs(attrs) {
|
|
909
|
-
this.attrs = attrs.reduce((acc, attr) => {
|
|
995
|
+
this.attrs = new s.AttrsStoreClass(attrs.reduce((acc, attr) => {
|
|
910
996
|
acc[attr.id] = attr;
|
|
911
997
|
return acc;
|
|
912
|
-
}, {});
|
|
998
|
+
}, {}), this._linkIndex);
|
|
913
999
|
this.notifyAttrsSubs();
|
|
914
1000
|
}
|
|
915
1001
|
_startQuerySub(q, hash) {
|
|
@@ -1015,6 +1101,12 @@ class Reactor {
|
|
|
1015
1101
|
// We remove `add-attr` commands for attrs that already exist.
|
|
1016
1102
|
// We update `add-triple` and `retract-triple` commands to use the
|
|
1017
1103
|
// server attr-ids.
|
|
1104
|
+
/**
|
|
1105
|
+
*
|
|
1106
|
+
* @param {s.AttrsStore} attrs
|
|
1107
|
+
* @param {any} muts
|
|
1108
|
+
* @param {number} [processedTxId]
|
|
1109
|
+
*/
|
|
1018
1110
|
_rewriteMutations(attrs, muts, processedTxId) {
|
|
1019
1111
|
if (!attrs)
|
|
1020
1112
|
return muts;
|
|
@@ -1022,12 +1114,12 @@ class Reactor {
|
|
|
1022
1114
|
return new Map();
|
|
1023
1115
|
const findExistingAttr = (attr) => {
|
|
1024
1116
|
const [_, etype, label] = attr['forward-identity'];
|
|
1025
|
-
const existing =
|
|
1117
|
+
const existing = s.getAttrByFwdIdentName(attrs, etype, label);
|
|
1026
1118
|
return existing;
|
|
1027
1119
|
};
|
|
1028
1120
|
const findReverseAttr = (attr) => {
|
|
1029
1121
|
const [_, etype, label] = attr['forward-identity'];
|
|
1030
|
-
const revAttr =
|
|
1122
|
+
const revAttr = s.getAttrByReverseIdentName(attrs, etype, label);
|
|
1031
1123
|
return revAttr;
|
|
1032
1124
|
};
|
|
1033
1125
|
const mapping = { attrIdMap: {}, refSwapAttrIds: new Set() };
|
|
@@ -1090,8 +1182,11 @@ class Reactor {
|
|
|
1090
1182
|
}
|
|
1091
1183
|
// ---------------------------
|
|
1092
1184
|
// Transact
|
|
1185
|
+
/**
|
|
1186
|
+
* @returns {s.AttrsStore}
|
|
1187
|
+
*/
|
|
1093
1188
|
optimisticAttrs() {
|
|
1094
|
-
var _a;
|
|
1189
|
+
var _a, _b;
|
|
1095
1190
|
const pendingMutationSteps = [...this._pendingMutations().values()] // hack due to Map()
|
|
1096
1191
|
.flatMap((x) => x['tx-steps']);
|
|
1097
1192
|
const deletedAttrIds = new Set(pendingMutationSteps
|
|
@@ -1104,20 +1199,25 @@ class Reactor {
|
|
|
1104
1199
|
}
|
|
1105
1200
|
else if (_action === 'update-attr' &&
|
|
1106
1201
|
attr.id &&
|
|
1107
|
-
((_a = this.attrs) === null || _a === void 0 ? void 0 : _a
|
|
1108
|
-
const fullAttr = Object.assign(Object.assign({}, this.attrs
|
|
1202
|
+
((_a = this.attrs) === null || _a === void 0 ? void 0 : _a.getAttr(attr.id))) {
|
|
1203
|
+
const fullAttr = Object.assign(Object.assign({}, this.attrs.getAttr(attr.id)), attr);
|
|
1109
1204
|
pendingAttrs.push(fullAttr);
|
|
1110
1205
|
}
|
|
1111
1206
|
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
const
|
|
1117
|
-
|
|
1207
|
+
if (!deletedAttrIds.size && !pendingAttrs.length) {
|
|
1208
|
+
return this.attrs || new s.AttrsStoreClass({}, this._linkIndex);
|
|
1209
|
+
}
|
|
1210
|
+
const attrs = Object.assign({}, (((_b = this.attrs) === null || _b === void 0 ? void 0 : _b.attrs) || {}));
|
|
1211
|
+
for (const attr of pendingAttrs) {
|
|
1212
|
+
attrs[attr.id] = attr;
|
|
1213
|
+
}
|
|
1214
|
+
for (const id of deletedAttrIds) {
|
|
1215
|
+
delete attrs[id];
|
|
1216
|
+
}
|
|
1217
|
+
return new s.AttrsStoreClass(attrs, this._linkIndex);
|
|
1118
1218
|
}
|
|
1119
1219
|
/** Runs instaql on a query and a store */
|
|
1120
|
-
dataForQuery(hash) {
|
|
1220
|
+
dataForQuery(hash, applyOptimistic = true) {
|
|
1121
1221
|
const errorMessage = this._errorMessage;
|
|
1122
1222
|
if (errorMessage) {
|
|
1123
1223
|
return { error: errorMessage };
|
|
@@ -1139,19 +1239,27 @@ class Reactor {
|
|
|
1139
1239
|
pendingMutationsVersion === cached.pendingMutationsVersion) {
|
|
1140
1240
|
return cached;
|
|
1141
1241
|
}
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
const
|
|
1145
|
-
const
|
|
1242
|
+
let store = result.store;
|
|
1243
|
+
let attrsStore = result.attrsStore;
|
|
1244
|
+
const { pageInfo, aggregate, processedTxId } = result;
|
|
1245
|
+
const mutations = this._rewriteMutationsSorted(attrsStore, pendingMutations);
|
|
1246
|
+
if (applyOptimistic) {
|
|
1247
|
+
const optimisticResult = this._applyOptimisticUpdates(store, attrsStore, mutations, processedTxId);
|
|
1248
|
+
store = optimisticResult.store;
|
|
1249
|
+
attrsStore = optimisticResult.attrsStore;
|
|
1250
|
+
}
|
|
1251
|
+
const resp = (0, instaql_ts_1.default)({ store: store, attrsStore: attrsStore, pageInfo, aggregate }, q);
|
|
1146
1252
|
return { data: resp, querySubVersion, pendingMutationsVersion };
|
|
1147
1253
|
}
|
|
1148
|
-
_applyOptimisticUpdates(store, mutations, processedTxId) {
|
|
1254
|
+
_applyOptimisticUpdates(store, attrsStore, mutations, processedTxId) {
|
|
1149
1255
|
for (const [_, mut] of mutations) {
|
|
1150
1256
|
if (!mut['tx-id'] || (processedTxId && mut['tx-id'] > processedTxId)) {
|
|
1151
|
-
|
|
1257
|
+
const result = s.transact(store, attrsStore, mut['tx-steps']);
|
|
1258
|
+
store = result.store;
|
|
1259
|
+
attrsStore = result.attrsStore;
|
|
1152
1260
|
}
|
|
1153
1261
|
}
|
|
1154
|
-
return store;
|
|
1262
|
+
return { store, attrsStore };
|
|
1155
1263
|
}
|
|
1156
1264
|
/** Re-compute all subscriptions */
|
|
1157
1265
|
notifyAll() {
|
|
@@ -1231,7 +1339,7 @@ class Reactor {
|
|
|
1231
1339
|
.forEach(({ eventId, q }) => {
|
|
1232
1340
|
this._trySendAuthed(eventId, { op: 'add-query', q });
|
|
1233
1341
|
});
|
|
1234
|
-
const muts = this._rewriteMutationsSorted(this.
|
|
1342
|
+
const muts = this._rewriteMutationsSorted(this.ensureAttrs(), this._pendingMutations());
|
|
1235
1343
|
muts.forEach(([eventId, mut]) => {
|
|
1236
1344
|
if (!mut['tx-id']) {
|
|
1237
1345
|
this._sendMutation(eventId, mut);
|
|
@@ -1518,7 +1626,7 @@ class Reactor {
|
|
|
1518
1626
|
subscribeAttrs(cb) {
|
|
1519
1627
|
this.attrsCbs.push(cb);
|
|
1520
1628
|
if (this.attrs) {
|
|
1521
|
-
cb(this.attrs);
|
|
1629
|
+
cb(this.attrs.attrs);
|
|
1522
1630
|
}
|
|
1523
1631
|
return () => {
|
|
1524
1632
|
this.attrsCbs = this.attrsCbs.filter((x) => x !== cb);
|
|
@@ -1534,7 +1642,7 @@ class Reactor {
|
|
|
1534
1642
|
if (!this.attrs)
|
|
1535
1643
|
return;
|
|
1536
1644
|
const oas = this.optimisticAttrs();
|
|
1537
|
-
this.attrsCbs.forEach((cb) => cb(oas));
|
|
1645
|
+
this.attrsCbs.forEach((cb) => cb(oas.attrs));
|
|
1538
1646
|
}
|
|
1539
1647
|
notifyConnectionStatusSubs(status) {
|
|
1540
1648
|
this.connectionStatusCbs.forEach((cb) => cb(status));
|
|
@@ -1606,7 +1714,28 @@ class Reactor {
|
|
|
1606
1714
|
}
|
|
1607
1715
|
});
|
|
1608
1716
|
}
|
|
1717
|
+
syncUserToEndpoint(user) {
|
|
1718
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1719
|
+
if (this.config.cookieEndpoint) {
|
|
1720
|
+
try {
|
|
1721
|
+
fetch(this.config.cookieEndpoint + '/sync-auth', {
|
|
1722
|
+
method: 'POST',
|
|
1723
|
+
body: JSON.stringify({
|
|
1724
|
+
user: user,
|
|
1725
|
+
}),
|
|
1726
|
+
headers: {
|
|
1727
|
+
'Content-Type': 'application/json',
|
|
1728
|
+
},
|
|
1729
|
+
});
|
|
1730
|
+
}
|
|
1731
|
+
catch (error) {
|
|
1732
|
+
console.error('Error syncing user with external endpoint', error);
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
});
|
|
1736
|
+
}
|
|
1609
1737
|
updateUser(newUser) {
|
|
1738
|
+
this.syncUserToEndpoint(newUser);
|
|
1610
1739
|
const newV = { error: undefined, user: newUser };
|
|
1611
1740
|
this._currentUserCached = Object.assign({ isLoading: false }, newV);
|
|
1612
1741
|
this._dataForQueryCache = {};
|