@livestore/sync-cf 0.2.0-dev.2 → 0.3.0-dev.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/dist/.tsbuildinfo +1 -1
- package/dist/cf-worker/durable-object.d.ts +21 -8
- package/dist/cf-worker/durable-object.d.ts.map +1 -1
- package/dist/cf-worker/durable-object.js +62 -48
- package/dist/cf-worker/durable-object.js.map +1 -1
- package/dist/common/ws-message-types.d.ts +113 -84
- package/dist/common/ws-message-types.d.ts.map +1 -1
- package/dist/common/ws-message-types.js +13 -9
- package/dist/common/ws-message-types.js.map +1 -1
- package/dist/sync-impl/ws-impl.d.ts +2 -1
- package/dist/sync-impl/ws-impl.d.ts.map +1 -1
- package/dist/sync-impl/ws-impl.js +66 -67
- package/dist/sync-impl/ws-impl.js.map +1 -1
- package/package.json +10 -3
- package/src/cf-worker/durable-object.ts +138 -109
- package/src/cf-worker/index.ts +1 -1
- package/src/common/ws-message-types.ts +18 -9
- package/src/sync-impl/ws-impl.ts +114 -107
- package/.netlify/state.json +0 -3
- package/.wrangler/state/v3/d1/miniflare-D1DatabaseObject/8ee300993f9a2c909aede59646369fa0cc28d25304b9b9af94f54d4543ad60f4.sqlite +0 -0
- package/.wrangler/state/v3/do/websocket-server-WebSocketServer/2c3676d859102e448b271e1b4336b1e40778992b14728e2a2bd642c0f225e9c5.sqlite +0 -0
- package/.wrangler/state/v3/do/websocket-server-WebSocketServer/6eb1111cecdc6ae7e3a38c3d7db0f3ec7de5b318e682cdcf0ff0dc881cbbcee7.sqlite +0 -0
- package/.wrangler/state/v3/do/websocket-server-WebSocketServer/c4aa0e61dcd784604bee52282348e0538ab69ec76e1652322bbccd539d9ff3ee.sqlite +0 -0
- package/.wrangler/state/v3/do/websocket-server-WebSocketServer/d87433156774c933da83e962eba16107cf02ade2f133d7205963558fe47db3ff.sqlite +0 -0
- package/.wrangler/tmp/dev-33iU4b/index.js +0 -42167
- package/.wrangler/tmp/dev-33iU4b/index.js.map +0 -8
- package/.wrangler/tmp/dev-9rcIR8/index.js +0 -18887
- package/.wrangler/tmp/dev-9rcIR8/index.js.map +0 -8
- package/.wrangler/tmp/dev-rI63Kk/index.js +0 -42165
- package/.wrangler/tmp/dev-rI63Kk/index.js.map +0 -8
- package/.wrangler/tmp/dev-txPodK/index.js +0 -42118
- package/.wrangler/tmp/dev-txPodK/index.js.map +0 -8
- package/tsconfig.json +0 -12
- package/wrangler.toml +0 -21
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DbSchema, type MutationEvent } from '@livestore/common/schema';
|
|
2
|
-
import { Schema } from '@livestore/utils/effect';
|
|
2
|
+
import { Option, Schema } from '@livestore/utils/effect';
|
|
3
3
|
import { DurableObject } from 'cloudflare:workers';
|
|
4
|
+
import type { SyncMetadata } from '../common/ws-message-types.js';
|
|
4
5
|
export interface Env {
|
|
5
6
|
WEBSOCKET_SERVER: DurableObjectNamespace<WebSocketServer>;
|
|
6
7
|
DB: D1Database;
|
|
@@ -13,28 +14,35 @@ export declare const mutationLogTable: DbSchema.TableDef<{
|
|
|
13
14
|
idGlobal: {
|
|
14
15
|
columnType: "integer";
|
|
15
16
|
schema: Schema.Schema<number, number, never>;
|
|
16
|
-
default:
|
|
17
|
+
default: Option.None<never>;
|
|
17
18
|
nullable: false;
|
|
18
19
|
primaryKey: true;
|
|
19
20
|
};
|
|
20
21
|
parentIdGlobal: {
|
|
21
22
|
columnType: "integer";
|
|
22
23
|
schema: Schema.Schema<number, number, never>;
|
|
23
|
-
default:
|
|
24
|
+
default: Option.None<never>;
|
|
24
25
|
nullable: false;
|
|
25
26
|
primaryKey: false;
|
|
26
27
|
};
|
|
27
28
|
mutation: {
|
|
28
29
|
columnType: "text";
|
|
29
30
|
schema: Schema.Schema<string, string, never>;
|
|
30
|
-
default:
|
|
31
|
+
default: Option.None<never>;
|
|
31
32
|
nullable: false;
|
|
32
33
|
primaryKey: false;
|
|
33
34
|
};
|
|
34
35
|
args: {
|
|
35
36
|
columnType: "text";
|
|
36
37
|
schema: Schema.Schema<any, string, never>;
|
|
37
|
-
default:
|
|
38
|
+
default: Option.None<never>;
|
|
39
|
+
nullable: false;
|
|
40
|
+
primaryKey: false;
|
|
41
|
+
};
|
|
42
|
+
createdAt: {
|
|
43
|
+
columnType: "text";
|
|
44
|
+
schema: Schema.Schema<string, string, never>;
|
|
45
|
+
default: Option.None<never>;
|
|
38
46
|
nullable: false;
|
|
39
47
|
primaryKey: false;
|
|
40
48
|
};
|
|
@@ -47,26 +55,31 @@ export declare const mutationLogTable: DbSchema.TableDef<{
|
|
|
47
55
|
disableAutomaticIdColumn: false;
|
|
48
56
|
deriveMutations: never;
|
|
49
57
|
isSingleColumn: false;
|
|
50
|
-
requiredInsertColumnNames: "idGlobal" | "parentIdGlobal" | "mutation" | "args";
|
|
58
|
+
requiredInsertColumnNames: "createdAt" | "idGlobal" | "parentIdGlobal" | "mutation" | "args";
|
|
51
59
|
}, Schema.Schema<{
|
|
52
60
|
readonly idGlobal: number;
|
|
53
61
|
readonly parentIdGlobal: number;
|
|
54
62
|
readonly mutation: string;
|
|
55
63
|
readonly args: any;
|
|
64
|
+
readonly createdAt: string;
|
|
56
65
|
readonly id: string;
|
|
57
66
|
}, {
|
|
58
67
|
readonly idGlobal: number;
|
|
59
68
|
readonly parentIdGlobal: number;
|
|
60
69
|
readonly mutation: string;
|
|
61
70
|
readonly args: string;
|
|
71
|
+
readonly createdAt: string;
|
|
62
72
|
readonly id: string;
|
|
63
73
|
}, never>>;
|
|
64
74
|
export declare class WebSocketServer extends DurableObject<Env> {
|
|
65
75
|
dbName: string;
|
|
66
76
|
storage: {
|
|
67
77
|
getLatestEvent: () => Promise<MutationEvent.Any | undefined>;
|
|
68
|
-
getEvents: (cursor: number | undefined) => Promise<ReadonlyArray<
|
|
69
|
-
|
|
78
|
+
getEvents: (cursor: number | undefined) => Promise<ReadonlyArray<{
|
|
79
|
+
mutationEventEncoded: MutationEvent.AnyEncoded;
|
|
80
|
+
metadata: Option.Option<SyncMetadata>;
|
|
81
|
+
}>>;
|
|
82
|
+
appendEvent: (event: MutationEvent.Any, createdAt: string) => Promise<void>;
|
|
70
83
|
resetRoom: () => Promise<void>;
|
|
71
84
|
};
|
|
72
85
|
constructor(ctx: DurableObjectState, env: Env);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durable-object.d.ts","sourceRoot":"","sources":["../../src/cf-worker/durable-object.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"durable-object.d.ts","sourceRoot":"","sources":["../../src/cf-worker/durable-object.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAW,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAEhF,OAAO,EAA4B,MAAM,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,MAAM,WAAW,GAAG;IAClB,gBAAgB,EAAE,sBAAsB,CAAC,eAAe,CAAC,CAAA;IACzD,EAAE,EAAE,UAAU,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,KAAK,eAAe,GAAG,SAAS,CAAA;AAOhC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAO3B,CAAA;AAGF,qBAAa,eAAgB,SAAQ,aAAa,CAAC,GAAG,CAAC;IACrD,MAAM,SAA2C;IACjD,OAAO;8BA8K0B,OAAO,CAAC,aAAa,CAAC,GAAG,GAAG,SAAS,CAAC;4BAe7D,MAAM,GAAG,SAAS,KACzB,OAAO,CACR,aAAa,CAAC;YAAE,oBAAoB,EAAE,aAAa,CAAC,UAAU,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;SAAE,CAAC,CACzG;6BAsBiC,aAAa,CAAC,GAAG,aAAa,MAAM;;MAtNhB;gBAE1C,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,GAAG;IAI7C,KAAK,aAAoB,OAAO,uBAsBsB;IAEtD,gBAAgB,OAAQ,eAAe,WAAW,WAAW,GAAG,MAAM,wBAuInE;IAEH,cAAc,OAAc,eAAe,QAAQ,MAAM,WAAW,MAAM,aAAa,OAAO,mBAG7F;CACF"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { makeColumnSpec
|
|
2
|
-
import { DbSchema,
|
|
1
|
+
import { makeColumnSpec } from '@livestore/common';
|
|
2
|
+
import { DbSchema, EventId } from '@livestore/common/schema';
|
|
3
3
|
import { shouldNeverHappen } from '@livestore/utils';
|
|
4
|
-
import { Effect, Schema } from '@livestore/utils/effect';
|
|
4
|
+
import { Effect, Logger, LogLevel, Option, Schema } from '@livestore/utils/effect';
|
|
5
5
|
import { DurableObject } from 'cloudflare:workers';
|
|
6
6
|
import { WSMessage } from '../common/index.js';
|
|
7
7
|
const encodeOutgoingMessage = Schema.encodeSync(Schema.parseJson(WSMessage.BackendToClientMessage));
|
|
8
8
|
const encodeIncomingMessage = Schema.encodeSync(Schema.parseJson(WSMessage.ClientToBackendMessage));
|
|
9
9
|
const decodeIncomingMessage = Schema.decodeUnknownEither(Schema.parseJson(WSMessage.ClientToBackendMessage));
|
|
10
|
+
// NOTE actual table name is determined at runtime by `WebSocketServer.dbName`
|
|
10
11
|
export const mutationLogTable = DbSchema.table('__unused', {
|
|
11
12
|
idGlobal: DbSchema.integer({ primaryKey: true }),
|
|
12
13
|
parentIdGlobal: DbSchema.integer({}),
|
|
13
14
|
mutation: DbSchema.text({}),
|
|
14
15
|
args: DbSchema.text({ schema: Schema.parseJson(Schema.Any) }),
|
|
16
|
+
/** ISO date format */
|
|
17
|
+
createdAt: DbSchema.text({}),
|
|
15
18
|
});
|
|
16
19
|
// Durable Object
|
|
17
20
|
export class WebSocketServer extends DurableObject {
|
|
@@ -32,7 +35,7 @@ export class WebSocketServer extends DurableObject {
|
|
|
32
35
|
webSocket: client,
|
|
33
36
|
});
|
|
34
37
|
}).pipe(Effect.tapCauseLogPretty, Effect.runPromise);
|
|
35
|
-
webSocketMessage =
|
|
38
|
+
webSocketMessage = (ws, message) => Effect.gen(this, function* () {
|
|
36
39
|
const decodedMessageRes = decodeIncomingMessage(message);
|
|
37
40
|
if (decodedMessageRes._tag === 'Left') {
|
|
38
41
|
console.error('Invalid message received', decodedMessageRes.left);
|
|
@@ -46,14 +49,12 @@ export class WebSocketServer extends DurableObject {
|
|
|
46
49
|
const cursor = decodedMessage.cursor;
|
|
47
50
|
const CHUNK_SIZE = 100;
|
|
48
51
|
// TODO use streaming
|
|
49
|
-
const remainingEvents = [...(
|
|
52
|
+
const remainingEvents = [...(yield* Effect.promise(() => this.storage.getEvents(cursor)))];
|
|
50
53
|
// NOTE we want to make sure the WS server responds at least once with `InitRes` even if `events` is empty
|
|
51
54
|
while (true) {
|
|
52
55
|
const events = remainingEvents.splice(0, CHUNK_SIZE);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
ws.send(encodeOutgoingMessage(WSMessage.PullRes.make({ events: encodedEvents, hasMore, requestId })));
|
|
56
|
-
if (hasMore === false) {
|
|
56
|
+
ws.send(encodeOutgoingMessage(WSMessage.PullRes.make({ events, remaining: remainingEvents.length, requestId })));
|
|
57
|
+
if (remainingEvents.length === 0) {
|
|
57
58
|
break;
|
|
58
59
|
}
|
|
59
60
|
}
|
|
@@ -61,36 +62,43 @@ export class WebSocketServer extends DurableObject {
|
|
|
61
62
|
}
|
|
62
63
|
case 'WSMessage.PushReq': {
|
|
63
64
|
// TODO check whether we could use the Durable Object storage for this to speed up the lookup
|
|
64
|
-
const latestEvent =
|
|
65
|
-
const expectedParentId = latestEvent?.id ??
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
? this.storage.appendEvent(decodedMessage.mutationEventEncoded)
|
|
77
|
-
: Promise.resolve();
|
|
78
|
-
ws.send(encodeOutgoingMessage(WSMessage.PushAck.make({ mutationId: decodedMessage.mutationEventEncoded.id.global, requestId })));
|
|
79
|
-
// console.debug(`Broadcasting mutation event to ${this.subscribedWebSockets.size} clients`)
|
|
80
|
-
const connectedClients = this.ctx.getWebSockets();
|
|
81
|
-
if (connectedClients.length > 0) {
|
|
82
|
-
const broadcastMessage = encodeOutgoingMessage(WSMessage.PushBroadcast.make({
|
|
83
|
-
mutationEventEncoded: decodedMessage.mutationEventEncoded,
|
|
84
|
-
persisted: decodedMessage.persisted,
|
|
85
|
-
}));
|
|
86
|
-
for (const conn of connectedClients) {
|
|
87
|
-
console.log('Broadcasting to client', conn === ws ? 'self' : 'other');
|
|
88
|
-
// if (conn !== ws) {
|
|
89
|
-
conn.send(broadcastMessage);
|
|
90
|
-
// }
|
|
65
|
+
const latestEvent = yield* Effect.promise(() => this.storage.getLatestEvent());
|
|
66
|
+
const expectedParentId = latestEvent?.id ?? EventId.ROOT;
|
|
67
|
+
let i = 0;
|
|
68
|
+
for (const mutationEventEncoded of decodedMessage.batch) {
|
|
69
|
+
if (mutationEventEncoded.parentId.global !== expectedParentId.global + i) {
|
|
70
|
+
const err = WSMessage.Error.make({
|
|
71
|
+
message: `Invalid parent id. Received ${mutationEventEncoded.parentId.global} but expected ${expectedParentId.global}`,
|
|
72
|
+
requestId,
|
|
73
|
+
});
|
|
74
|
+
yield* Effect.fail(err).pipe(Effect.ignoreLogged);
|
|
75
|
+
ws.send(encodeOutgoingMessage(err));
|
|
76
|
+
return;
|
|
91
77
|
}
|
|
78
|
+
// TODO handle clientId unique conflict
|
|
79
|
+
const createdAt = new Date().toISOString();
|
|
80
|
+
// NOTE we're currently not blocking on this to allow broadcasting right away
|
|
81
|
+
const storePromise = this.storage.appendEvent(mutationEventEncoded, createdAt);
|
|
82
|
+
ws.send(encodeOutgoingMessage(WSMessage.PushAck.make({ mutationId: mutationEventEncoded.id.global, requestId })));
|
|
83
|
+
// console.debug(`Broadcasting mutation event to ${this.subscribedWebSockets.size} clients`)
|
|
84
|
+
const connectedClients = this.ctx.getWebSockets();
|
|
85
|
+
if (connectedClients.length > 0) {
|
|
86
|
+
const broadcastMessage = encodeOutgoingMessage(
|
|
87
|
+
// TODO refactor to batch api
|
|
88
|
+
WSMessage.PushBroadcast.make({
|
|
89
|
+
mutationEventEncoded,
|
|
90
|
+
metadata: Option.some({ createdAt }),
|
|
91
|
+
}));
|
|
92
|
+
for (const conn of connectedClients) {
|
|
93
|
+
console.log('Broadcasting to client', conn === ws ? 'self' : 'other');
|
|
94
|
+
// if (conn !== ws) {
|
|
95
|
+
conn.send(broadcastMessage);
|
|
96
|
+
// }
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
yield* Effect.promise(() => storePromise);
|
|
100
|
+
i++;
|
|
92
101
|
}
|
|
93
|
-
await storePromise;
|
|
94
102
|
break;
|
|
95
103
|
}
|
|
96
104
|
case 'WSMessage.AdminResetRoomReq': {
|
|
@@ -98,7 +106,7 @@ export class WebSocketServer extends DurableObject {
|
|
|
98
106
|
ws.send(encodeOutgoingMessage(WSMessage.Error.make({ message: 'Invalid admin secret', requestId })));
|
|
99
107
|
return;
|
|
100
108
|
}
|
|
101
|
-
|
|
109
|
+
yield* Effect.promise(() => this.storage.resetRoom());
|
|
102
110
|
ws.send(encodeOutgoingMessage(WSMessage.AdminResetRoomRes.make({ requestId })));
|
|
103
111
|
break;
|
|
104
112
|
}
|
|
@@ -119,7 +127,7 @@ export class WebSocketServer extends DurableObject {
|
|
|
119
127
|
catch (error) {
|
|
120
128
|
ws.send(encodeOutgoingMessage(WSMessage.Error.make({ message: error.message, requestId })));
|
|
121
129
|
}
|
|
122
|
-
};
|
|
130
|
+
}).pipe(Effect.withSpan('@livestore/sync-cf:durable-object:webSocketMessage'), Effect.tapCauseLogPretty, Logger.withMinimumLogLevel(LogLevel.Debug), Effect.provide(Logger.pretty), Effect.runPromise);
|
|
123
131
|
webSocketClose = async (ws, code, _reason, _wasClean) => {
|
|
124
132
|
// If the client closes the connection, the runtime will invoke the webSocketClose() handler.
|
|
125
133
|
ws.close(code, 'Durable Object is closing WebSocket');
|
|
@@ -133,29 +141,35 @@ const makeStorage = (ctx, env, dbName) => {
|
|
|
133
141
|
}
|
|
134
142
|
const events = Schema.decodeUnknownSync(Schema.Array(mutationLogTable.schema))(rawEvents.results).map((e) => ({
|
|
135
143
|
...e,
|
|
144
|
+
// TODO remove local ids
|
|
136
145
|
id: { global: e.idGlobal, local: 0 },
|
|
137
146
|
parentId: { global: e.parentIdGlobal, local: 0 },
|
|
138
147
|
}));
|
|
139
148
|
return events[0];
|
|
140
149
|
};
|
|
141
150
|
const getEvents = async (cursor) => {
|
|
142
|
-
const whereClause = cursor ? `WHERE idGlobal > ${cursor}
|
|
151
|
+
const whereClause = cursor === undefined ? '' : `WHERE idGlobal > ${cursor}`;
|
|
152
|
+
const sql = `SELECT * FROM ${dbName} ${whereClause} ORDER BY idGlobal ASC`;
|
|
143
153
|
// TODO handle case where `cursor` was not found
|
|
144
|
-
const rawEvents = await env.DB.prepare(
|
|
154
|
+
const rawEvents = await env.DB.prepare(sql).all();
|
|
145
155
|
if (rawEvents.error) {
|
|
146
156
|
throw new Error(rawEvents.error);
|
|
147
157
|
}
|
|
148
|
-
const events = Schema.decodeUnknownSync(Schema.Array(mutationLogTable.schema))(rawEvents.results).map((e) => ({
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
158
|
+
const events = Schema.decodeUnknownSync(Schema.Array(mutationLogTable.schema))(rawEvents.results).map(({ createdAt, ...e }) => ({
|
|
159
|
+
mutationEventEncoded: {
|
|
160
|
+
...e,
|
|
161
|
+
// TODO remove local ids
|
|
162
|
+
id: { global: e.idGlobal, local: 0 },
|
|
163
|
+
parentId: { global: e.parentIdGlobal, local: 0 },
|
|
164
|
+
},
|
|
165
|
+
metadata: Option.some({ createdAt }),
|
|
152
166
|
}));
|
|
153
167
|
return events;
|
|
154
168
|
};
|
|
155
|
-
const appendEvent = async (event) => {
|
|
156
|
-
const sql = `INSERT INTO ${dbName} (idGlobal, parentIdGlobal, args, mutation) VALUES (?, ?, ?, ?)`;
|
|
169
|
+
const appendEvent = async (event, createdAt) => {
|
|
170
|
+
const sql = `INSERT INTO ${dbName} (idGlobal, parentIdGlobal, args, mutation, createdAt) VALUES (?, ?, ?, ?, ?)`;
|
|
157
171
|
await env.DB.prepare(sql)
|
|
158
|
-
.bind(event.id.global, event.parentId.global, JSON.stringify(event.args), event.mutation)
|
|
172
|
+
.bind(event.id.global, event.parentId.global, JSON.stringify(event.args), event.mutation, createdAt)
|
|
159
173
|
.run();
|
|
160
174
|
};
|
|
161
175
|
const resetRoom = async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durable-object.js","sourceRoot":"","sources":["../../src/cf-worker/durable-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"durable-object.js","sourceRoot":"","sources":["../../src/cf-worker/durable-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAsB,MAAM,0BAA0B,CAAA;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAW9C,MAAM,qBAAqB,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,s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AAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YACxB,oBAAoB,EAAE;gBACpB,GAAG,CAAC;gBACJ,wBAAwB;gBACxB,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE;gBACpC,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,cAAc,EAAE,KAAK,EAAE,CAAC,EAAE;aACjD;YACD,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;SACrC,CAAC,CACH,CAAA;QACD,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;IAED,MAAM,WAAW,GAAG,KAAK,EAAE,KAAwB,EAAE,SAAiB,EAAE,EAAE;QACxE,MAAM,GAAG,GAAG,eAAe,MAAM,+EAA+E,CAAA;QAChH,MAAM,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;aACtB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC;aACnG,GAAG,EAAE,CAAA;IACV,CAAC,CAAA;IAED,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE;QAC3B,MAAM,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,CAAA;IAC/B,CAAC,CAAA;IAED,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,CAAA;AAC9D,CAAC,CAAA"}
|
|
@@ -5,32 +5,43 @@ export declare const PullReq: Schema.TaggedStruct<"WSMessage.PullReq", {
|
|
|
5
5
|
cursor: Schema.optional<typeof Schema.Number>;
|
|
6
6
|
}>;
|
|
7
7
|
export type PullReq = typeof PullReq.Type;
|
|
8
|
+
export declare const SyncMetadata: Schema.Struct<{
|
|
9
|
+
/** ISO date format */
|
|
10
|
+
createdAt: typeof Schema.String;
|
|
11
|
+
}>;
|
|
12
|
+
export type SyncMetadata = typeof SyncMetadata.Type;
|
|
8
13
|
export declare const PullRes: Schema.TaggedStruct<"WSMessage.PullRes", {
|
|
9
14
|
requestId: typeof Schema.String;
|
|
10
|
-
events: Schema.Array$<Schema.
|
|
11
|
-
|
|
12
|
-
readonly
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
readonly
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
readonly
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
readonly
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
15
|
+
events: Schema.Array$<Schema.Struct<{
|
|
16
|
+
mutationEventEncoded: Schema.SchemaClass<{
|
|
17
|
+
readonly id: {
|
|
18
|
+
readonly global: number;
|
|
19
|
+
readonly local: number;
|
|
20
|
+
};
|
|
21
|
+
readonly mutation: string;
|
|
22
|
+
readonly args: any;
|
|
23
|
+
readonly parentId: {
|
|
24
|
+
readonly global: number;
|
|
25
|
+
readonly local: number;
|
|
26
|
+
};
|
|
27
|
+
}, {
|
|
28
|
+
readonly id: {
|
|
29
|
+
readonly global: number;
|
|
30
|
+
readonly local: number;
|
|
31
|
+
};
|
|
32
|
+
readonly mutation: string;
|
|
33
|
+
readonly args: any;
|
|
34
|
+
readonly parentId: {
|
|
35
|
+
readonly global: number;
|
|
36
|
+
readonly local: number;
|
|
37
|
+
};
|
|
38
|
+
}, never>;
|
|
39
|
+
metadata: Schema.Option<Schema.Struct<{
|
|
40
|
+
/** ISO date format */
|
|
41
|
+
createdAt: typeof Schema.String;
|
|
42
|
+
}>>;
|
|
43
|
+
}>>;
|
|
44
|
+
remaining: typeof Schema.Number;
|
|
34
45
|
}>;
|
|
35
46
|
export type PullRes = typeof PullRes.Type;
|
|
36
47
|
export declare const PushBroadcast: Schema.TaggedStruct<"WSMessage.PushBroadcast", {
|
|
@@ -57,12 +68,15 @@ export declare const PushBroadcast: Schema.TaggedStruct<"WSMessage.PushBroadcast
|
|
|
57
68
|
readonly local: number;
|
|
58
69
|
};
|
|
59
70
|
}, never>;
|
|
60
|
-
|
|
71
|
+
metadata: Schema.Option<Schema.Struct<{
|
|
72
|
+
/** ISO date format */
|
|
73
|
+
createdAt: typeof Schema.String;
|
|
74
|
+
}>>;
|
|
61
75
|
}>;
|
|
62
76
|
export type PushBroadcast = typeof PushBroadcast.Type;
|
|
63
77
|
export declare const PushReq: Schema.TaggedStruct<"WSMessage.PushReq", {
|
|
64
78
|
requestId: typeof Schema.String;
|
|
65
|
-
|
|
79
|
+
batch: Schema.Array$<Schema.SchemaClass<{
|
|
66
80
|
readonly id: {
|
|
67
81
|
readonly global: number;
|
|
68
82
|
readonly local: number;
|
|
@@ -84,8 +98,7 @@ export declare const PushReq: Schema.TaggedStruct<"WSMessage.PushReq", {
|
|
|
84
98
|
readonly global: number;
|
|
85
99
|
readonly local: number;
|
|
86
100
|
};
|
|
87
|
-
}, never
|
|
88
|
-
persisted: typeof Schema.Boolean;
|
|
101
|
+
}, never>>;
|
|
89
102
|
}>;
|
|
90
103
|
export type PushReq = typeof PushReq.Type;
|
|
91
104
|
export declare const PushAck: Schema.TaggedStruct<"WSMessage.PushAck", {
|
|
@@ -132,30 +145,36 @@ export declare const Message: Schema.Union<[Schema.TaggedStruct<"WSMessage.PullR
|
|
|
132
145
|
cursor: Schema.optional<typeof Schema.Number>;
|
|
133
146
|
}>, Schema.TaggedStruct<"WSMessage.PullRes", {
|
|
134
147
|
requestId: typeof Schema.String;
|
|
135
|
-
events: Schema.Array$<Schema.
|
|
136
|
-
|
|
137
|
-
readonly
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
readonly
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
readonly
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
readonly
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
148
|
+
events: Schema.Array$<Schema.Struct<{
|
|
149
|
+
mutationEventEncoded: Schema.SchemaClass<{
|
|
150
|
+
readonly id: {
|
|
151
|
+
readonly global: number;
|
|
152
|
+
readonly local: number;
|
|
153
|
+
};
|
|
154
|
+
readonly mutation: string;
|
|
155
|
+
readonly args: any;
|
|
156
|
+
readonly parentId: {
|
|
157
|
+
readonly global: number;
|
|
158
|
+
readonly local: number;
|
|
159
|
+
};
|
|
160
|
+
}, {
|
|
161
|
+
readonly id: {
|
|
162
|
+
readonly global: number;
|
|
163
|
+
readonly local: number;
|
|
164
|
+
};
|
|
165
|
+
readonly mutation: string;
|
|
166
|
+
readonly args: any;
|
|
167
|
+
readonly parentId: {
|
|
168
|
+
readonly global: number;
|
|
169
|
+
readonly local: number;
|
|
170
|
+
};
|
|
171
|
+
}, never>;
|
|
172
|
+
metadata: Schema.Option<Schema.Struct<{
|
|
173
|
+
/** ISO date format */
|
|
174
|
+
createdAt: typeof Schema.String;
|
|
175
|
+
}>>;
|
|
176
|
+
}>>;
|
|
177
|
+
remaining: typeof Schema.Number;
|
|
159
178
|
}>, Schema.TaggedStruct<"WSMessage.PushBroadcast", {
|
|
160
179
|
mutationEventEncoded: Schema.SchemaClass<{
|
|
161
180
|
readonly id: {
|
|
@@ -180,10 +199,13 @@ export declare const Message: Schema.Union<[Schema.TaggedStruct<"WSMessage.PullR
|
|
|
180
199
|
readonly local: number;
|
|
181
200
|
};
|
|
182
201
|
}, never>;
|
|
183
|
-
|
|
202
|
+
metadata: Schema.Option<Schema.Struct<{
|
|
203
|
+
/** ISO date format */
|
|
204
|
+
createdAt: typeof Schema.String;
|
|
205
|
+
}>>;
|
|
184
206
|
}>, Schema.TaggedStruct<"WSMessage.PushReq", {
|
|
185
207
|
requestId: typeof Schema.String;
|
|
186
|
-
|
|
208
|
+
batch: Schema.Array$<Schema.SchemaClass<{
|
|
187
209
|
readonly id: {
|
|
188
210
|
readonly global: number;
|
|
189
211
|
readonly local: number;
|
|
@@ -205,8 +227,7 @@ export declare const Message: Schema.Union<[Schema.TaggedStruct<"WSMessage.PullR
|
|
|
205
227
|
readonly global: number;
|
|
206
228
|
readonly local: number;
|
|
207
229
|
};
|
|
208
|
-
}, never
|
|
209
|
-
persisted: typeof Schema.Boolean;
|
|
230
|
+
}, never>>;
|
|
210
231
|
}>, Schema.TaggedStruct<"WSMessage.PushAck", {
|
|
211
232
|
requestId: typeof Schema.String;
|
|
212
233
|
mutationId: typeof Schema.Number;
|
|
@@ -235,30 +256,36 @@ export type Message = typeof Message.Type;
|
|
|
235
256
|
export type MessageEncoded = typeof Message.Encoded;
|
|
236
257
|
export declare const BackendToClientMessage: Schema.Union<[Schema.TaggedStruct<"WSMessage.PullRes", {
|
|
237
258
|
requestId: typeof Schema.String;
|
|
238
|
-
events: Schema.Array$<Schema.
|
|
239
|
-
|
|
240
|
-
readonly
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
readonly
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
readonly
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
readonly
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
259
|
+
events: Schema.Array$<Schema.Struct<{
|
|
260
|
+
mutationEventEncoded: Schema.SchemaClass<{
|
|
261
|
+
readonly id: {
|
|
262
|
+
readonly global: number;
|
|
263
|
+
readonly local: number;
|
|
264
|
+
};
|
|
265
|
+
readonly mutation: string;
|
|
266
|
+
readonly args: any;
|
|
267
|
+
readonly parentId: {
|
|
268
|
+
readonly global: number;
|
|
269
|
+
readonly local: number;
|
|
270
|
+
};
|
|
271
|
+
}, {
|
|
272
|
+
readonly id: {
|
|
273
|
+
readonly global: number;
|
|
274
|
+
readonly local: number;
|
|
275
|
+
};
|
|
276
|
+
readonly mutation: string;
|
|
277
|
+
readonly args: any;
|
|
278
|
+
readonly parentId: {
|
|
279
|
+
readonly global: number;
|
|
280
|
+
readonly local: number;
|
|
281
|
+
};
|
|
282
|
+
}, never>;
|
|
283
|
+
metadata: Schema.Option<Schema.Struct<{
|
|
284
|
+
/** ISO date format */
|
|
285
|
+
createdAt: typeof Schema.String;
|
|
286
|
+
}>>;
|
|
287
|
+
}>>;
|
|
288
|
+
remaining: typeof Schema.Number;
|
|
262
289
|
}>, Schema.TaggedStruct<"WSMessage.PushBroadcast", {
|
|
263
290
|
mutationEventEncoded: Schema.SchemaClass<{
|
|
264
291
|
readonly id: {
|
|
@@ -283,7 +310,10 @@ export declare const BackendToClientMessage: Schema.Union<[Schema.TaggedStruct<"
|
|
|
283
310
|
readonly local: number;
|
|
284
311
|
};
|
|
285
312
|
}, never>;
|
|
286
|
-
|
|
313
|
+
metadata: Schema.Option<Schema.Struct<{
|
|
314
|
+
/** ISO date format */
|
|
315
|
+
createdAt: typeof Schema.String;
|
|
316
|
+
}>>;
|
|
287
317
|
}>, Schema.TaggedStruct<"WSMessage.PushAck", {
|
|
288
318
|
requestId: typeof Schema.String;
|
|
289
319
|
mutationId: typeof Schema.Number;
|
|
@@ -307,7 +337,7 @@ export declare const ClientToBackendMessage: Schema.Union<[Schema.TaggedStruct<"
|
|
|
307
337
|
cursor: Schema.optional<typeof Schema.Number>;
|
|
308
338
|
}>, Schema.TaggedStruct<"WSMessage.PushReq", {
|
|
309
339
|
requestId: typeof Schema.String;
|
|
310
|
-
|
|
340
|
+
batch: Schema.Array$<Schema.SchemaClass<{
|
|
311
341
|
readonly id: {
|
|
312
342
|
readonly global: number;
|
|
313
343
|
readonly local: number;
|
|
@@ -329,8 +359,7 @@ export declare const ClientToBackendMessage: Schema.Union<[Schema.TaggedStruct<"
|
|
|
329
359
|
readonly global: number;
|
|
330
360
|
readonly local: number;
|
|
331
361
|
};
|
|
332
|
-
}, never
|
|
333
|
-
persisted: typeof Schema.Boolean;
|
|
362
|
+
}, never>>;
|
|
334
363
|
}>, Schema.TaggedStruct<"WSMessage.AdminResetRoomReq", {
|
|
335
364
|
requestId: typeof Schema.String;
|
|
336
365
|
adminSecret: typeof Schema.String;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws-message-types.d.ts","sourceRoot":"","sources":["../../src/common/ws-message-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAEhD,eAAO,MAAM,OAAO;;IAElB,wDAAwD;;EAExD,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"ws-message-types.d.ts","sourceRoot":"","sources":["../../src/common/ws-message-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAEhD,eAAO,MAAM,OAAO;;IAElB,wDAAwD;;EAExD,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,eAAO,MAAM,YAAY;IACvB,sBAAsB;;EAEtB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAEnD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;YANlB,sBAAsB;;;;;EAetB,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;QAnBxB,sBAAsB;;;EAsBtB,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAA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